Cl
Changelog CLI.
Attributes⚓︎
SuffixT
module-attribute
⚓︎
SuffixT = Optional[Literal['alpha', 'beta', 'rc']]
Prerelease Suffix Type.
Functions⚓︎
bump ⚓︎
bump(ctx, *, suffix=None)
Bumps project version based on commits & settings in pyproject.toml.
Source code in calcipy/tasks/cl.py
@task(
pre=[write],
help={
'suffix': 'Specify prerelease suffix for version bump (alpha, beta, rc)',
},
)
def bump(ctx: Context, *, suffix: SuffixT = None) -> None:
"""Bumps project version based on commits & settings in pyproject.toml."""
bumpz(ctx, suffix=suffix)
bumpz ⚓︎
bumpz(ctx, *, suffix=None)
Bumps project version based on commits & settings in pyproject.toml.
Source code in calcipy/tasks/cl.py
def bumpz(ctx: Context, *, suffix: SuffixT = None) -> None:
"""Bumps project version based on commits & settings in pyproject.toml."""
opt_cz_args = f' --prerelease={suffix}' if suffix else ''
run(ctx, f'{python_m()} commitizen bump{opt_cz_args} --annotated-tag --no-verify --gpg-sign')
write ⚓︎
write(ctx)
Write a Changelog file with the raw Git history.
Resources:
- https://keepachangelog.com/en/1.0.0/
- https://www.conventionalcommits.org/en/v1.0.0/
- https://writingfordevelopers.substack.com/p/how-to-write-a-commit-message
- https://chris.beams.io/posts/git-commit/
- https://semver.org/
- https://calver.org/
| RAISES | DESCRIPTION |
|---|---|
FileNotFoundError
|
On missing changelog |
Source code in calcipy/tasks/cl.py
@task()
def write(ctx: Context) -> None:
"""Write a Changelog file with the raw Git history.
Resources:
- https://keepachangelog.com/en/1.0.0/
- https://www.conventionalcommits.org/en/v1.0.0/
- https://writingfordevelopers.substack.com/p/how-to-write-a-commit-message
- https://chris.beams.io/posts/git-commit/
- https://semver.org/
- https://calver.org/
Raises:
FileNotFoundError: On missing changelog
"""
run(ctx, f'{python_m()} commitizen changelog') # with commitizen
path_cl = get_project_path() / 'CHANGELOG.md'
if not path_cl.is_file():
msg = f'Could not locate the changelog at: {path_cl}'
raise FileNotFoundError(msg)
path_cl.replace(get_doc_subdir() / path_cl.name)