See also [Wiki - How to install bazelisk][ref-how-to-bazelisk]
cd git/check_mk
sudo ./buildscripts/infrastructure/build-nodes/scripts/install-development.sh --profile bazel --onlyNext, install uv from the directory of this README via Bazel and generate the requirements.txt file.
The file requirements.txt shall exist on the initial run, but it may be empty.
bazel run //:generate_requirements_txtFinally generate the .venv with uv by using Bazel again
bazel run //:create_venvActivate and use the created .venv with the following standard command
source .venv/bin/activateWhenever you want to create a release, create a changelog snippet via
changelog-generator create .snippets/some_name.md, everything else will done
by the CI.
The changelog is built with the help of changelog-generator based on the snippets stored in .snippets which can be generated by changelog-generator.
If there is no snippet added with a commit and thereby no new version, no release will be published, neither to test.pypi.org nor after the submitted review to pypi.org
The version info file __version__.py in the python source code is generated and updated by changelog2version.
Each change pushed to be reviewed in Gerrit (containing a new snippet) is released on test.pypi.org with an incremented release candidate number based on the patchset number. Additionally Jenkins will create and push a tag for this change.
As soon as the change is submitted Jenkins will build the changelog based on the latest available snippets, create a tag and publish the package at pypi.org. This enables a version-merge-conflict free workflow. If a bugfix was started before e.g. the breaking change 0.7.12 -> 1.0.0 but merged after the breaking change the new version will automatically become 1.0.1.
As mentioned at the beginning, if there is no new snippet added to a change, no new tag and no new release will be published after a submit of that change.
Create a new changelog snippet. If no new snippet is found on a merged change no new release will be built and published.
If the change is based on a Jira ticket, use the Jira ticket name as snippet name otherwise use a unique name.
uv run changelog-generator create .snippets/CMK-24265.mdAfter committing the snippet a changelog can be generated locally for testing purposes. For CI usage the --in-place flag is recommended to use as it will update the existing changelog with the collected snippets. For local usage remember to reset the changelog file before a second run, as the version would be updated recursively due to the way the changelog generator is working. It extracts the latest version from the changelog file and puts the found snippets on top.
Future changes to the changelog are ignored by
git update-index --assume-unchanged changelog.mduv run \
changelog-generator \
changelog changelog.md \
--snippets=.snippets \
--in-place \
--version-reference="https://review.lan.tribe29.com/gitweb?p=cmk-dev-site.git;a=tag;h=refs/tags/"hatch requires a variable named __version__ containing the version as string but changelog2version is joining the __version_info__ data at least until the used version 0.12.1 which requires the usage of a custom version template.
Update the version of the project in all required files by calling
uv run \
changelog2version \
--changelog_file changelog.md \
--version_file cmk_dev_site/version.py \
--template_file cmk_dev_site/custom_version_template.py.template \
--additional_version_info="-rc42+$(git rev-parse HEAD)" \
--print \
| jq -r .info.version-
modify and check commits via
pre-commit run --all-files -
after work is done locally:
- update dependencies before/with a new release
uv lock --check- run unittests locally
uv run pytest- build and check package locally
uv build && \
uv run twine check dist/* &&
python3 -m pip uninstall -y cmk-dev-site && \
python3 -m pip install --user dist/cmk_dev_site-$(grep -E "^__version__.?=" cmk_dev_site/version.py | cut -d '"' -f 2 | sed 's/-//g')-py3-none-any.whl- commit, push and review the changes
git add ...
git commit -m "bump version, update dependencies"
git push origin HEAD:refs/for/main- test deployed packages by the Gerrit CV Jenkins job from
test.pypi.org. The extra index URL is required to get those dependencies frompypi.orgwhich are not available fromtest.pypi.org
pip install --no-cache-dir \
-i https://test.pypi.org/simple/ \
--extra-index-url https://pypi.org/simple \
cmk-dev-site==<VERSION_WITH_RC>- finally merge the changes and let Jenkins create the release tag and deployment to pypi.org