zensols.pybuild package¶
Submodules¶
zensols.pybuild.cli module¶
Client entry point for the command line program.
-
class
zensols.pybuild.cli.Cli(setup_path: str = None, output_format: str = None)[source]¶ Bases:
object
zensols.pybuild.remote module¶
A utility class that represents a Git remote.
zensols.pybuild.setuputil module¶
A utility class to help with setuptools, git and GitHub integration.
-
class
zensols.pybuild.setuputil.SetupUtil(name: str, user: str, project: str, setup_path: pathlib.Path = None, package_names: List[str] = None, root_contained_file=None, req_file: str = 'requirements.txt', has_entry_points=True, **kwargs)[source]¶ Bases:
objectThis class is used in
setup.pyin place of the typical call tosetuptoolsand provides a lot of the information contained in the git repo as metadata, such as the version from the latest tag. It also helps with finding paths in a the Zensols default Python project configuration.The class also provides build information to client APIs (see
source).-
DEFAULT_ROOT_CONTAINED_FILE= 'README.md'¶
-
DO_SETUP= True¶
-
FIELDS= '\nname packages package_data version description author author_email url\ndownload_url long_description long_description_content_type install_requires\nkeywords classifiers\n'¶
Return the author of the package.
Return the email address of the project.
-
property
download_url¶ Return the download URL used to obtain the distribution wheel.
-
property
entry_points¶ Return the entry points (i.e. console application script), if any.
-
classmethod
find_root(start_path: pathlib.Path, root_contained_file: pathlib.Path = None) → pathlib.Path[source]¶ Find the root path by iterating to the root looking for the
root_contained_filestarting from directorystart_path.
-
get_properties(paths: bool = False) → Tuple[List[str], Dict[str, str]][source]¶ Return the properties used by
setuptools.
-
property
install_requires¶ Get a list of pip dependencies from the requirements file.
-
property
long_description¶ Return a long human readable description of the package, which is the contents of the
README.mdfile. This is added so the README shows up on the pypi module page.
-
property
packages¶ Get a list of directories that contain package information to tbe included with the distribution files.
-
property
remote_set¶ Return a remote set for the project.
-
property
root_path¶ Return root path to the project.
-
setup()[source]¶ Called in the
setup.pyto invoke the Pythonsetuptoolspackage. This assembles the information needed and callssetuptools.setup.
-
property
short_description¶
-
classmethod
source(start_path: pathlib.Path = PosixPath('/Users/landes/view/build/zenpybuild'), rel_setup_path: pathlib.Path = PosixPath('src/python/setup.py'), var: str = 'su')[source]¶ Source the
setup.pysetuptoolsfile to get an instance of this class to be used in other APIs that want to access build information. This is done by usingexecto evaluate thesetup.pyfile and skipping the call tosetuptools.setup.- Parameters
rel_setup_path – the relative path to the
setup.pyfile, which defaults tosrc/python/setup.pyper standard Zensols buildstart_path – the path to start looking for the
rel_setup_pathvar – the name of the variable that was was in
setup.pyfor the instantiation of this class
-
property
tag¶ Return the tag for the project.
-
to_json(indent: int = 4, writer: _io.TextIOWrapper = <_io.TextIOWrapper name='<stdout>' mode='w' encoding='UTF-8'>) → str[source]¶
-
property
url¶ Return the URL used to access the project on GitHub.
-
property
version¶ Return the version of the last tag in the git repo.
-
zensols.pybuild.tag module¶
A utility class that represents a Git tag.
-
class
zensols.pybuild.tag.Tag(repo_dir: pathlib.Path = PosixPath('.'), message: str = 'none', dry_run: bool = False)[source]¶ Bases:
objectRepresents a Git tag. It’s main use is determining the last tag in a sorted (by version) used to increment to the next version. However, it also creates tags and provides additional information about existing tags.
All tags have an implicit format by sorting in decimal format (i.e.
<major>.<minor>.<version>).-
property
build_info¶ Return information about the last commit and a build time with the current time.
-
get_entries() → List[Dict[str, str]][source]¶ Return a list of dicts, each with information about the tag.
- Keys::
name: the name of the tag
ver: the version of the tag (in format
v<major>.<minor>.<debug>)date: date the tag was created
tag: the tag without the prefix (i.e. sans
v)message: the comment given at tag creation
-
property
last_commit¶ Return rhe last commit ID (sha1).
-
property
last_tag¶ Return the last tag.
-
property
last_tag_entry¶ Return the last entry given by
get_entries.
-
property
zensols.pybuild.version module¶
A helper class for version formatting.
-
class
zensols.pybuild.version.Version(major=0, minor=0, debug=1)[source]¶ Bases:
objectA container class for a tag version. All tags have an implicit format by sorting in decimal format (i.e.
<major>.<minor>.<version>). This class contains methods that make it sortable.