Skip to content

Commit 95c310e

Browse files
Copilotjohnslavik
andcommitted
Add version locking for griffe's dependencies on griffelib and griffecli
Co-authored-by: johnslavik <64036239+johnslavik@users.noreply.github.com>
1 parent bb98dca commit 95c310e

1 file changed

Lines changed: 12 additions & 13 deletions

File tree

pyproject.toml

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[build-system]
22
# pdm-backend is left here as a dependency of the version discovery script currently in use.
33
# It may be removed in the future. See mkdocstrings/griffe#430
4-
requires = ["hatchling", "pdm-backend"]
4+
requires = ["hatchling", "pdm-backend", "uv-dynamic-versioning>=0.7.0"]
55
build-backend = "hatchling.build"
66

77
[project]
@@ -13,7 +13,7 @@ license-files = ["LICENSE"]
1313
readme = "README.md"
1414
requires-python = ">=3.10"
1515
keywords = ["api", "signature", "breaking-changes", "static-analysis", "dynamic-analysis"]
16-
dynamic = ["version"]
16+
dynamic = ["version", "dependencies", "optional-dependencies"]
1717
classifiers = [
1818
"Development Status :: 5 - Production/Stable",
1919
"Intended Audience :: Developers",
@@ -36,17 +36,6 @@ classifiers = [
3636
"Topic :: Utilities",
3737
"Typing :: Typed",
3838
]
39-
dependencies = [
40-
"griffelib",
41-
"griffecli",
42-
]
43-
44-
[project.optional-dependencies]
45-
pypi = [
46-
"pip>=24.0",
47-
"platformdirs>=4.2",
48-
"wheel>=0.42",
49-
]
5039

5140
[project.urls]
5241
Homepage = "https://mkdocstrings.github.io/griffe"
@@ -66,6 +55,16 @@ source = "code"
6655
path = "scripts/get_version.py"
6756
expression = "get_version()"
6857

58+
[tool.hatch.metadata.hooks.uv-dynamic-versioning]
59+
# Dependencies are dynamically versioned; {version} is substituted at build time.
60+
# This ensures griffe, griffelib, and griffecli versions are always 1:1.
61+
dependencies = ["griffelib=={version}", "griffecli=={version}"]
62+
63+
[tool.hatch.metadata.hooks.uv-dynamic-versioning.optional-dependencies]
64+
# The 'pypi' extra provides dependencies needed for the load_pypi functionality
65+
# to download and inspect packages from PyPI.
66+
pypi = ["pip>=24.0", "platformdirs>=4.2", "wheel>=0.42"]
67+
6968
[tool.hatch.build]
7069
# Include as much as possible in the source distribution, to help redistributors.
7170
ignore-vcs = true

0 commit comments

Comments
 (0)