-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
274 lines (256 loc) · 8.59 KB
/
Copy pathpyproject.toml
File metadata and controls
274 lines (256 loc) · 8.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
[project]
name = "gp-sphinx-workspace"
version = "0.0.1a34"
description = "Workspace root for gp-sphinx packages"
requires-python = ">=3.10,<4.0"
authors = [
{name = "Tony Narlock", email = "tony@git-pull.com"}
]
license = { text = "MIT" }
readme = "README.md"
dependencies = [
"gp-sphinx==0.0.1a34",
]
[tool.uv.workspace]
members = ["packages/*"]
exclude = ["packages/gp-furo-tokens"]
[tool.uv.sources]
sphinx-fonts = { workspace = true }
sphinx-gp-theme = { workspace = true }
sphinx-autodoc-argparse = { workspace = true }
sphinx-autodoc-pytest-fixtures = { workspace = true }
sphinx-autodoc-docutils = { workspace = true }
sphinx-autodoc-sphinx = { workspace = true }
sphinx-autodoc-api-style = { workspace = true }
sphinx-autodoc-fastmcp = { workspace = true }
sphinx-autodoc-typehints-gp = { workspace = true }
sphinx-ux-badges = { workspace = true }
sphinx-ux-autodoc-layout = { workspace = true }
sphinx-gp-opengraph = { workspace = true }
sphinx-gp-sitemap = { workspace = true }
sphinx-gp-llms = { workspace = true }
sphinx-gp-mermaid = { workspace = true }
sphinx-gp-highlighting = { workspace = true }
gp-furo-theme = { workspace = true }
gp-sphinx = { workspace = true }
sphinx-vite-builder = { workspace = true }
[tool.uv.exclude-newer-package]
# Adopt gp-libs releases immediately, bypassing the global cooldown.
gp-libs = false
[dependency-groups]
dev = [
"gp-sphinx",
"sphinx-autodoc-argparse",
"sphinx-autodoc-pytest-fixtures",
"sphinx-autodoc-docutils",
"sphinx-autodoc-sphinx",
"sphinx-autodoc-api-style",
"sphinx-autodoc-fastmcp",
"sphinx-ux-badges",
"sphinx-ux-autodoc-layout",
"sphinx-gp-opengraph",
"sphinx-gp-sitemap",
"sphinx-gp-llms",
"sphinx-gp-mermaid",
"sphinx-gp-highlighting",
"gp-furo-theme",
"sphinx-vite-builder",
# Docs
"sphinx-autobuild",
# Testing
"pytest",
"pytest-asyncio",
"pytest-rerunfailures",
"pytest-mock",
"pytest-watcher",
"pytest-playwright",
"pillow",
# Coverage
"codecov",
"coverage",
"pytest-cov",
# Lint
"ruff",
"mypy",
"tomli; python_version < '3.11'",
"typing-extensions",
"types-docutils",
"types-Pygments",
"syrupy>=5.1.0",
# Build-backend tooling: sphinx-vite-builder.build delegates to
# hatchling.build, so hatchling must be importable for static analysis
# and for the backend's own tests; consumer packages declare it
# themselves via [build-system].requires, so this is a workspace-only
# dev dep, not a runtime one.
"hatchling>=1.0",
]
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[tool.hatch.build.targets.wheel]
packages = ["src/gp_sphinx_workspace"]
[tool.hatch.build.targets.sdist]
exclude = [
"packages/gp-furo-theme/src/gp_furo_theme/theme/gp-furo/static/",
]
[tool.mypy]
strict = true
python_version = "3.10"
mypy_path = "scripts/ci:docs/_ext:stubs"
files = [
"packages/",
"tests/",
"scripts/",
"docs/_ext/",
]
[[tool.mypy.overrides]]
# sphinx_fonts sets private attributes on Sphinx's app object (app._font_preload_hrefs,
# _font_faces, etc.) which aren't declared in sphinx's type stubs.
# The test file also accesses these dynamically-added attrs, so it needs the same suppression.
module = ["sphinx_fonts", "tests.ext.test_sphinx_fonts"]
disable_error_code = ["attr-defined", "unused-ignore"]
[[tool.mypy.overrides]]
# sphinx_autodoc_pytest_fixtures: not yet typed strictly; ignore_errors is temporary
# until targeted disable_error_code can replace it.
module = ["sphinx_autodoc_pytest_fixtures", "sphinx_autodoc_pytest_fixtures.*", "tests.ext.pytest_fixtures.*"]
ignore_errors = true
[[tool.mypy.overrides]]
# fastmcp is an optional runtime dependency; users without it installed still get
# full static analysis of everything else in sphinx-autodoc-fastmcp.
module = ["fastmcp", "fastmcp.*"]
ignore_missing_imports = true
[tool.ruff]
target-version = "py310"
extend-exclude = [
"build_extensions.py",
"copy_packages.py",
"rewrite_docutils.py",
"rewrite_sphinx.py",
]
[tool.ruff.lint]
select = [
"E", # pycodestyle
"F", # pyflakes
"I", # isort
"UP", # pyupgrade
"A", # flake8-builtins
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"COM", # flake8-commas
"EM", # flake8-errmsg
"Q", # flake8-quotes
"PTH", # flake8-use-pathlib
"SIM", # flake8-simplify
"TRY", # Trycertatops
"PERF", # Perflint
"RUF", # Ruff-specific rules
"D", # pydocstyle
"FA100", # future annotations
]
ignore = [
"COM812", # missing trailing comma, ruff format conflict
]
extend-safe-fixes = [
"UP006",
"UP007",
]
pyupgrade.keep-runtime-typing = false
[tool.ruff.lint.isort]
known-first-party = [
"gp_sphinx",
"sphinx_fonts",
"sphinx_gp_theme",
"sphinx_autodoc_argparse",
"sphinx_autodoc_pytest_fixtures",
"sphinx_autodoc_docutils",
"sphinx_autodoc_sphinx",
"sphinx_autodoc_api_style",
"sphinx_autodoc_fastmcp",
"sphinx_autodoc_typehints_gp",
"sphinx_ux_badges",
"sphinx_ux_autodoc_layout",
"sphinx_gp_opengraph",
"sphinx_gp_sitemap",
"sphinx_gp_llms",
"sphinx_gp_mermaid",
"sphinx_gp_highlighting",
]
combine-as-imports = true
required-imports = [
"from __future__ import annotations",
]
[tool.ruff.lint.pydocstyle]
convention = "numpy"
[tool.ruff.lint.per-file-ignores]
"*/__init__.py" = ["F401"]
"docs/_ext/package_reference.py" = ["B009", "D102", "D301", "E501", "PERF401"]
"packages/sphinx-autodoc-argparse/**/*.py" = ["E501", "UP", "A", "B", "COM", "EM", "TRY", "PERF", "RUF", "SIM", "FA100"]
"packages/sphinx-autodoc-pytest-fixtures/**/*.py" = ["D417", "E501", "UP", "A", "B", "COM", "EM", "TRY", "PERF", "RUF", "SIM", "FA100"]
"packages/sphinx-autodoc-docutils/**/*.py" = ["D417", "E501", "UP", "A", "B", "COM", "EM", "TRY", "PERF", "RUF", "SIM", "FA100"]
"packages/sphinx-autodoc-api-style/**/*.py" = ["D417", "E501", "UP", "A", "B", "COM", "EM", "TRY", "PERF", "RUF", "SIM", "FA100"]
"packages/sphinx-autodoc-fastmcp/**/*.py" = ["D417", "E501", "UP", "A", "B", "COM", "EM", "TRY", "PERF", "RUF", "SIM", "FA100"]
"tests/ext/*.py" = ["D", "E501", "UP", "A", "B", "COM", "EM", "TRY", "PERF", "RUF", "SIM", "FA100"]
"tests/ext/autodoc_argparse/*.py" = ["D", "E501", "UP", "A", "B", "COM", "EM", "TRY", "PERF", "RUF", "SIM", "FA100"]
"tests/ext/autodoc_docutils/*.py" = ["D", "E501", "UP", "A", "B", "COM", "EM", "TRY", "PERF", "RUF", "SIM", "FA100"]
"tests/ext/autodoc_sphinx/*.py" = ["D", "E501", "UP", "A", "B", "COM", "EM", "TRY", "PERF", "RUF", "SIM", "FA100"]
"tests/ext/pytest_fixtures/*.py" = ["D", "E501", "UP", "A", "B", "COM", "EM", "TRY", "PERF", "RUF", "SIM", "FA100"]
"tests/ext/api_style/*.py" = ["D", "E501", "UP", "A", "B", "COM", "EM", "TRY", "PERF", "RUF", "SIM", "FA100"]
"tests/ext/fastmcp/*.py" = ["D", "E501", "UP", "A", "B", "COM", "EM", "TRY", "PERF", "RUF", "SIM", "FA100"]
"tests/ext/docutils/*.py" = ["D", "E501", "UP", "A", "B", "COM", "EM", "TRY", "PERF", "RUF", "SIM", "FA100"]
[tool.pytest.ini_options]
addopts = "-s --tb=short --no-header --showlocals --doctest-modules"
doctest_optionflags = "ELLIPSIS NORMALIZE_WHITESPACE"
# pytest's default norecursedirs covers "build" but not Sphinx's
# "_build"; generated markdown under docs/_build otherwise collects as
# doctest files and breaks collection whenever a build output exists
# (tests that build the live docs/ tree can create it mid-session).
norecursedirs = [
".*",
"*.egg",
"_build",
"build",
"dist",
"node_modules",
]
markers = [
"integration: sphinx integration tests (require full sphinx build)",
]
testpaths = [
"tests",
"docs",
"packages/gp-sphinx/src",
"packages/sphinx-autodoc-api-style/src",
"packages/sphinx-autodoc-argparse/src",
"packages/sphinx-autodoc-docutils/src",
"packages/sphinx-autodoc-fastmcp/src",
"packages/sphinx-autodoc-pytest-fixtures/src",
"packages/sphinx-fonts/src",
"packages/sphinx-gp-theme/src",
"packages/sphinx-autodoc-sphinx/src",
"packages/sphinx-autodoc-typehints-gp/src",
"packages/sphinx-ux-autodoc-layout/src",
"packages/sphinx-ux-badges/src",
"packages/sphinx-gp-opengraph/src",
"packages/sphinx-gp-sitemap/src",
"packages/sphinx-gp-highlighting/src",
"packages/sphinx-gp-llms/src",
"packages/sphinx-gp-mermaid/src",
"packages/sphinx-vite-builder/src",
]
filterwarnings = [
"ignore:distutils Version classes are deprecated. Use packaging.version instead.",
"ignore:The frontend.Option(Parser)? class.*:DeprecationWarning::",
"ignore:nodes.Node.traverse\\(\\) is obsoleted by Node.findall\\(\\).::sphinx_inline_tabs._impl",
]
[tool.coverage.report]
exclude_also = [
"def __repr__",
"raise AssertionError",
"raise NotImplementedError",
"if __name__ == .__main__.:",
"if TYPE_CHECKING:",
"if t.TYPE_CHECKING:",
"class .*\\bProtocol\\):",
"@(abc\\.)?abstractmethod",
"from __future__ import annotations",
]