@@ -15,10 +15,22 @@ Additional labels for pre-release and build metadata are available as extensions
## Concrete examples at ASTRON
It is best practice to define a version via source control tags. In git this can be achieved with the following commands:
```bash
# make sure you are on the correct branch/commit you'd like to create a version of
git tag v1.0.2 # or any version you'd like
# additionally you can also add a message, similar to commit messages (note both `-a` and `-m` are necessary
git tag -a v1.0.2 -m"Patch release v1.0.2"
```
### Python Package
In python we use [setuptool_scm](https://github.com/pypa/setuptools_scm/).
It requires a git repository to function (can be empty!).
Use a git tag (e.g. `1.2.3`; following semver) to set a version. For development builds, it will add a unique identifier based on both the commit hash and the "distance" to the latest tag.
Use a git tag (e.g. `v1.2.3`; following semver) to set a version. For development builds, it will add a unique identifier based on both the commit hash and the "distance" to the latest tag.
**IMPORTANT**, for correct version handling, make sure to tag your versions regularly. Our gitlab runners only check-out the last 50 commits (excluding merge commits). So if the distance is more than 50, your development versions will be inconsistent!