zensols.relpo package¶
Submodules¶
zensols.relpo.app module¶
A Python project release with Git integration.
- class zensols.relpo.app.Application(config_files, temporary_dir)[source]¶
Bases:
object
The application client class to the command line.
- __init__(config_files, temporary_dir)¶
- mkdoc(out=None)[source]¶
Create the site documentation.
- Parameters:
out (
Path
) – the directory to output the documentation
- mkenvdist(out=None)[source]¶
Create the environment distribution file.
- Parameters:
out (
Path
) – the output distribution file
- mktag(message)[source]¶
Create a tag using the last change log entry’s version.
- Parameters:
message (
str
) – the message (comment-like) of the tag
zensols.relpo.cli module¶
Command line entry point to the application.
- zensols.relpo.cli.invoke(action=None, version=False, level='[warn|info|debug]', config='relpo.yml', tmp=PosixPath('temp'), out='<path>', format='<json|yaml>', message='<comment>')[source]¶
Python project release with Git integration.
- actions:
config output the synthesized build configuration meta [-o, -f] output the project metadata pyproject write the pyproject.toml file mktag [-m] create a new tag using the last change log rmtag remove the most recent tag bumptag move the latest tag to the last commit template render standard in with: date, project, config check check for any issues with creating a release mkdoc [-o] create site documentation mkenvdist [-o] create the environment distribution
zensols.relpo.doc module¶
Classes that are used to write site documentation.
- class zensols.relpo.doc.DocConfig(data, stage_dir, config_template_dir, apidoc_template_dir, apidoc_output_dir, python_home, api_config, copy)[source]¶
Bases:
Config
Configuration for API doc generation.
- __init__(data, stage_dir, config_template_dir, apidoc_template_dir, apidoc_output_dir, python_home, api_config, copy)¶
-
apidoc_template_dir:
Path
¶ The directory used by
sphinx-api
to generate Sphinx RST files. This is the output directory of theconfig_template_dir
config files.
- class zensols.relpo.doc.Documentor(config, template_params, temporary_dir, output_dir)[source]¶
Bases:
object
This class creates files used by
sphinx-api
andsphinx-build
to create a package API documentation. First rendered (from Jinja2 templates) Sphinx configuration (i.e..rst
files) and static files are written to a source directory. Then Sphinx is given the source directory to generate the API documentation.- __init__(config, template_params, temporary_dir, output_dir)¶
zensols.relpo.domain module¶
Application domain classes.
- class zensols.relpo.domain.ChangeLog(path)[source]¶
Bases:
Flattenable
Parses the keepchangelog
CHANGELOG.md
(markdown) format.- __init__(path)¶
- property entries: Tuple[ChangeLogEntry, ...]¶
- property today: ChangeLogEntry | None¶
only today’s changelog entry if there is one for today.
- class zensols.relpo.domain.ChangeLogEntry(version, date)[source]¶
Bases:
Entry
A ChangeLog entry.
- __init__(version, date)¶
- class zensols.relpo.domain.Commit(date, author, sha, summary)[source]¶
Bases:
Flattenable
A Git commit.
- __init__(date, author, sha, summary)¶
- class zensols.relpo.domain.Config(data)[source]¶
Bases:
Flattenable
A configuration container for sections of the
relpo.yml
file.- __init__(data)¶
- class zensols.relpo.domain.Entry(version, date)[source]¶
Bases:
Flattenable
Base class for things that have versions with dates.
- __init__(version, date)¶
- class zensols.relpo.domain.Flattenable[source]¶
Bases:
object
A class that that generates a dictionary recursively from data classes and primitive data structures.
- __init__()¶
- exception zensols.relpo.domain.ProjectRepoError[source]¶
Bases:
Exception
Raised for project repository related errors.
- __module__ = 'zensols.relpo.domain'¶
- __weakref__¶
list of weak references to the object
- class zensols.relpo.domain.Release(tag, change_log_entry)[source]¶
Bases:
Flattenable
A matching entry between a release tag the change log.
- __init__(tag, change_log_entry)¶
-
change_log_entry:
ChangeLogEntry
¶
- class zensols.relpo.domain.Tag(version, date, name, sha, message)[source]¶
Bases:
Entry
A git tag that was used for a previous release or a current release.
- __init__(version, date, name, sha, message)¶
- class zensols.relpo.domain.Version(major=0, minor=0, debug=1)[source]¶
Bases:
Flattenable
A 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.- __init__(major=0, minor=0, debug=1)¶
- static from_str(s)[source]¶
Create a version instance from a string formatted version.
- Return type:
- Returns:
a new instance of
Version
- increment(decimal='debug', inc=1)[source]¶
Increment the version in the instance. By default the debug portion of the instance is incremented.
zensols.relpo.envdist module¶
Environment distribution file build.
- class zensols.relpo.envdist.Dependency(is_conda, source)[source]¶
Bases:
Flattenable
A lock dependency.
- __init__(is_conda, source)¶
- property conda_platform: str | None¶
The platform of the conda dependency, or
None
if not a conda dependnecy.
- property is_file: bool¶
Whether or not the dependency is a project local file. This is not to be confused with a cached file downloaded to the local file system.
- class zensols.relpo.envdist.Environment(name, platforms)[source]¶
Bases:
Flattenable
A pixi environment.
- __init__(name, platforms)¶
- class zensols.relpo.envdist.EnvironmentDistBuilder(config, template_params, temporary_dir, output_file, progress)[source]¶
Bases:
Flattenable
This class creates files used by
sphinx-api
andsphinx-build
to create a package API documentation. First rendered (from Jinja2 templates) Sphinx configuration (i.e..rst
files) and static files are written to a source directory. Then Sphinx is given the source directory to generate the API documentation.- __init__(config, template_params, temporary_dir, output_file, progress)¶
-
config:
EnvironmentDistConfig
¶ The parsed document generation configuration.
- get_environment_file(platform_name)[source]¶
The contents of the a platform’s Conda
environment.yml
file- Return type:
- class zensols.relpo.envdist.EnvironmentDistConfig(data, cache_dir, pixi_lock_file, environment, platforms, injects)[source]¶
Bases:
Config
Configuration for API doc generation.
- __init__(data, cache_dir, pixi_lock_file, environment, platforms, injects)¶
- class zensols.relpo.envdist.Platform(name, dependencies)[source]¶
Bases:
Flattenable
A parsed platform from the Pixi lock file.
- __init__(name, dependencies)¶
-
dependencies:
List
[Dependency
]¶ The platform dependnecies
zensols.relpo.project module¶
A utility class that represents a Git tag.
- class zensols.relpo.project.Project(config_files, temporary_dir)[source]¶
Bases:
Flattenable
The project and related data of a Python source code repository.
- __init__(config_files, temporary_dir)¶
- property config: ProjectConfig¶
The project config used to populate templates. This is the parsed data from all configuration files (
config_files
).
- property pyproject: str¶
The
pyproject.toml
rendered content as a string.- Parameters:
template_dir – the directory to the zenbuild toml template files
- read_config()[source]¶
Return the parsed
config_files
with each configuration file as an element of the returned list.
- property repo: ProjectRepo¶
The Git repository and its metadata.
- class zensols.relpo.project.ProjectConfig(data, proj_dir, template_dir, pyproject_template_files, table_appends, change_log_file_name)[source]¶
Bases:
Config
The
Project
configuration.- __init__(data, proj_dir, template_dir, pyproject_template_files, table_appends, change_log_file_name)¶
- property envdist_config: EnvironmentDistConfig¶
The environment distribution configuraiton.
-
pyproject_template_files:
Tuple
[Path
,...
]¶ Additional template files used to render the
pyproject.toml
file.
zensols.relpo.repo module¶
Project and git repository classes.
- class zensols.relpo.repo.GitRemote(name, url)[source]¶
Bases:
Flattenable
A Git remote created with a command such as:
``git remote add <name> <url>``
- __init__(name, url)¶
- class zensols.relpo.repo.ProjectRepo(repo_dir, commit_limit=20)[source]¶
Bases:
Flattenable
A Python source code Git repository. 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>
).- __init__(repo_dir, commit_limit=20)¶
- property git_repo: Repo¶