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 " ]
55build-backend = " hatchling.build"
66
77[project ]
@@ -13,7 +13,7 @@ license-files = ["LICENSE"]
1313readme = " README.md"
1414requires-python = " >=3.10"
1515keywords = [" api" , " signature" , " breaking-changes" , " static-analysis" , " dynamic-analysis" ]
16- dynamic = [" version" ]
16+ dynamic = [" version" , " dependencies " , " optional-dependencies " ]
1717classifiers = [
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 ]
5241Homepage = " https://mkdocstrings.github.io/griffe"
@@ -66,6 +55,16 @@ source = "code"
6655path = " scripts/get_version.py"
6756expression = " 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.
7170ignore-vcs = true
0 commit comments