raver.cli
#
Module Contents#
Classes#
Raver context object. |
Functions#
|
Ratio versioning checker. |
|
Recursive defaultdict. |
|
Print to stderr in red and exit with 1. |
|
Print to stderr in yellow but do not exit, yet. |
|
Only print debug messages if debug mode is set. |
|
Resolve a Python module to it's file Path. |
|
Get module version from it's text. |
|
Run command and return decoded and stripped output. |
|
Resolve provided path relative to this git directory's root. |
|
Get current git reference. |
|
|
|
|
|
|
|
Check whether version has been properly incremented versus the git reference. |
|
Check whether semantic version exists in changelog path. |
Attributes#
- raver.cli.VERSION#
- raver.cli.cli(ctx: click.Context, module: pathlib.Path | None, ref: str | None, config: pathlib.Path | None, changelog: pathlib.Path | None, debug: bool, version: bool)#
Ratio versioning checker.
- class raver.cli.RaverContext(module: pathlib.Path | None, ref: str | None, config: pathlib.Path | None, changelog: pathlib.Path | None, debug: bool, version: bool, success: bool = True)#
Raver context object.
- TYPES#
- parse()#
Parse with current settings.
- parse_poetry_toml(cdict: collections.defaultdict)#
Parse the poetry section of a config dictionary.
- parse_raver_toml(cdict: collections.defaultdict)#
Parse own TOML keys.
- parse_section(cdict: Any, types: Dict[str, Any], section: str)#
Check a section on allowed keys and set config attributes.
- parse_module()#
Parse module contents for version info.
- parse_ref()#
Parse git ref for info.
- report()#
Describe current status.
- parse_changelog()#
Check if a changelog entry exists for the current version.
- raver.cli.configdict(**kwargs) collections.defaultdict #
Recursive defaultdict.
- raver.cli.info#
- raver.cli.success#
- raver.cli.error(message: str, exitcode: int = 1)#
Print to stderr in red and exit with 1.
- raver.cli.warn(message: str)#
Print to stderr in yellow but do not exit, yet.
- raver.cli.debug(message: str)#
Only print debug messages if debug mode is set.
- raver.cli.resolve_module_path(module: pathlib.Path) pathlib.Path #
Resolve a Python module to it’s file Path.
- raver.cli.get_module_version(text: str) semver.VersionInfo #
Get module version from it’s text.
- raver.cli.capture(cmd: str, **kwargs) str #
Run command and return decoded and stripped output.
- raver.cli.resolve_git_path(path: str | pathlib.Path) pathlib.Path #
Resolve provided path relative to this git directory’s root.
- raver.cli.get_current_ref() str | None #
Get current git reference.
- raver.cli.fetch_git_ref(ref: str)#
- raver.cli.get_ref_text(path: str | pathlib.Path, ref: str = 'master') str #
- raver.cli.has_ref_changes(ref: str) bool #
- raver.cli.check_ref_increments(module_version: semver.VersionInfo, ref_version: semver.VersionInfo, changes: bool) bool #
Check whether version has been properly incremented versus the git reference.
- raver.cli.check_changelog(changelog: pathlib.Path, version: semver.VersionInfo) bool #
Check whether semantic version exists in changelog path.
Only checks for major.minor.patch, prereleases and builds are ignored.