-
-
Notifications
You must be signed in to change notification settings - Fork 373
/
pyproject.toml
319 lines (289 loc) · 8.95 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
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
[build-system]
requires = ["hatchling>=1.4", "jupyter_client>=6"]
build-backend = "hatchling.build"
[project]
name = "ipykernel"
dynamic = ["version"]
authors = [{name = "IPython Development Team", email = "[email protected]"}]
license = {file = "LICENSE"}
readme = "README.md"
description = "IPython Kernel for Jupyter"
keywords = ["Interactive", "Interpreter", "Shell", "Web"]
classifiers = [
"Intended Audience :: Developers",
"Intended Audience :: System Administrators",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: BSD License",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
]
requires-python = ">=3.9"
dependencies = [
"debugpy>=1.8.1",
"ipython>=7.23.1",
"comm>=0.1.1",
"traitlets>=5.4.0",
"jupyter_client>=8.0.0",
"jupyter_core>=4.12,!=5.0.*",
# For tk event loop support only.
"nest_asyncio>=1.4",
"matplotlib-inline>=0.1",
'appnope>=0.1.2;platform_system=="Darwin"',
"pyzmq>=25.0",
"psutil>=5.7",
"packaging>=22",
"anyio>=4.2.0",
]
[project.urls]
Homepage = "https://ipython.org"
Documentation = "https://ipykernel.readthedocs.io"
Funding = "https://numfocus.org/donate"
Source = "https://github.com/ipython/ipykernel"
Tracker = "https://github.com/ipython/ipykernel/issues"
[project.optional-dependencies]
docs = [
"sphinx",
"myst_parser",
"pydata_sphinx_theme",
"sphinxcontrib_github_alt",
"sphinxcontrib-spelling",
"sphinx-autodoc-typehints",
"intersphinx_registry",
"trio"
]
test = [
"pytest>=7.0,<9",
"pytest-cov",
"flaky",
"ipyparallel",
"pre-commit",
"pytest-timeout",
"trio",
"pytest-asyncio>=0.23.5",
]
cov = [
"coverage[toml]",
"pytest-cov",
"matplotlib",
"curio",
"trio",
]
pyqt5 = ["pyqt5"]
pyside6 = ["pyside6"]
[tool.hatch.version]
path = "ipykernel/_version.py"
# Used to call hatch_build.py
[tool.hatch.build.hooks.custom]
[tool.hatch.build.targets.wheel.shared-data]
"data_kernelspec" = "share/jupyter/kernels/python3"
[tool.hatch.build.force-include]
"./ipykernel_launcher.py" = "ipykernel_launcher.py"
[tool.hatch.envs.docs]
features = ["docs"]
[tool.hatch.envs.docs.scripts]
build = "make -C docs html SPHINXOPTS='-W'"
api = "sphinx-apidoc -o docs/api -f -E ipykernel tests ipykernel/datapub.py ipykernel/pickleutil.py ipykernel/serialize.py ipykernel/gui ipykernel/pylab"
[tool.hatch.envs.test]
features = ["test"]
[tool.hatch.envs.test.scripts]
list = "python -m pip freeze"
test = "python -m pytest -vv {args}"
nowarn = "test -W default {args}"
[tool.hatch.envs.cov]
features = ["test", "cov"]
[tool.hatch.envs.cov.scripts]
test = "python -m pytest -vv --cov ipykernel --cov-branch --cov-report term-missing:skip-covered {args}"
nowarn = "test -W default {args}"
[[tool.hatch.envs.cov.matrix]]
qt = ["qt5", "qt6"]
[tool.hatch.envs.cov.overrides]
matrix.qt.features = [
{ value = "pyqt5", if = ["qt5"] },
{ value = "pyside6", if = ["qt6"] },
]
[tool.hatch.envs.typing]
dependencies = ["pre-commit"]
detached = true
[tool.hatch.envs.typing.scripts]
test = "pre-commit run --all-files --hook-stage manual mypy"
[tool.hatch.envs.lint]
dependencies = ["pre-commit"]
detached = true
[tool.hatch.envs.lint.scripts]
build = [
"pre-commit run --all-files ruff",
"pre-commit run --all-files ruff-format"
]
[tool.mypy]
files = "ipykernel"
strict = true
disable_error_code = ["no-untyped-def", "no-untyped-call", "import-not-found"]
enable_error_code = ["ignore-without-code", "redundant-expr", "truthy-bool"]
follow_imports = "normal"
pretty = true
warn_unreachable = true
[tool.pytest.ini_options]
minversion = "6.0"
xfail_strict = true
log_cli_level = "info"
addopts = [
"-raXs", "--durations=10", "--color=yes", "--doctest-modules",
"--showlocals", "--strict-markers", "--strict-config",
"--ignore=ipykernel/pylab/backend_inline.py",
"--ignore=ipykernel/pylab/config.py",
"--ignore=ipykernel/gui/gtk3embed.py",
"--ignore=ipykernel/gui/gtkembed.py",
"--ignore=ipykernel/datapub.py",
"--ignore=ipykernel/log.py",
"--ignore=ipykernel/pickleutil.py",
"--ignore=ipykernel/serialize.py",
"--ignore=ipykernel/_eventloop_macos.py"
]
testpaths = [
"tests",
# "tests/inprocess"
]
norecursedirs = "tests/inprocess"
timeout = 60
# Restore this setting to debug failures
# timeout_method = "thread"
filterwarnings= [
# Fail on warnings
"error",
# Ignore our own warnings
"ignore:The `stream` parameter of `getpass.getpass` will have no effect:UserWarning",
"ignore:has moved to ipyparallel:DeprecationWarning",
# IPython warnings
"ignore: `Completer.complete` is pending deprecation since IPython 6.0 and will be replaced by `Completer.completions`:PendingDeprecationWarning",
"ignore: backends is deprecated since IPython 8.24, backends are managed in matplotlib and can be externally registered.:DeprecationWarning",
"ignore: backend2gui is deprecated since IPython 8.24, backends are managed in matplotlib and can be externally registered.:DeprecationWarning",
# Ignore jupyter_client warnings
"ignore:unclosed <socket.socket:ResourceWarning",
"ignore:unclosed event loop:ResourceWarning",
"ignore:There is no current event loop:DeprecationWarning",
"ignore:zmq.eventloop.ioloop is deprecated in pyzmq 17. pyzmq now works with default tornado and asyncio eventloops.:DeprecationWarning",
"module:Jupyter is migrating its paths to use standard platformdirs:DeprecationWarning",
# Ignore datetime warning.
"ignore:datetime.datetime.utc:DeprecationWarning",
# https://github.com/python-trio/trio/issues/3053
"ignore:The `hash` argument is deprecated in favor of `unsafe_hash` and will be removed in or after August 2025.",
# ignore unclosed sqlite in traits
"ignore:unclosed database in <sqlite3.Connection:ResourceWarning",
]
[tool.coverage.report]
exclude_lines = [
"pragma: no cover",
"def __repr__",
"if self.debug:",
"if settings.DEBUG",
"raise AssertionError",
"raise NotImplementedError",
"if 0:",
"if __name__ == .__main__.:",
"class .*\bProtocol\\):",
"@(abc\\.)?abstractmethod",
]
[tool.coverage.run]
relative_files = true
source = ["ipykernel"]
omit = [
"tests/*",
"ipykernel/datapub.py",
"ipykernel/debugger.py",
"ipykernel/eventloops.py",
"ipykernel/log.py",
"ipykernel/pickleutil.py",
"ipykernel/serialize.py",
"ipykernel/gui/*",
"ipykernel/pylab/*",
]
[tool.ruff]
line-length = 100
[tool.ruff.lint]
extend-select = [
"B", # flake8-bugbear
"I", # isort
"ARG", # flake8-unused-arguments
"C4", # flake8-comprehensions
"EM", # flake8-errmsg
"ICN", # flake8-import-conventions
"G", # flake8-logging-format
"PGH", # pygrep-hooks
"PIE", # flake8-pie
"PL", # pylint
"PT", # flake8-pytest-style
"PTH", # flake8-use-pathlib
"RET", # flake8-return
"RUF", # Ruff-specific
"SIM", # flake8-simplify
"T20", # flake8-print
"UP", # pyupgrade
"YTT", # flake8-2020
"EXE", # flake8-executable
"NPY", # NumPy specific rules
"PD", # pandas-vet
"PYI", # flake8-pyi
]
ignore = [
"PLR", # Design related pylint codes
# Allow non-abstract empty methods in abstract base classes
"B027",
# Use of `assert` detected
"S101",
# Possible hardcoded password
"S105", "S106",
# `print` found
"T201",
# Unnecessary `dict` call (rewrite as a literal)
"C408",
# Use `contextlib.suppress(ValueError)` instead of try-except-pass
"SIM105",
# `try`-`except`-`pass` detected
"S110",
# Mutable class attributes should be annotated with `typing.ClassVar`
"RUF012",
# Unused function argument:
"ARG001",
# Unused method argument:
"ARG002",
# Logging statement uses `%`
"G002",
# `open()` should be replaced by `Path.open()`
"PTH123",
# use `X | Y` for type annotations, this does not works for dynamic getting type hints on older python
"UP007",
]
unfixable = [
# Don't touch print statements
"T201",
# Don't touch noqa lines
"RUF100",
# Don't touch imports
"F401",
"F403"
]
[tool.ruff.lint.per-file-ignores]
# B011 Do not call assert False since python -O removes these calls
# C408 Unnecessary `dict` call
# T201 `print` found
# B007 Loop control variable `i` not used within the loop body.
# PLW0603 Using the global statement to update ...
# PLC1901 `stderr == ""` can be simplified to `not stderr` as an empty string is falsey
# B018 Found useless expression. Either assign it to a variable or remove it.
# S603 `subprocess` call: check for execution of untrusted input
"tests/*" = ["B011", "C408", "T201", "B007", "EM", "PTH", "PLW", "PLC1901", "B018", "S603", "ARG", "RET", "PGH"]
"*/__init__.py" = ["F401"]
[tool.interrogate]
ignore-init-module=true
ignore-private=true
ignore-semiprivate=true
ignore-property-decorators=true
ignore-nested-functions=true
ignore-nested-classes=true
fail-under=95
exclude = ["docs", "tests"]
[tool.check-wheel-contents]
toplevel = ["ipykernel/", "ipykernel_launcher.py"]
ignore = ["W002"]
[tool.repo-review]
ignore = ["PY007", "PP308", "GH102", "MY101"]