Skip to content

add python-semantic-release to dev dependencies

Maciej Pawel Szymanski requested to merge maszyman-version-release into master

Supersedes !31 (closed)

As discussed, we choose to adopt a more traditional release workflow than what was proposed in !31 (closed). Nevertheless, we may still want to keep python-semantic-release tool to facilitate a bit the release process. In fact, when we are to make a release, we could do in our development area:

poetry run semantic-release version --{major, minor, patch} --noop

This will tell us what the version bump will be, e.g.:

> poetry run semantic-release version --major --noop
Creating new version
Current version: 0.1.0
warning: No operation mode. Should have bumped from 0.1.0 to 1.0.0

or find the conflict between versions specified in pyproject.toml and __init__.py:__version__:

> poetry run semantic-release version --major --noop
Creating new version
error: found conflicting versions: '0.1.1', '0.1.0'

Once we are happy, we can drop the --noop parameter:

poetry run semantic-release version --{major, minor, patch}

which will update versions in both pyproject.toml and __init__.py:__version__ and create a tag. The commit will be done by "GitLab CI <noreply@CERN.CH>", but we still need to push ourselves to remote in GitLab. Then, of course click on New release in GitLab interface, select our tag, and write the release notes.

Having this MR in, we probably can close !30 (closed) as well, to have explicit __init__.py:__version__ (kept in sync with pyproject.toml if we follow the procedure described above) instead of importlib trick.

Edited by Maciej Pawel Szymanski

Merge request reports