forked from useblocks/sphinx-needs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pyproject.toml
186 lines (169 loc) · 4.9 KB
/
pyproject.toml
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
[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 = "[email protected]" }]
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.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
'Topic :: Documentation',
'Topic :: Utilities',
'Framework :: Sphinx :: Extension',
]
requires-python = ">=3.9,<4"
dependencies = [
"sphinx>=7.0,<9",
"requests-file~=2.1", # external links
"requests~=2.32", # external links
"jsonschema>=3.2.0", # needsimport 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
]
[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>=4.6.5,<5.0",
"responses~=0.22.0",
"pytest-xprocess~=1.0",
]
test-parallel = ["pytest-xdist"]
benchmark = ["pytest-benchmark~=5.0", "memray>=1.3.1,<2.0.0"]
docs = [
"matplotlib>=3.3.0",
"sphinxcontrib-plantuml~=0.0",
"sphinx-copybutton~=0.5",
"sphinxcontrib-programoutput~=0.17",
"sphinx-design~=0.6",
]
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"]
[tool.pytest.ini_options]
markers = [
"jstest: marks tests as JavaScript test (deselect with '-m \"not jstest\"')",
]
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 = py39
[testenv]
usedevelop = true
[testenv:py{39,310,311,312,313}]
extras =
test
test-parallel
commands =
pytest --ignore tests/benchmarks {posargs:tests}
[testenv:py{39,310,311,312,313}-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}
"""