drain-swamp

Entrypoint which updates: changelog, NOTICE.txt and docs?/conf.py

drain_swamp.cli_igor._logger: logging.Logger

Module level logger

drain_swamp.cli_igor.entrypoint_name: str = "drain-swamp"

Command line entrypoint file name

drain_swamp.cli_igor.help_path: str

cli option --path doc string

drain_swamp.cli_igor.help_kind: str

cli option --kind doc string

drain_swamp.cli_igor.help_snippet_co: str

cli option –snip doc string

drain_swamp.cli_igor.EPILOG_SEED: str

Exit codes explanation for command, seed

drain_swamp.cli_igor.EPILOG_EDITS: str

Exit codes explanation for command, edits

drain_swamp.cli_igor.EPILOG_LIST: str

Exit codes explanation for command, list

drain_swamp.cli_igor.EPILOG_BUILD: str

Exit codes explanation for command, build

drain_swamp.cli_igor.EPILOG_SCM_PAIR: str

Exit codes explanation for command, write_version

drain_swamp.cli_igor.EPILOG_PRETAG: str

Exit codes explanation for command, pretag

drain_swamp.cli_igor.EPILOG_CURRENT_VERSION: str

Exit codes explanation for command, current

drain_swamp.cli_igor.EPILOG_TAG_VERSION: str

Exit codes explanation for command, tag

drain_swamp.cli_igor.EPILOG_CHEATS: str

Exit codes explanation for command, cheats

drain_swamp.cli_igor.main()

drain-swamp --help, prints help

drain-swamp COMMAND --help, prints help for a command

Table 13 Commands

command

desc

status

seed

Updates changelog, CHANGES.rst, creating placeholder

edit

doc?/conf.py, NOTICE.txt, and CHANGES.rst

list

list snippets in doc?/conf.py

pretag

Print the sanitized semantic version str

current

Get scm version str

tag

Get version str from version file

cheats

Get useful notes to aid in kitting and publishing

build

Build package

depreciated

write_version

Given kind, write version str to version_file

depreciated

drain_swamp.cli_igor.seed(*args: Any, **kwargs: Any) Any

Updates changelog, CHANGES.rst, creating placeholder

If file [path]/CHANGES.rst does not exist, a warning is logged, need to capture that log entry

Parameters:

path (pathlib.Path) – path to the current working directory containing pyproject.toml

drain_swamp.cli_igor.edit(*args: Any, **kwargs: Any) Any

Edits: doc?/conf.py, NOTICE.txt, and CHANGES.rst

Parameters:
  • path (pathlib.Path) – path to the current working directory containing pyproject.toml

  • kind (str) – semantic version str or “current” or “now” or “tag”. Side effect changes src/[app name]/_version.py

  • snippet_co (str | None) – Sphinx doc?/conf.py snippet code. Supply none is no snippet has no code

drain_swamp.cli_igor.snippets_list(*args: Any, **kwargs: Any) Any

In Sphinx doc?/conf.py, list snippets

path is the package base folder. Searches for doc?/conf.py

Parameters:

path (pathlib.Path) – Default current working directory. package root folder. Must contain pyproject.toml

drain_swamp.cli_igor.validate_tag(*args: Any, **kwargs: Any) Any

Print the sanitized semantic version str

Normal cli usage

drain-swamp pretag “0.0.1”

Usage when package is not installed

python src/drain_swamp/cli_igor.py pretag “0.0.1”

Usage if package is installed

python -m drain_swamp.cli_igor pretag “0.0.1”

Parameters:

ver (str) – Possibility malformed semantic ver str

drain_swamp.cli_igor.current_version(*args: Any, **kwargs: Any) Any

Get scm version str

python src/drain_swamp/cli_igor.py current

or

drain-swamp current

Parameters:

path (pathlib.Path) – current working directory

drain_swamp.cli_igor.tag_version(*args: Any, **kwargs: Any) Any

Get semantic version str from version_file. Fall back to current version

python src/drain_swamp/cli_igor.py tag

or

drain-swamp tag

Parameters:

path (pathlib.Path) – current working directory

drain_swamp.cli_igor.do_cheats(*args: Any, **kwargs: Any) Any

Get useful notes to aid in kitting and publishing

python src/drain_swamp/cli_igor.py cheats

or

drain-swamp cheats

Parameters:
  • path (pathlib.Path) – current working directory

  • kind (str) – semantic version str or “current” or “now” or “tag”. Side effect changes src/[app name]/_version.py

drain_swamp.cli_igor.semantic_version_aware_build(*args: Any, **kwargs: Any) Any

Build package

Parameters:
  • path (pathlib.Path) – current working directory

  • kind (str) – semantic version str or “current” or “now” or “tag”. Side effect changes src/[app name]/_version.py

drain_swamp.cli_igor.setuptools_scm_key_value_pair(*args: Any, **kwargs: Any) Any

Given kind, write version str to version_file

Parameters:
  • path (pathlib.Path) – current working directory

  • kind (str) – semantic version str or “current” or “now” or “tag”. Side effect changes src/[app name]/_version.py

Deprecated since version 0.5.1: Version file written by plugin, ds_scm_version, during sdist build. Might remain relevent only to initially create the version file