Skip to content

Commit 8450082

Browse files
committed
Configure workspace
1 parent 377a510 commit 8450082

3 files changed

Lines changed: 41 additions & 31 deletions

File tree

packages/griffecli/pyproject.toml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,12 @@ classifiers = [
4141
"Typing :: Typed",
4242
]
4343

44-
[tool.hatch.metadata.hooks.uv-dynamic-versioning]
44+
[project.scripts]
45+
griffe = "griffecli:main"
4546

46-
[tool.hatch.metadata.hooks.uv-dynamic-versioning.optional-dependencies]
47-
48-
[tool.hatch.build.targets.sdist]
47+
[tool.hatch.build.targets.wheel]
48+
# Manual pages can be included in the wheel.
49+
# Depending on the installation tool, they will be accessible to users.
50+
# pipx supports it, uv does not yet, see https://github.com/astral-sh/uv/issues/4731.
51+
sources = ["src/"]
52+
artifacts = ["share/**/*"]

packages/griffelib/pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,5 +44,6 @@ classifiers = [
4444
[tool.hatch.metadata.hooks.uv-dynamic-versioning]
4545

4646
[tool.hatch.metadata.hooks.uv-dynamic-versioning.optional-dependencies]
47+
pypi = ["pip>=24.0", "platformdirs>=4.2", "wheel>=0.42"]
4748

4849
[tool.hatch.build.targets.sdist]

pyproject.toml

Lines changed: 32 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,30 @@
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

7+
[tool.hatch.version]
8+
source = "code"
9+
path = "scripts/get_version.py"
10+
expression = "get_version()"
11+
712
[project]
813
name = "griffe"
914
description = "Signatures for entire Python programs. Extract the structure, the frame, the skeleton of your project, to generate API documentation or find breaking changes in your API."
10-
authors = [{name = "Timothée Mazzucotelli", email = "dev@pawamoy.fr"}]
15+
authors = [{ name = "Timothée Mazzucotelli", email = "dev@pawamoy.fr" }]
1116
license = "ISC"
1217
license-files = ["LICENSE"]
1318
readme = "README.md"
1419
requires-python = ">=3.10"
15-
keywords = ["api", "signature", "breaking-changes", "static-analysis", "dynamic-analysis"]
16-
dynamic = ["version"]
20+
keywords = [
21+
"api",
22+
"signature",
23+
"breaking-changes",
24+
"static-analysis",
25+
"dynamic-analysis",
26+
]
27+
dynamic = ["version", "dependencies", "optional-dependencies"]
1728
classifiers = [
1829
"Development Status :: 5 - Production/Stable",
1930
"Intended Audience :: Developers",
@@ -36,16 +47,12 @@ classifiers = [
3647
"Topic :: Utilities",
3748
"Typing :: Typed",
3849
]
39-
dependencies = [
40-
"colorama>=0.4",
41-
]
4250

43-
[project.optional-dependencies]
44-
pypi = [
45-
"pip>=24.0",
46-
"platformdirs>=4.2",
47-
"wheel>=0.42",
48-
]
51+
[tool.hatch.metadata.hooks.uv-dynamic-versioning]
52+
dependencies = ["griffecli=={{version}}", "griffelib=={{version}}"]
53+
54+
[tool.hatch.metadata.hooks.uv-dynamic-versioning.optional-dependencies]
55+
pypi = ["griffelib[pypi]=={{version}}"]
4956

5057
[project.urls]
5158
Homepage = "https://mkdocstrings.github.io/griffe"
@@ -58,23 +65,19 @@ Gitter = "https://gitter.im/mkdocstrings/griffe"
5865
Funding = "https://github.com/sponsors/pawamoy"
5966

6067
[project.scripts]
61-
griffelib = "griffe:main"
62-
63-
[tool.hatch.version]
64-
source = "code"
65-
path = "scripts/get_version.py"
66-
expression = "get_version()"
68+
griffe = "griffecli:main"
6769

6870
[tool.hatch.build]
6971
# Include as much as possible in the source distribution, to help redistributors.
7072
ignore-vcs = true
71-
exclude = [".github", ".pdm-build"]
73+
exclude = [".github"]
7274

7375
[tool.hatch.build.targets.sdist]
7476
include = [
7577
"config",
7678
"docs",
7779
"scripts",
80+
"packages",
7881
"src",
7982
"share",
8083
"tests",
@@ -92,12 +95,7 @@ sources = ["src/"]
9295
artifacts = ["share/**/*"]
9396

9497
[dependency-groups]
95-
maintain = [
96-
"build>=1.2",
97-
"git-changelog>=2.5",
98-
"twine>=5.1",
99-
"yore>=0.3.3",
100-
]
98+
maintain = ["build>=1.2", "git-changelog>=2.5", "twine>=5.1", "yore>=0.3.3"]
10199
ci = [
102100
"duty>=1.6",
103101
"griffe-inherited-docstrings>=1.1.2",
@@ -114,7 +112,7 @@ ci = [
114112
"types-markdown>=3.6",
115113
"types-pyyaml>=6.0",
116114
]
117-
docs = [
115+
docs = [
118116
"code2flow>=2.5",
119117
"griffe-inherited-docstrings>=1.1.2",
120118
"markdown-callouts>=0.4",
@@ -136,3 +134,10 @@ ci = [
136134

137135
[tool.uv]
138136
default-groups = ["maintain", "ci", "docs"]
137+
138+
[tool.uv.workspace]
139+
members = ["packages/*"]
140+
141+
[tool.uv.sources]
142+
griffelib = { workspace = true }
143+
griffecli = { workspace = true }

0 commit comments

Comments
 (0)