API¶
-
class
assemble.
Package
(package_name, setup_path, package_path)¶ Package information and helpers.
Parameters: -
assert_git_is_clean
()¶ Assert that there are no GIT changes pending.
-
build_distribution
(verify=True)¶ Build distribution that can be uploaded to PyPI.
Parameters: verify (bool) – Verify the build (checks version) [default `True].
-
get_environment
(environment)¶ When environment is None use the version to determine.
When the version is in development, it will return the ‘test’ environment, otherwise it will return ‘pypi’.
Parameters: environment (str) – Name of the PyPI environment, None for automatic discovery. Return type: str
-
get_filename_package
(filename)¶ Get the full filename of a file in the package path.
Parameters: filename (str) – Filename to locate. Return type: str
-
get_filename_setup
(filename)¶ Get the full filename of a file in the setup path.
Parameters: filename (str) – Filename to locate. Return type: str
Retrieve all tags from GIT.
Return type: list
-
get_requirements
(named=False, equal=False)¶ Retrieve requirements of the package (scan using AST).
Parameters:
-
git_tag
()¶ Tag GIT version (add to __init__, commit, push, tag, push).
-
patch_version
(version)¶ Patch package version in __init__.py.
This will also set the meta.version to the new version.
Parameters: version (str) – The new version.
-
read_from_package
(filename)¶ Read contents from a file in the package directory.
Parameters: filename (str) – Filename to read. Return type: str
-
read_from_setup
(filename)¶ Read contents from a file in the setup directory.
Parameters: filename (str) – Filename to read. Return type: str
-
recreate_tox
(environments)¶ Recreate tox-environments.
Parameters: environments (list) – Which environments to recreate. Return type: list
-
register_pypi
(environment=None)¶ Register package to PyPI
Parameters: environment (str) – Which environment to run on.
-
run_tests
(environments=None, coverage=True)¶ Run tox-tests.
Parameters:
-
setup
(keywords, classifiers, install_requires=None, **kwargs)¶ Run setuptools.setup using the meta-data and README.rst
Parameters: Return type: distutils.dist.Distribution
-
-
assemble.
get_package
(origin='.', search='src')¶ Get package from current directory.
This method tries to locate your package in the current directory. Use this in your setup.py.
Parameters: Return type:
-
class
assemble.
Meta
(content)¶ Meta data about the package read from __init__.py file.
It scans for __variable__ = ‘’ defined variables and adds it to the Meta class. It requires all the keywords it scans for.
Parameters: - author (str) – Name of the author __author__.
- description (str) – Description of the package __description__.
- email (str) – Email address of author __email__.
- license (str) – License definition __license__.
- package (str) – Name of the package __package__.
- title (str) – Title of the package __title__.
- uri (str) – URI of package source __uri__.
- version (str) – Current version __version__.