-
Notifications
You must be signed in to change notification settings - Fork 86
Expand file tree
/
Copy pathpyproject.toml
More file actions
223 lines (202 loc) · 5.94 KB
/
pyproject.toml
File metadata and controls
223 lines (202 loc) · 5.94 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
[build-system]
requires = ["flit_core >=3.4,<4"]
build-backend = "flit_core.buildapi"
[project]
name = "sphinx-needs"
dynamic = ["version", "description"]
authors = [{ name = "team useblocks", email = "info@useblocks.com" }]
license.file = "LICENSE"
readme = "README.rst"
urls.Repository = "http://github.com/useblocks/sphinx-needs"
urls.Documentation = "https://sphinx-needs.readthedocs.io/en/latest/"
classifiers = [
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
'Programming Language :: Python :: 3.13',
'Programming Language :: Python :: 3.14',
'Topic :: Documentation',
'Topic :: Utilities',
'Framework :: Sphinx :: Extension',
]
requires-python = ">=3.10,<4"
dependencies = [
"sphinx>=7.4,<10",
"requests-file~=2.1", # external links
"requests~=2.32", # external links
"jsonschema-rs~=0.37.1", # schema validation
"sphinx-data-viewer~=0.1.5", # needservice debug output
"sphinxcontrib-jquery~=4.0", # needed for datatables in sphinx>=6
"tomli; python_version < '3.11'", # for needs_from_toml configuration
"typing-extensions>=4.14.0", # for dict NotRequired type indication
"minijinja~=2.15", # lightweight jinja2-compatible template engine
]
[project.optional-dependencies]
plotting = ["matplotlib>=3.3.0"] # for needpie / needbar
test = [
"defusedxml~=0.7.1",
"matplotlib>=3.3.0",
"pytest~=8.0",
"pytest-cov~=6.0",
"syrupy~=4.0",
"sphinxcontrib-plantuml~=0.0",
"lxml~=6.0",
"responses~=0.22.0",
"pydantic~=2.12",
"pytest-xprocess~=1.0",
"pyyaml ~= 6.0",
]
test-parallel = ["pytest-xdist"]
benchmark = [
"pytest-benchmark~=5.0; sys_platform != 'win32'",
"memray>=1.3.1,<2.0.0; sys_platform != 'win32'",
]
docs = [
"matplotlib>=3.3.0",
"sphinxcontrib-plantuml~=0.0",
"sphinx-copybutton~=0.5",
"sphinxcontrib-programoutput~=0.17",
"sphinx-design~=0.6",
"sphinx-ai-index~=0.1.0",
]
theme-im = ["sphinx-immaterial~=0.11.11"]
theme-furo = ["furo~=2024.8.6"]
theme-pds = ["pydata-sphinx-theme~=0.15.2"]
theme-rtd = ["sphinx_rtd_theme>=3.0.2,<4"]
[dependency-groups]
dev = ["pre-commit~=3.0", "tox~=4.23", "tox-uv~=1.15"]
mypy = [
"mypy==1.19.1",
"sphinx==7.4.7",
"docutils==0.20",
"jsonschema-rs==0.37.1",
"types-docutils==0.20.0.20240201",
"types-requests",
]
ruff = ["ruff==0.14.11"]
[tool.pytest.ini_options]
markers = [
"fixture_file: marks tests that use a fixture file (deselect with '-m \"not fixture_file\"')",
"jstest: marks tests as JavaScript test (deselect with '-m \"not jstest\"')",
"benchmark: marks tests as expensive benchmark test (deselect with '-m \"not benchmark\"')",
]
filterwarnings = [
"ignore:.*removed in Python 3.14.*:DeprecationWarning",
"ignore::PendingDeprecationWarning:sphinx_data_viewer.*",
]
[tool.ruff.lint]
extend-select = [
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"I", # isort
"ICN", # flake8-import-conventions
"ISC", # flake8-implicit-str-concat
"N", # pep8-naming
"RUF", # Ruff-specific rules
"SIM", # flake8-simplify
"UP", # pyupgrade
]
extend-ignore = ["B904", "ISC001", "ICN001", "N818", "RUF012"]
[tool.mypy]
files = "sphinx_needs"
strict = true
show_error_codes = true
implicit_reexport = false
namespace_packages = true
disallow_any_generics = true
disallow_subclassing_any = true
# disallow_any_unimported = true
# disallow_any_explicit = true
# disallow_any_expr = true
# disallow_any_decorated = true
[[tool.mypy.overrides]]
module = [
"matplotlib.*",
"numpy.*",
"requests_file",
"sphinx_data_viewer.*",
"sphinxcontrib.plantuml.*",
"tomllib.*",
"tomli.*",
]
ignore_missing_imports = true
[[tool.mypy.overrides]]
module = [
"sphinx_needs.directives.needextend",
"sphinx_needs.functions.functions",
"sphinx_needs.api.need",
]
# TODO dynamically overriding TypeDict keys is a bit tricky
disable_error_code = "literal-required"
[[tool.mypy.overrides]]
module = ["sphinx_needs.data"]
disable_error_code = ["attr-defined", "no-any-return"]
[[tool.mypy.overrides]]
module = ["sphinx_needs.needs"]
# issue with importing tomllib/tomli based on python version
disable_error_code = ["no-redef"]
[tool.tox]
# To use tox, see https://tox.readthedocs.io
# $ pipx install tox
# it is suggested to use with https://github.com/tox-dev/tox-uv or https://github.com/tox-dev/tox-conda
# $ pipx inject tox tox-uv
legacy_tox_ini = """
[tox]
envlist = py310
[testenv]
usedevelop = true
[testenv:py{310,311,312,313,314}]
extras =
test
test-parallel
commands =
pytest --ignore tests/benchmarks {posargs:tests}
[testenv:py{310,311,312,313,314}-benchmark]
extras =
test
benchmark
docs
commands =
pytest {posargs:tests/benchmarks}
[testenv:docs-{alabaster,furo,im,pds,rtd}]
extras =
docs
furo: theme-furo
im: theme-im
pds: theme-pds
rtd: theme-rtd
passenv =
BUILDER
CLEAN
READTHEDOCS
TERM
setenv =
alabaster: DOCS_THEME=alabaster
furo: DOCS_THEME=furo
im: DOCS_THEME=sphinx_immaterial
pds: DOCS_THEME=pydata_sphinx_theme
rtd: DOCS_THEME=sphinx_rtd_theme
commands_pre =
python -c "import shutil; shutil.rmtree('docs/_build/{env:BUILDER:html}/{env:DOCS_THEME:}', ignore_errors=True) if '{env:CLEAN:}' else None"
commands =
sphinx-build -nW --keep-going -b {env:BUILDER:html} docs/ docs/_build/{env:BUILDER:html}/{env:DOCS_THEME:} {posargs:-T}
[testenv:docs-linkcheck]
basepython = python3.12
extras = docs
commands = sphinx-build -E -W -b linkcheck docs/ docs/_build/linkcheck
[testenv:mypy]
dependency_groups = mypy
commands = mypy {posargs:sphinx_needs}
[testenv:ruff-check]
dependency_groups = ruff
commands = ruff check {posargs:--fix}
[testenv:ruff-fmt]
dependency_groups = ruff
commands = ruff format {posargs}
"""