An opinionated git versioning tool. It versions as following:
-
On
v*tag: version as tag if notstickyi.e.
0.1.0 -
On
mainormasterbranch: version as rci.e.
0.1.0-rc{BUILD_NUMBER}+{GIT_COMMIT_SHORT_SHA} -
Others: version as dev
i.e.
0.1.0-dev{BUILD_NUMBER}+{GIT_COMMIT_SHORT_SHA}
If env VERSIONING_GIT_BRANCH is set, it will be used instead of git branch --show-current.
It currently support setuptools, hatch and poetry.
setuptools.setup(
version="0.1.0",
setup_requires=["gitv"]
)[build-system]
requires = ["hatchling", "gitv"]
[project]
dynamic = ["version"]
[tool.hatch.version]
version = "0.1.0"
source = "vcs"[build-system]
requires = ["poetry-core", "gitv"]
[tool.poetry]
version = "0.1.0"