:py:mod:`raver.cli` =================== .. py:module:: raver.cli Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: raver.cli.RaverContext Functions ~~~~~~~~~ .. autoapisummary:: raver.cli.cli raver.cli.configdict raver.cli.error raver.cli.warn raver.cli.debug raver.cli.resolve_module_path raver.cli.get_module_version raver.cli.capture raver.cli.resolve_git_path raver.cli.get_current_ref raver.cli.fetch_git_ref raver.cli.get_ref_text raver.cli.has_ref_changes raver.cli.check_ref_increments raver.cli.check_changelog Attributes ~~~~~~~~~~ .. autoapisummary:: raver.cli.VERSION raver.cli.info raver.cli.success .. py:data:: VERSION .. py:function:: cli(ctx: click.Context, module: Optional[pathlib.Path], ref: Optional[str], config: Optional[pathlib.Path], changelog: Optional[pathlib.Path], debug: bool, version: bool) Ratio versioning checker. .. py:class:: RaverContext(module: Optional[pathlib.Path], ref: Optional[str], config: Optional[pathlib.Path], changelog: Optional[pathlib.Path], debug: bool, version: bool, success: bool = True) Raver context object. .. py:attribute:: TYPES .. py:method:: parse() Parse with current settings. .. py:method:: parse_poetry_toml(cdict: collections.defaultdict) Parse the poetry section of a config dictionary. .. py:method:: parse_raver_toml(cdict: collections.defaultdict) Parse own TOML keys. .. py:method:: parse_section(cdict: Any, types: Dict[str, Any], section: str) Check a section on allowed keys and set config attributes. .. py:method:: parse_module() Parse module contents for version info. .. py:method:: parse_ref() Parse git ref for info. .. py:method:: report() Describe current status. .. py:method:: parse_changelog() Check if a changelog entry exists for the current version. .. py:function:: configdict(**kwargs) -> collections.defaultdict Recursive defaultdict. .. py:data:: info .. py:data:: success .. py:function:: error(message: str, exitcode: int = 1) Print to stderr in red and exit with 1. .. py:function:: warn(message: str) Print to stderr in yellow but do not exit, yet. .. py:function:: debug(message: str) Only print debug messages if debug mode is set. .. py:function:: resolve_module_path(module: pathlib.Path) -> pathlib.Path Resolve a Python module to it's file Path. .. py:function:: get_module_version(text: str) -> semver.VersionInfo Get module version from it's text. .. py:function:: capture(cmd: str, **kwargs) -> str Run command and return decoded and stripped output. .. py:function:: resolve_git_path(path: Union[str, pathlib.Path]) -> pathlib.Path Resolve provided path relative to this git directory's root. .. py:function:: get_current_ref() -> Optional[str] Get current git reference. .. py:function:: fetch_git_ref(ref: str) .. py:function:: get_ref_text(path: Union[str, pathlib.Path], ref: str = 'master') -> str .. py:function:: has_ref_changes(ref: str) -> bool .. py:function:: 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. .. py:function:: 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.