Constants¶
package level constants
- drain_swamp.constants.__all__: tuple[str, str, str, str, str, str, str, str, str, str] = ("g_app_name", "package_name", "SUFFIX_IN", "SUFFIX_SHARED_IN", "SUFFIX_LOCKED", "SUFFIX_UNLOCKED", "SUFFIX_SYMLINK", "PATH_PIP_COMPILE", "PROG_LOCK", "PROG_UNLOCK")¶
Module exports
- drain_swamp.constants.package_name: str = "drain-swamp"¶
g_app_name –> package_name by replacing underscore with hyphen
- drain_swamp.constants.SUFFIX_SHARED_IN: str = ".shared.in"¶
uncompiled requirements file suffix. Shared between venvs
- drain_swamp.constants.SUFFIX_UNLOCKED: str = ".unlock"¶
Dependency requirements source files, file suffix. Same as used by pip-lock.
requirements
in
files do not set dependency version restrictions unless absolutely unavoidable. In which case, every restriction must be throughly documented to defend the justification for imposing such a restriction so know later whether to keep it or not
- drain_swamp.constants.PATH_PIP_COMPILE: pathlib.Path¶
Absolute path to pip-compile within venv
- drain_swamp.constants.PROG_LOCK: re.Pattern¶
Regex compiled Pattern to find [file name].lock files
- drain_swamp.constants.PROG_UNLOCK: re.Pattern¶
Regex compiled Pattern to find [file name].in files
- drain_swamp.constants.LOGGING: dict[str, Any]¶
logging dict input to logging.dictConfig
pytest aware.
"propagate": True,
is required by pytest. Otherwise cannot see log messagesIf
DEBUG is True
would require package colorlog. So DEBUG is purposefully FALSEThis logging dict formatter requires package, colorlog. colorized debug messages is a feature
The below code was removed
'verbose_with_color': { '()': 'colorlog.ColoredFormatter', 'format': '{log_color}{levelname}{reset} {asctime} {cyan}{name}{reset}: {message}', 'style': '{', },
Caution
This is example of py38- usage. From py39+, this is no longer valid
'root': { 'handlers': ['console'], 'level': 'INFO', },