forked from useblocks/sphinx-needs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pyproject.toml
224 lines (198 loc) · 6.24 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
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
[tool.poetry]
name = "sphinx-needs"
# !! Don't miss updates in sphinx_needs.__version__, changelog.rst, and .github/workflows/docker !!!
version = "4.1.0"
description = "Sphinx needs extension for managing needs/requirements and specifications"
authors = ["team useblocks <[email protected]>"]
license = "MIT"
readme = "README.rst"
repository = "http://github.com/useblocks/sphinx-needs"
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.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Topic :: Documentation',
'Topic :: Utilities',
'Framework :: Sphinx :: Extension',
]
packages = [
{include = "sphinx_needs"}
]
# [project.dependencies]
[tool.poetry.dependencies]
python = ">=3.8,<4"
sphinx = ">=6.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" # needed for datatables in sphinx>=6
tomli = { version = "*", python = "<3.11" }
# [project.optional-dependencies.plotting]
# for needpie / needbar
matplotlib = { version = ">=3.3.0", optional = true }
# [project.optional-dependencies.test]
pytest = { version = "^7", optional = true }
pytest-cov = { version = "^4", optional = true }
lxml = { version = "^4.6.5", optional = true }
responses = { version = "^0.22.0", optional = true }
sphinxcontrib-plantuml = { version = "^0", optional = true }
syrupy = { version = "^3", optional = true }
pytest-xprocess = { version = "^0.22.2", optional = true }
defusedxml = { version = "^0.7.1", optional = true }
# [project.optional-dependencies.test-parallel]
pytest-xdist = { version = "*", optional = true }
# [project.optional-dependencies.benchmark]
pytest-benchmark = { version = "^4.0.0", optional = true }
memray = { version = "^1.3.1", optional = true }
# [project.optional-dependencies.docs]
sphinx-copybutton = { version="^0.5", optional = true }
sphinxcontrib-programoutput = { version="^0.17", optional = true }
sphinx-design = { version="^0.6", optional = true }
# [project.optional-dependencies.theme-im]
sphinx-immaterial = { version="^0.11.11", optional = true }
# [project.optional-dependencies.theme-furo]
furo = { version="^2024.8.6", optional = true }
# [project.optional-dependencies.theme-pds]
pydata-sphinx-theme = { version="^0.15.2", optional = true }
# [project.optional-dependencies.theme-rtd]
sphinx_rtd_theme = { version="^2.0.0", optional = true }
[tool.poetry.extras]
plotting = ["matplotlib"]
test = [
"defusedxml",
"matplotlib",
"pytest",
"pytest-cov",
"syrupy",
"sphinxcontrib-plantuml",
"lxml",
"responses",
"pytest-xprocess"
]
test-parallel = ["pytest-xdist"]
benchmark = ["pytest-benchmark", "memray"]
docs = [
"matplotlib",
"sphinxcontrib-plantuml",
"sphinx-copybutton",
"sphinxcontrib-programoutput",
"sphinx-design",
]
theme-im = ["sphinx-immaterial"]
theme-furo = ["furo"]
theme-pds = ["pydata-sphinx-theme"]
theme-rtd = ["sphinx_rtd_theme"]
[tool.poetry.dev-dependencies]
pre-commit = "^3"
[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"]
[build-system]
requires = ["setuptools", "poetry_core>=1.0.8"] # setuptools for deps like plantuml
build-backend = "poetry.core.masonry.api"
[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 = py38
[testenv]
usedevelop = true
[testenv:py{38,39,310,311,312}]
extras =
test
test-parallel
commands =
pytest --ignore tests/benchmarks {posargs:tests}
[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}
"""