Update Versioning authored by Klaas Kliffen's avatar Klaas Kliffen
......@@ -15,8 +15,36 @@ Additional labels for pre-release and build metadata are available as extensions
## Concrete examples at ASTRON
- TODO
### 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 `1.2.3` to set a version. For development build, 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!
Check out the following package for a concrete example in use:
[ASTRONauth](https://git.astron.nl/astron-sdc/astronauth)
```toml
# pyproject.toml
[build-system]
requires = ["setuptools>=45", "setuptools_scm[toml]>=6.2", "wheel"]
build-backend = "setuptools.build_meta"
[project]
# ... omitted rest of metatdata
dynamic = ["version"]
[tool.setuptools_scm]
write_to = "astronauth/_version.py"
# Ignore the version file:
[tool.pylint]
ignore = "_version.py"
# also add it to your .gitignore!
```
## License
The [Semantic Versioning specification](https://semver.org/) was originally authored by Tom Preston-Werner and is licensed under [Creative Commons -- CC BY 3.0](https://creativecommons.org/licenses/by/3.0/)
\ No newline at end of file