Debian Codegraph @

pyproject.toml

raw
1 [build-system]
2 requires = ["hatchling>=1.22", "jupyter_client>=6"]
3 build-backend = "hatchling.build"
4
5 [project]
6 name = "ipykernel"
7 dynamic = ["version"]
8 authors = [{name = "IPython Development Team", email = "[email protected]"}]
9 license = "BSD-3-Clause"
10 readme = "README.md"
11 description = "IPython Kernel for Jupyter"
12 keywords = ["Interactive", "Interpreter", "Shell", "Web"]
13 classifiers = [
14 "Intended Audience :: Developers",
15 "Intended Audience :: System Administrators",
16 "Intended Audience :: Science/Research",
17 "Programming Language :: Python",
18 "Programming Language :: Python :: 3",
19 ]
20 requires-python = ">=3.10"
21 dependencies = [
22 "debugpy>=1.6.5",
23 "ipython>=7.23.1",
24 "comm>=0.1.1",
25 "traitlets>=5.4.0",
26 "jupyter_client>=8.8.0",
27 "jupyter_core>=5.1,!=6.0.*",
28 # For tk event loop support only.
29 "nest_asyncio>=1.4",
30 "tornado>=6.4.1",
31 "matplotlib-inline>=0.1",
32 'appnope>=0.1.2;platform_system=="Darwin"',
33 "pyzmq>=25",
34 "psutil>=5.7",
35 "packaging>=22",
36 ]
37
38 [project.urls]
39 Homepage = "https://ipython.org"
40 Documentation = "https://ipykernel.readthedocs.io"
41 Source = "https://github.com/ipython/ipykernel"
42 Tracker = "https://github.com/ipython/ipykernel/issues"
43
44 [project.optional-dependencies]
45 docs = [
46 # Sphinx pinned until `sphinx-autodoc-typehints` issue is resolved:
47 # https://github.com/tox-dev/sphinx-autodoc-typehints/issues/523
48 "sphinx<8.2.0",
49 "myst_parser",
50 "pydata_sphinx_theme",
51 "sphinxcontrib_github_alt",
52 "sphinxcontrib-spelling",
53 "sphinx-autodoc-typehints",
54 "intersphinx_registry",
55 "trio"
56 ]
57 test = [
58 "pytest>=7.0,<10",
59 "pytest-cov",
60 # 'pytest-xvfb; platform_system == "Linux"',
61 "flaky",
62 "ipyparallel",
63 "pre-commit",
64 "pytest-asyncio>=0.23.5",
65 "pytest-timeout"
66 ]
67 cov = [
68 "coverage[toml]",
69 "pytest-cov",
70 "matplotlib",
71 "trio",
72 ]
73 pyqt5 = ["pyqt5"]
74 pyside6 = ["pyside6"]
75
76 [tool.hatch.version]
77 path = "ipykernel/_version.py"
78
79 # Used to call hatch_build.py
80 [tool.hatch.build.hooks.custom]
81
82 [tool.hatch.build.targets.wheel.shared-data]
83 "data_kernelspec" = "share/jupyter/kernels/python3"
84
85 [tool.hatch.build.force-include]
86 "./ipykernel_launcher.py" = "ipykernel_launcher.py"
87
88 [tool.hatch.envs.docs]
89 features = ["docs"]
90 [tool.hatch.envs.docs.scripts]
91 build = "make -C docs html SPHINXOPTS='-W'"
92 api = "sphinx-apidoc -o docs/api -f -E ipykernel tests ipykernel/datapub.py ipykernel/pickleutil.py ipykernel/serialize.py ipykernel/gui ipykernel/pylab ipykernel/utils.py"
93
94 [tool.hatch.envs.test]
95 features = ["test"]
96 [tool.hatch.envs.test.scripts]
97 list = "python -m pip freeze"
98 test = "python -m pytest -vv {args}"
99 nowarn = "test -W default {args}"
100
101 [tool.hatch.envs.cov]
102 features = ["test", "cov"]
103 [tool.hatch.envs.cov.scripts]
104 test = "python -m pytest -vv --cov ipykernel --cov-branch --cov-report term-missing:skip-covered {args}"
105 nowarn = "test -W default {args}"
106
107 [tool.hatch.envs.cov.overrides]
108 env.QT.features = [
109 { value = "pyqt5", if = ["qt5"] },
110 { value = "pyside6", if = ["qt6"] },
111 ]
112
113 [tool.hatch.envs.typing]
114 dependencies = ["pre-commit"]
115 detached = true
116 [tool.hatch.envs.typing.scripts]
117 test = "pre-commit run --all-files --hook-stage manual mypy"
118
119 [tool.hatch.envs.lint]
120 dependencies = ["pre-commit"]
121 detached = true
122 [tool.hatch.envs.lint.scripts]
123 build = [
124 "pre-commit run --all-files ruff-check",
125 "pre-commit run --all-files ruff-format"
126 ]
127
128 [tool.mypy]
129 files = "ipykernel"
130 strict = true
131 disable_error_code = ["no-untyped-def", "no-untyped-call", "import-not-found"]
132 enable_error_code = ["ignore-without-code", "redundant-expr", "truthy-bool"]
133 follow_imports = "normal"
134 pretty = true
135 warn_unreachable = true
136
137 [tool.pytest.ini_options]
138 minversion = "6.0"
139 xfail_strict = true
140 log_cli_level = "info"
141 addopts = [
142 "-raXs", "--durations=10", "--color=yes", "--doctest-modules",
143 "--showlocals", "--strict-markers", "--strict-config",
144 "--ignore=ipykernel/pylab/backend_inline.py",
145 "--ignore=ipykernel/pylab/config.py",
146 "--ignore=ipykernel/gui/gtk3embed.py",
147 "--ignore=ipykernel/gui/gtkembed.py",
148 "--ignore=ipykernel/datapub.py",
149 "--ignore=ipykernel/log.py",
150 "--ignore=ipykernel/pickleutil.py",
151 "--ignore=ipykernel/serialize.py",
152 "--ignore=ipykernel/_eventloop_macos.py"
153 ]
154 testpaths = [
155 "tests",
156 ]
157 asyncio_mode = "auto"
158 #timeout = 300
159 timeout = 30
160 # Restore this setting to debug failures
161 #timeout_method = "thread"
162 filterwarnings= [
163 # Fail on warnings
164 "error",
165
166 # Ignore our own warnings
167 "ignore:The `stream` parameter of `getpass.getpass` will have no effect:UserWarning",
168
169 # IPython warnings
170 "ignore: `Completer.complete` is pending deprecation since IPython 6.0 and will be replaced by `Completer.completions`:PendingDeprecationWarning",
171 "ignore: backends is deprecated since IPython 8.24, backends are managed in matplotlib and can be externally registered.:DeprecationWarning",
172 "ignore: backend2gui is deprecated since IPython 8.24, backends are managed in matplotlib and can be externally registered.:DeprecationWarning",
173
174 # Ignore jupyter_client warnings
175 "module:Jupyter is migrating its paths to use standard platformdirs:DeprecationWarning",
176
177 # ignore unclosed sqlite in traits
178 "ignore:unclosed database in <sqlite3.Connection:ResourceWarning",
179
180 # ignore deprecated non async during tests:
181 "always:For consistency across implementations, it is recommended that:PendingDeprecationWarning",
182
183 ]
184
185 [tool.coverage.report]
186 exclude_lines = [
187 "pragma: no cover",
188 "def __repr__",
189 "if self.debug:",
190 "if settings.DEBUG",
191 "raise AssertionError",
192 "raise NotImplementedError",
193 "if 0:",
194 "if __name__ == .__main__.:",
195 "class .*\bProtocol\\):",
196 "@(abc\\.)?abstractmethod",
197 ]
198
199 [tool.coverage.run]
200 relative_files = true
201 source = ["ipykernel"]
202 omit = [
203 "tests/*",
204 "ipykernel/datapub.py",
205 "ipykernel/debugger.py",
206 "ipykernel/eventloops.py",
207 "ipykernel/log.py",
208 "ipykernel/pickleutil.py",
209 "ipykernel/serialize.py",
210 "ipykernel/gui/*",
211 "ipykernel/pylab/*",
212 ]
213
214 [tool.ruff]
215 line-length = 100
216
217 [tool.ruff.lint]
218 extend-select = [
219 "B", # flake8-bugbear
220 "I", # isort
221 "ARG", # flake8-unused-arguments
222 "C4", # flake8-comprehensions
223 "EM", # flake8-errmsg
224 "ICN", # flake8-import-conventions
225 "G", # flake8-logging-format
226 "PGH", # pygrep-hooks
227 "PIE", # flake8-pie
228 "PL", # pylint
229 "PT", # flake8-pytest-style
230 "PTH", # flake8-use-pathlib
231 "RET", # flake8-return
232 "RUF", # Ruff-specific
233 "SIM", # flake8-simplify
234 "T20", # flake8-print
235 "UP", # pyupgrade
236 "YTT", # flake8-2020
237 "EXE", # flake8-executable
238 "NPY", # NumPy specific rules
239 "PD", # pandas-vet
240 "PYI", # flake8-pyi
241 ]
242 ignore = [
243 "PLR", # Design related pylint codes
244 # Allow non-abstract empty methods in abstract base classes
245 "B027",
246 "T201", # `print` found
247 # Unnecessary `dict` call (rewrite as a literal)
248 "C408",
249 "SIM105", # Use `contextlib.suppress(ValueError)` instead of try-except-pass
250 # Mutable class attributes should be annotated with `typing.ClassVar`
251 "RUF012",
252 # Unused function argument:
253 "ARG001",
254 # Unused method argument:
255 "ARG002",
256 # `open()` should be replaced by `Path.open()`
257 "PLC0415", # `import` should be at the top-level of a file
258 "PTH123",
259 "UP007", # use `X | Y` for type annotations, this does not works for dynamic getting type hints on older python
260 "UP031", # Use format specifiers instead of percent format
261 "PT023", # Use `@pytest.mark.skip` over `@pytest.mark.skip()`
262 "PT001", # autofixable: Use `@pytest.fixture` over `@pytest.fixture()`
263 ]
264
265 [tool.ruff.lint.per-file-ignores]
266 # B011 Do not call assert False since python -O removes these calls
267 # C408 Unnecessary `dict` call
268 # T201 `print` found
269 # B007 Loop control variable `i` not used within the loop body.
270 # PLW0603 Using the global statement to update ...
271 # PLC1901 `stderr == ""` can be simplified to `not stderr` as an empty string is falsey
272 # B018 Found useless expression. Either assign it to a variable or remove it.
273 # S603 `subprocess` call: check for execution of untrusted input
274 "tests/*" = ["B011", "C408", "T201", "B007", "EM", "PTH", "PLW", "PLC1901", "B018", "S603", "ARG", "RET", "PGH"]
275 "*/__init__.py" = ["F401"]
276
277 [tool.interrogate]
278 ignore-init-module=true
279 ignore-private=true
280 ignore-semiprivate=true
281 ignore-property-decorators=true
282 ignore-nested-functions=true
283 ignore-nested-classes=true
284 fail-under=95
285 exclude = ["docs", "tests"]
286
287 [tool.check-wheel-contents]
288 toplevel = ["ipykernel/", "ipykernel_launcher.py"]
289 ignore = ["W002"]
290
291 [tool.repo-review]
292 ignore = ["PY007", "PP308", "GH102", "MY101"]