Maintenance Guide¶
This page describes how to perform various maintenance tasks for ccu.
Project and Environment Management¶
ccu uses hatch for project and environment management. hatch uses the
hatchling build system and is configured in the pyproject.toml file.
There are dedicated hatch environments for documentation (docs),
code-quality (quality), testing (test), and general development (default)
each with their own custom environment scripts. For example, the following
command activates the docs environment:
hatch shell docs
GitLab CI/CD¶
The following jobs are run on all pushed changes and merge requests:
- quality
pre-commithooks:ruff,mypy, formatting & security checks- unit-testing
pytest: unit, functional, and regression tests- doctests
test all
doctestexamples in documentation- build-docs
sphinx-build: build documentation- linkcheck
check documentation links with the
linkcheckbuilder
The following jobs are only triggered for commits on main:
- publish
upload the package to pypi
Release Process¶
This section walks through the release process.
Determine the version number for the new release.
The version number,
Nis composed of major, minor, and patch components (e.g., in the version number1.2.3, 1, 2, and 3 are the major, minor, and patch components) with optional pre-release labelsWhile under development,
ccufollows a zero-versioning scheme. When stable,ccureleases shall be versioned according to Realistic Semantic Versioning.Pre-releases shall be labeled with “a” and an index, starting from 1 (e.g., 0.0.1a1).
Create a new branch called
release-N.For bug fixes, the branch shall be formed from
mainand eventually separately merged into bothmainanddevelopment.For releases, the branch shall be formed from
developmentand eventually separately merged into bothmainanddevelopment.
Finalize changes. This involves merging any final commits and updating the changelog.
Bump the version using
bump-my-version.bump-my-version bump --commit VERSION_PART
where
VERSION_PARTis one of “major”, “minor”, “patch”, or “pre_n”.Build the package locally and test upload to test-pypi (optional).
hatch build hatch publish -u __token__ -a TOKEN -r test
TOKENis a valid test-pypi token.
Create and merge a release MR targeting the
mainbranch.Create a tag on the
mainbranch corresponding to the new version. This will trigger thepublishjob.