Reputation: 137
We develop a Python package and use gitlab as repository. So far, we increased the version of package (in the __init__.py
) manually with every commit on the master branch, i.e. after each successful merged Merge Request or a small bug fix. But often we missed to increase the version string.
However, now we are trying to setup a Gitlab CI/CD pipeline to do the job for us, i.e. to increase the version number in the __init__.py
and automatically build and deploy the package to a repository by the pipelines.
However, simply increasing the string during the build is not sufficient since the new string is not committed back to the repo. Can someone give some hints?
Upvotes: 3
Views: 4785
Reputation: 137
We solved this issue by using https://github.com/warner/python-versioneer, which generates a version string based on the distance to the last git tag.
Upvotes: 3