packaging
#
Method #1: auxlib.packaging
as a run time dependency
Place the following lines in your package's main __init__.py
Method #2: auxlib.packaging
as a build time-only dependency
Place the following lines in your package's main __init__.py
Method #3: write .version file
Configuring python setup.py test for Tox
must use setuptools (distutils doesn't have a test cmd)
Classes#
Enhanced 'build_py' command that includes data files with packages |
|
Smart sdist that finds anything supported by revision control |
Functions#
|
|
|
|
Return a PEP440-compliant version derived from the git status. |
|
|
Returns a version string for the current package, derived |
|
|
|
|
|
Return 'pathname' as a name that will work on the native filesystem, |
|
Attributes#
- Response#
- GIT_DESCRIBE_REGEX#
- call(command, path=None, raise_on_error=True)#
- _get_version_from_version_file(path)#
- _git_describe_tags(path)#
- _get_version_from_git_tag(tag)#
Return a PEP440-compliant version derived from the git status. If that fails for any reason, return the changeset hash.
- _get_version_from_git_clone(path)#
- get_version(dunder_file)#
Returns a version string for the current package, derived either from git or from a .version file.
This function is expected to run in two contexts. In a development context, where .git/ exists, the version is pulled from git tags. Using the BuildPyCommand and SDistCommand classes for cmdclass in setup.py will write a .version file into any dist.
In an installed context, the .version file written at dist build time is the source of version information.
- write_version_into_init(target_dir, version)#
- write_version_file(target_dir, version)#
- class BuildPyCommand(dist)#
Bases:
setuptools.command.build_py.build_py
Enhanced 'build_py' command that includes data files with packages
The data files are specified via a 'package_data' argument to 'setup()'. See 'setuptools.dist.Distribution' for more details.
Also, this version of the 'build_py' command allows you to specify both 'py_modules' and 'packages' in the same setup operation.
- run()#
Build modules, packages, and copy data files to build directory
- class SDistCommand(dist)#
Bases:
setuptools.command.sdist.sdist
Smart sdist that finds anything supported by revision control
- make_release_tree(base_dir, files)#
Create the directory tree that will become the source distribution archive. All directories implied by the filenames in 'files' are created under 'base_dir', and then we hard link or copy (if hard linking is unavailable) those files into place. Essentially, this duplicates the developer's source tree, but in a directory named after the distribution, containing only the files to be distributed.
- convert_path(pathname)#
Return 'pathname' as a name that will work on the native filesystem, i.e. split it on '/' and put it back together again using the current directory separator. Needed because filenames in the setup script are always supplied in Unix style, and have to be converted to the local convention before we can actually use them in the filesystem. Raises ValueError on non-Unix-ish systems if 'pathname' either starts or ends with a slash.
Copied from setuptools._distutils.util: pypa/setuptools
- find_packages(where='.', exclude=())#
- target_dir#