forked from Iota-School/notebooks-for-all
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpyproject.toml
executable file
·254 lines (218 loc) · 5.32 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
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
# use the hatch build system for building and developing nbconvert_a11y
# it helps us manage virtual environments and build tasks
[build-system]
build-backend = "hatchling.build"
requires = ["hatch-vcs", "hatchling"]
[tool.hatch.build.targets.sdist]
[tool.hatch.build.targets.wheel]
[project]
name = "nbconvert-a11y"
description = "nbconvert templates using modern standards"
readme = "README.md"
url = "https://github.com/deathbeds/nbconvert-a11y"
requires-python = ">=3.8"
license = "BSD-3-Clause"
keywords = []
authors = [{ name = "tonyfast", email = "[email protected]" }]
classifiers = [
"Development Status :: 4 - Beta",
"License :: OSI Approved :: BSD License",
"Natural Language :: English",
"Programming Language :: Python",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
]
dependencies = [
"accessible-pygments",
"html5lib",
"markdown-it-py[linkify,plugins]",
"nbconvert",
"python-slugify",
"exceptiongroup; python_version < '3.12'",
]
dynamic = ["version"]
[project.optional-dependencies]
audit = ["playwright", "requests", "requests_cache"]
docs = ["mkdocs-material", "mkdocstrings[python]"]
task = ["doit", "pandas", "tabulate", "tomli"]
test = [
"beautifulsoup4",
"ipywidgets",
"matplotlib",
"numpy",
"pytest",
"pytest-html",
"pytest-playwright",
"pytest-sugar",
"pytest-xdist",
"scipy",
]
[tool.hatch.envs.docs]
features = ["docs"]
[tool.hatch.envs.docs.overrides]
env.CI.features = [{ if = ["1"], value = "audit" }]
[tool.hatch.envs.docs.scripts]
build = "mkdocs build -v"
serve = "mkdocs serve -v"
[project.entry-points."nbconvert.exporters"]
a11y = "nbconvert_a11y.exporter:A11yExporter"
a11y-table = "nbconvert_a11y.exporter:A11yExporter"
a11y-landmark = "nbconvert_a11y.exporter:SectionExporter"
a11y-list = "nbconvert_a11y.exporter:ListExporter"
[project.entry-points.pytest11]
axe = "nbconvert_a11y.axe.pytest_axe"
vnu = "nbconvert_a11y.pytest_w3c"
[tool.hatch.build.targets.wheel.shared-data]
"nbconvert_a11y/templates" = "share/jupyter/nbconvert/templates"
# versioning is automatically synced using scm tools
[tool.setuptools_scm]
write_to = "nbconvert_a11y/_version.py"
[tool.hatch.build.hooks.vcs]
version-file = "nbconvert_a11y/_version.py"
[tool.hatch.version]
source = "vcs"
# testing setttings
[tool.hatch.envs.test.scripts]
run = "pytest"
[tool.pytest.ini_options]
minversion = "6.0"
addopts = "-vvv -pno:importnb"
asyncio_mode = "auto"
testpaths = ["tests", "test_playwright.py"]
norecursedirs = ["tests/exports", "tests/notebooks", "*checkpoints"]
[tool.hatch.envs.test]
features = ["test", "audit"]
post-install-commands = ["python -m playwright install chrome"]
[tool.hatch.envs.test.overrides]
env.CI.post-install-commands = [
"python -m playwright install --with-deps chrome",
]
[tool.hatch.envs.release]
# test a release on test-pypi
dependencies = ["nbconvert-a11y", "pytest"]
[tool.hatch.envs.release.scripts]
test = "pytest tests/test_smoke.py"
[tools.hatch.envs.release.overrides]
env.CI.dev-mode = false
env.CI.env-vars = [
{ key = "PIP_INDEX_URL", value = "https://test.pypi.org/simple/" },
{ key = "PIP_EXTRA_INDEX_URL", value = "https://pypi.org/simple/" },
{ key = "PIP_PRE", value = "1" },
]
# formatting settings
[tool.isort]
profile = "black"
[tool.black]
line_length = 100
[tool.hatch.envs.task]
features = ["task"]
description = "doit tasks"
[tool.hatch.envs.task.scripts]
list = "doit list"
convert = "doit convert"
run = "doit run"
[tool.hatch.envs.audit]
features = ["task", "audit"]
post-install-commands = ["- python -m playwright install chrome-beta"]
[tool.hatch.envs.audit.overrides]
env.CI.post-install-commands = [
"python -m playwright install --with-deps chrome-beta",
]
[tool.hatch.envs.audit.scripts]
axe = "doit audit"
[tool.doit.commands.list]
status = true
subtasks = true
[tool.doit]
backend = "json"
verbosity = 2
process = 2
[tool.doit.tasks.copy]
notebooks = [
"tests/notebooks/lorenz.ipynb",
"tests/notebooks/lorenz-executed.ipynb",
]
configurations = [
"tests/configurations/default.py",
"tests/configurations/a11y.py",
]
[tool.doit.tasks.convert]
notebooks_dir = "tests/exports/notebooks"
configs_dir = "tests/exports/configs"
target = "tests/exports/html"
[tool.hatch.envs.format]
skip-install = true
dependencies = ["ruff", "pyproject-fmt"]
[tool.hatch.envs.format.scripts]
# cant reach steady state using pyproject.toml
# pyproject-fmt pyproject.toml
code = """
ruff --fix-only .
ruff format .
"""
[tool.ruff]
# formatting cause linting sucks
cache-dir = "build/.cache/ruff"
line-length = 100
extend-include = ["*.ipynb"]
exclude = [
"tests/user-tests",
"tests/configurations",
"tests/notebooks",
"user-tests",
]
[tool.ruff.lint]
isort.known-first-party = ["importnb", "nbconvert_a11y", "tests"]
ignore = ["D203", "D213", "COM812", "ISC001"]
select = [
"A",
"ANN",
"ARG",
"B",
"BLE",
"C4",
"C90",
"COM",
"D",
"DJ",
"DTZ",
"E",
"EM",
"ERA",
"EXE",
"F",
"FBT",
"G",
"I",
"ICN",
"INP",
"ISC",
"N",
"NPY",
"PD",
"PGH",
"PIE",
"PL",
"PT",
"PTH",
"PYI",
"Q",
"RET",
"RSE",
"RUF",
"S",
"SIM",
"SLF",
"T10",
"T20",
"TCH",
"TID",
"TRY",
"UP",
"W",
"YTT",
]