Derive the version from git with verri

Use verri's strawberry flavour through hatchling's code version source, so
versions look like 2026.10.21.0: the HEAD commit date plus the number of
earlier commits that day.

Container images build the sdist in a separate stage that has the git
repository, so they get the same version instead of a +vcs.missing one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Bart BroereandClaude Opus 5.5 committed 2026-10-21 12:44:26 +02:00
1 parent e7ef15fc79
commit ee980b27fe
5 files changed
+32 -10

No files matched your search

+7 -3
View File
@@ -2,7 +2,7 @@
# SPDX-License-Identifier: GPL-3.0-or-later
[build-system]
requires = ["hatchling>=1.27", "hatch-fancy-pypi-readme>=24.1"]
requires = ["hatchling>=1.27", "hatch-fancy-pypi-readme>=24.1", "verri>=2026.10.11"]
build-backend = "hatchling.build"
[project]
@@ -31,11 +31,15 @@ Source = "https://git.bartbroe.re/bartbroere/peo"
[project.scripts]
peo = "peo.__main__:run"
# The version is derived from the date of the HEAD commit, plus the number of
# commits made earlier that day, like 2026.10.21.0. See version.py.
[tool.hatch.version]
path = "peo/__init__.py"
source = "code"
path = "version.py"
expression = "strawberry()"
[tool.hatch.build.targets.sdist]
include = ["/peo", "/README.md", "/LICENSE"]
include = ["/peo", "/README.md", "/LICENSE", "/version.py"]
[tool.hatch.build.targets.wheel]
packages = ["peo"]