Improve versioning
Many libraries depend on Bliss: blissoda, ebs-tomo, id24 (needs a better name), ...
Some of those libraries need to support multiple versions of Bliss and they want to use bliss.__version__
for that.
So this version string needs to be managed properly, even the beamline specific branches.
We already improved the versioning since Bliss 1.11 but it is not enough.
Current situation
Install from pypi
Bliss on pypi: 1.11.0, 1.11.1, 1.11.2
When installing those you get what you expect. For example "1.11.2"
Install from gitlab
- Branches: 1.6.x, 1.7.x, 1.8.x, 1.9.x, 1.10.x, 1.11.x, master
- Beamline specific branches: id31_2.0, 1.10.x_id09
When installing those you get something unexpected. For example
- when installing
1.10.x_id09
you get"1.10.1+45.g52c963bdc"
- when installing
1.11.x
you get"1.11.dev3"
- when installing
master
you get"2.0.dev0"
Proposal
Use sematic versioning:
MAJOR.MINOR.PATCH[-PRE[PREVERSION]][+BUILD]
where
- MAJOR, MINOR, PATCH and PREVERSION are integers
- PRE is the string "alpha", "beta" or "rc"
- BUILD is the string "id09", "id31", ...
For example
-
master
branch:2.0-alpha0
-
1.10.x
branch:1.10.1-alpha3
-
1.10.x_id09
branch:1.10.1-alpha3+id09
-
id31_2.0
branch:2.0-alpha0+id31
In practise
- Whenever you change the version (including PRE or BUILD changes) you should create a git tag and push it to gitlab.
- Whenever you rebase a beamline specific branch on a tag, you add +BUILD to the version.
For example 1.10.x_id09
is not rebased on 1.11.x
(branch) it is rebased on 1.11.2-alpha1
(tag) followed by a version change to 1.11.2-alpha1+id09
(see point 1, so create git tag).
# Current beamline specific branch
git checkout 1.10.x_id09
# New beamline specific branch
git checkout -b 1.11.x_id09
# Rebase on tag
git fetch --all --tags
git rebase tags/1.11.2-alpha1
# Append +BUILD to version and tag
sed -i -e 's/1.11.2-alpha1/1.11.2-alpha1+id09/g' setup.cfg
git commit -am "rebase 1.10.x_id09 on 1.11.2-alpha1"
git tag 1.11.2-alpha1+id09
# Push to gitlab (including tag)
git push --tags
You can create a bash script for this
update_beamline 1.11.2-alpha1