pyscaffold.contrib package

Submodules

pyscaffold.contrib.ptr module

Copyright Jason R. Coombs

MIT-licenced

Implementation

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

Bases: setuptools.dist.Distribution

allow_hosts = None
fetch_build_egg(req)[source]

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)
finalize_options()[source]
initialize_options()[source]
install_dists(dist)[source]

Extend install_dists to include extras support

install_extra_dists(dist)[source]

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.

run()[source]

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

run_tests()[source]

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')]
pyscaffold.contrib.ptr.null()[source]

pyscaffold.contrib.six module

Utilities for writing code that runs on Python 2 and 3

class pyscaffold.contrib.six.Module_six_moves_urllib[source]

Bases: module

Create a six.moves.urllib namespace that resembles the Python 3 namespace

error = <module 'pyscaffold.contrib.six.moves.urllib.error'>
parse = <module 'pyscaffold.contrib.six.moves.urllib_parse'>
request = <module 'pyscaffold.contrib.six.moves.urllib.request'>
response = <module 'pyscaffold.contrib.six.moves.urllib.response'>
robotparser = <module 'pyscaffold.contrib.six.moves.urllib.robotparser'>
class pyscaffold.contrib.six.Module_six_moves_urllib_error(name)[source]

Bases: pyscaffold.contrib.six._LazyModule

Lazy loading of moved objects in six.moves.urllib_error

ContentTooShortError
HTTPError
URLError
class pyscaffold.contrib.six.Module_six_moves_urllib_parse(name)[source]

Bases: pyscaffold.contrib.six._LazyModule

Lazy loading of moved objects in six.moves.urllib_parse

ParseResult
SplitResult
parse_qs
parse_qsl
quote
quote_plus
splitquery
splittag
splituser
splitvalue
unquote
unquote_plus
unquote_to_bytes
urldefrag
urlencode
urljoin
urlparse
urlsplit
urlunparse
urlunsplit
uses_fragment
uses_netloc
uses_params
uses_query
uses_relative
class pyscaffold.contrib.six.Module_six_moves_urllib_request(name)[source]

Bases: pyscaffold.contrib.six._LazyModule

Lazy loading of moved objects in six.moves.urllib_request

AbstractBasicAuthHandler
AbstractDigestAuthHandler
BaseHandler
CacheFTPHandler
FTPHandler
FancyURLopener
FileHandler
HTTPBasicAuthHandler
HTTPCookieProcessor
HTTPDefaultErrorHandler
HTTPDigestAuthHandler
HTTPErrorProcessor
HTTPHandler
HTTPPasswordMgr
HTTPPasswordMgrWithDefaultRealm
HTTPRedirectHandler
HTTPSHandler
OpenerDirector
ProxyBasicAuthHandler
ProxyDigestAuthHandler
ProxyHandler
Request
URLopener
UnknownHandler
build_opener
getproxies
install_opener
parse_http_list
parse_keqv_list
pathname2url
proxy_bypass
url2pathname
urlcleanup
urlopen
urlretrieve
class pyscaffold.contrib.six.Module_six_moves_urllib_response(name)[source]

Bases: pyscaffold.contrib.six._LazyModule

Lazy loading of moved objects in six.moves.urllib_response

addbase
addclosehook
addinfo
addinfourl
class pyscaffold.contrib.six.Module_six_moves_urllib_robotparser(name)[source]

Bases: pyscaffold.contrib.six._LazyModule

Lazy loading of moved objects in six.moves.urllib_robotparser

RobotFileParser
class pyscaffold.contrib.six.MovedAttribute(name, old_mod, new_mod, old_attr=None, new_attr=None)[source]

Bases: pyscaffold.contrib.six._LazyDescr

class pyscaffold.contrib.six.MovedModule(name, old, new=None)[source]

Bases: pyscaffold.contrib.six._LazyDescr

pyscaffold.contrib.six.add_metaclass(metaclass)[source]

Class decorator for creating a class with a metaclass.

pyscaffold.contrib.six.add_move(move)[source]

Add an item to six.moves.

pyscaffold.contrib.six.assertCountEqual(self, *args, **kwargs)[source]
pyscaffold.contrib.six.assertRaisesRegex(self, *args, **kwargs)[source]
pyscaffold.contrib.six.assertRegex(self, *args, **kwargs)[source]
pyscaffold.contrib.six.b(s)[source]

Byte literal

pyscaffold.contrib.six.create_unbound_method(func, cls)[source]
pyscaffold.contrib.six.get_unbound_function(unbound)[source]

Get the function out of a possibly unbound function

pyscaffold.contrib.six.int2byte()

S.pack(v1, v2, …) -> bytes

Return a bytes object containing values v1, v2, … packed according to the format string S.format. See help(struct) for more on format strings.

pyscaffold.contrib.six.iteritems(d, **kw)[source]

Return an iterator over the (key, value) pairs of a dictionary.

pyscaffold.contrib.six.iterkeys(d, **kw)[source]

Return an iterator over the keys of a dictionary.

pyscaffold.contrib.six.iterlists(d, **kw)[source]

Return an iterator over the (key, [values]) pairs of a dictionary.

pyscaffold.contrib.six.itervalues(d, **kw)[source]

Return an iterator over the values of a dictionary.

pyscaffold.contrib.six.python_2_unicode_compatible(klass)[source]

A decorator that defines __unicode__ and __str__ methods under Python 2. Under Python 3 it does nothing.

To support Python 2 and 3 with a single code base, define a __str__ method returning text and apply this decorator to the class.

pyscaffold.contrib.six.raise_from(value, from_value)[source]
pyscaffold.contrib.six.remove_move(name)[source]

Remove item from six.moves.

pyscaffold.contrib.six.reraise(tp, value, tb=None)[source]

Reraise an exception.

pyscaffold.contrib.six.u(s)[source]

Text literal

pyscaffold.contrib.six.with_metaclass(meta, *bases)[source]

Create a base class with a metaclass.

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.warn_about_deprecated_pyscaffold()[source]
pyscaffold.contrib.write_pbr_json(*args, **kwargs)[source]