pyscaffold.contrib package


pyscaffold.contrib.ptr module

Copyright Jason R. Coombs



class pyscaffold.contrib.ptr.CustomizedDist(attrs=None)[source]

Bases: setuptools.dist.Distribution

allow_hosts = None

Specialized version of Distribution.fetch_build_egg that respects respects allow_hosts and index_url.

index_url = None
class pyscaffold.contrib.ptr.PyTest(dist, **kw)[source]

Bases: setuptools.command.test.test

>>> import setuptools
>>> dist = setuptools.Distribution()
>>> cmd = PyTest(dist)

Set final values for all the options that this command supports. This is always called as late as possible, ie. after any option assignments from the command-line or from other commands have been done. Thus, this is the place to code option dependencies: if ‘foo’ depends on ‘bar’, then it is safe to set ‘foo’ from ‘bar’ as long as ‘foo’ still has the same value it was assigned in ‘initialize_options()’.

This method must be implemented by all command classes.


Set default values for all the options that this command supports. Note that these defaults may be overridden by other commands, by the setup script, by config files, or by the command-line. Thus, this is not the place to code dependencies between options; generally, ‘initialize_options()’ implementations are just a bunch of “ = None” assignments.

This method must be implemented by all command classes.


Extend install_dists to include extras support


Install extras that are indicated by markers or install all extras if ‘–extras’ is indicated.

static marker_passes(marker)[source]

Given an environment marker, return True if the marker is valid and matches this environment.

static paths_on_pythonpath(paths)[source]

Backward compatibility for paths_on_pythonpath; Returns a null context if paths_on_pythonpath is not implemented in orig.test. Note that this also means that the paths iterable is never consumed, which incidentally means that the None values from dist.fetch_build_eggs in older Setuptools will be disregarded.


Override run to ensure requirements are available in this session (but don’t install them anywhere).


Invoke pytest, replacing argv.

user_options = [('extras', None, 'Install (all) setuptools extras when running tests'), ('index-url=', None, 'Specify an index url from which to retrieve dependencies'), ('allow-hosts=', None, 'Whitelist of comma-separated hosts to allow when retrieving dependencies'), ('addopts=', None, 'Additional options to be passed verbatim to the pytest runner')]

Module contents

Contribution packages used by PyScaffold

All packages inside contrib are external packages that come with their own licences and are not part of the PyScaffold source code itself. The reason for shipping these dependencies directly is to avoid problems in the resolution of setup_requires dependencies that occurred more often than not, see issues #71 and #72.

Currently the contrib packages are:

  1. setuptools_scm v1.17.0
  2. six 1.11.0
  3. pytest-runner 3.0

The packages/modules were just copied over.

pyscaffold.contrib.scm_find_files(*args, **kwargs)[source]
pyscaffold.contrib.scm_get_local_dirty_tag(*args, **kwargs)[source]
pyscaffold.contrib.scm_get_local_node_and_date(*args, **kwargs)[source]
pyscaffold.contrib.scm_guess_next_dev_version(*args, **kwargs)[source]
pyscaffold.contrib.scm_parse_archival(*args, **kwargs)[source]
pyscaffold.contrib.scm_parse_git(*args, **kwargs)[source]
pyscaffold.contrib.scm_parse_hg(*args, **kwargs)[source]
pyscaffold.contrib.scm_parse_pkginfo(*args, **kwargs)[source]
pyscaffold.contrib.scm_postrelease_version(*args, **kwargs)[source]
pyscaffold.contrib.write_pbr_json(*args, **kwargs)[source]