Debian Codegraph @

pyproject.toml

raw
1 [build-system]
2 requires = ["setuptools>=80.0"]
3 # We need access to the 'setupbase' module at build time.
4 # Hence we declare a custom build backend.
5 build-backend = "_build_meta" # just re-exports setuptools.build_meta definitions
6 backend-path = ["."]
7
8 [project]
9 name = "ipython"
10 description = "IPython: Productive Interactive Computing"
11 keywords = ["Interactive", "Interpreter", "Shell", "Embedding"]
12 classifiers = [
13 "Framework :: IPython",
14 "Framework :: Jupyter",
15 "Intended Audience :: Developers",
16 "Intended Audience :: Science/Research",
17 "Programming Language :: Python",
18 "Programming Language :: Python :: 3",
19 "Programming Language :: Python :: 3 :: Only",
20 "Topic :: System :: Shells",
21 ]
22 license = "BSD-3-Clause"
23 license-files = ["LICENSE", "COPYING.rst"]
24 requires-python = ">=3.12"
25 dependencies = [
26 'colorama>=0.4.4; sys_platform == "win32"',
27 "decorator>=5.1.0",
28 "ipython-pygments-lexers>=1.0.0",
29 "jedi>=0.18.2",
30 "matplotlib-inline>=0.1.6",
31 'pexpect>4.6; sys_platform != "win32" and sys_platform != "emscripten"',
32 "prompt_toolkit>=3.0.41,<3.1.0",
33 "pygments>=2.14.0", # wheel
34 "stack_data>=0.6.0",
35 "traitlets>=5.13.0",
36 ]
37 dynamic = ["authors", "version"]
38
39 [project.scripts]
40 ipython = "IPython:start_ipython"
41 ipython3 = "IPython:start_ipython"
42
43 [project.readme]
44 file = "long_description.rst"
45 content-type = "text/x-rst"
46
47 [project.urls]
48 Homepage = "https://ipython.org"
49 Documentation = "https://ipython.readthedocs.io/"
50 Funding = "https://jupyter.org/about#donate"
51 Source = "https://github.com/ipython/ipython"
52 Tracker = "https://github.com/ipython/ipython/issues"
53
54 [project.optional-dependencies]
55 black = [
56 "black",
57 ]
58 doc = [
59 "docrepr",
60 "exceptiongroup",
61 "intersphinx_registry",
62 "ipykernel",
63 "ipython[test,matplotlib]",
64 "setuptools>=80.0",
65 "sphinx_toml==0.0.4",
66 "sphinx-rtd-theme>=0.1.8", # wheel
67 "sphinx>=8.0",
68 "typing_extensions",
69 ]
70 test = [
71 "pytest>=7.0.0", # keep in sync with tool.pytest.ini_options.minversion
72 "pytest-asyncio>=1.0.0",
73 "testpath>=0.2",
74 "packaging>=23.0.0",
75 "setuptools>=80.0",
76 ]
77 test_extra = [
78 "ipython[test]",
79 "curio",
80 "jupyter_ai",
81 "ipython[matplotlib]",
82 "nbformat",
83 "nbclient",
84 "ipykernel>6.30",
85 "numpy>=2.0",
86 "pandas>2.1",
87 "trio>=0.22.0",
88 ]
89 matplotlib = [
90 "matplotlib>3.9"
91 ]
92 all = [
93 "ipython[doc,matplotlib,terminal,test,test_extra]",
94 "argcomplete>=3.0",
95 "types-decorator"
96 ]
97
98
99 [tool.mypy]
100 python_version = "3.12"
101 ignore_missing_imports = true
102 follow_imports = 'silent'
103 exclude = [
104 'test_\.+\.py',
105 'IPython.utils.tests.test_wildcard',
106 'testing',
107 'tests',
108 '_process_win32_controller.py',
109 'IPython/core/application.py',
110 'IPython/core/profileapp.py',
111 'IPython/lib/deepreload.py',
112 'IPython/sphinxext/ipython_directive.py',
113 'IPython/terminal/ipapp.py',
114 'IPython/utils/path.py',
115 'IPython/core/debugger_backport.py',
116 ]
117 check_untyped_defs = true
118 # disallow_untyped_calls = true
119 # disallow_untyped_decorators = true
120 # ignore_errors = false
121 # ignore_missing_imports = false
122 disallow_incomplete_defs = true
123 disallow_untyped_defs = true
124 warn_redundant_casts = true
125 enable_error_code = ["ignore-without-code", "redundant-expr", "truthy-bool"]
126 #warn_unreachable = true
127 #strict = true
128
129 [[tool.mypy.overrides]]
130 module = [
131 "IPython.core.events",
132 "IPython.core.magic",
133 "IPython.utils._process_common",
134 "IPython.utils._process_win32",
135 ]
136 # Strictest configuration, everything turned up to the max
137 check_untyped_defs = true
138 disallow_incomplete_defs = true
139 disallow_untyped_calls = true
140 disallow_untyped_decorators = true
141 disallow_untyped_defs = true
142 disallow_any_generics = true
143 disallow_subclassing_any = true
144 warn_return_any = true
145 warn_unused_ignores = true
146 warn_unreachable = true
147 strict_equality = true
148 no_implicit_optional = true
149 ignore_errors = false
150 ignore_missing_imports = false
151
152 [[tool.mypy.overrides]]
153 module = [
154 "IPython.core.ultratb",
155 ]
156 check_untyped_defs = true
157 disallow_incomplete_defs = true
158 disallow_untyped_calls = false
159 disallow_untyped_decorators = true
160 disallow_untyped_defs = false
161 ignore_errors = false
162 ignore_missing_imports = false
163
164 [[tool.mypy.overrides]]
165 module = [
166 "IPython.core.crashhandler",
167 "IPython.utils.text",
168 "IPython.utils.PyColorize",
169 "IPython.utils.sentinel",
170 "IPython.utils.data",
171 "IPython.utils.importstring",
172 "IPython.utils.syspathcontext",
173 "IPython.utils.generics",
174 "IPython.utils.encoding",
175 "IPython.utils.module_paths",
176 ]
177 check_untyped_defs = true
178 disallow_incomplete_defs = true
179 disallow_untyped_calls = true
180 disallow_untyped_decorators = true
181 disallow_untyped_defs = true
182 ignore_errors = false
183 ignore_missing_imports = false
184
185 [[tool.mypy.overrides]]
186 module = [
187 "IPython.core.debugger",
188 ]
189 disallow_untyped_defs = false
190 ignore_errors = false
191 ignore_missing_imports = true
192 disallow_untyped_calls = false
193 disallow_incomplete_defs = false
194 check_untyped_defs = true
195 disallow_untyped_decorators = true
196
197 [[tool.mypy.overrides]]
198 module = [
199 "IPython.core.interactiveshell",
200 ]
201 disallow_untyped_defs = false
202 ignore_errors = false
203 ignore_missing_imports = true
204 disallow_untyped_calls = false
205 disallow_incomplete_defs = false
206 check_untyped_defs = true
207 disallow_untyped_decorators = false
208 disable_error_code = [
209 "arg-type",
210 "assignment",
211 "attr-defined",
212 "index",
213 "var-annotated",
214 "union-attr"
215 ]
216
217 # gloabl ignore error
218 [[tool.mypy.overrides]]
219 module = [
220 "IPython",
221 "IPython.conftest",
222 "IPython.core.alias",
223 "IPython.core.async_helpers",
224 "IPython.core.autocall",
225 "IPython.core.builtin_trap",
226 "IPython.core.compilerop",
227 "IPython.core.completer",
228 "IPython.core.completerlib",
229 "IPython.core.display",
230 "IPython.core.display_functions",
231 "IPython.core.display_trap",
232 "IPython.core.displayhook",
233 "IPython.core.displaypub",
234 "IPython.core.extensions",
235 "IPython.core.formatters",
236 "IPython.core.getipython",
237 "IPython.core.guarded_eval",
238 "IPython.core.historyapp",
239 "IPython.core.hooks",
240 "IPython.core.inputtransformer2",
241 "IPython.core.logger",
242 "IPython.core.macro",
243 "IPython.core.magic_arguments",
244 "IPython.core.magics.ast_mod",
245 "IPython.core.magics.auto",
246 "IPython.core.magics.basic",
247 "IPython.core.magics.code",
248 "IPython.core.magics.config",
249 "IPython.core.magics.display",
250 "IPython.core.magics.execution",
251 "IPython.core.magics.extension",
252 "IPython.core.magics.history",
253 "IPython.core.magics.logging",
254 "IPython.core.magics.namespace",
255 "IPython.core.magics.osm",
256 "IPython.core.magics.packaging",
257 "IPython.core.magics.pylab",
258 "IPython.core.magics.script",
259 "IPython.core.oinspect",
260 "IPython.core.page",
261 "IPython.core.payload",
262 "IPython.core.payloadpage",
263 "IPython.core.prefilter",
264 "IPython.core.profiledir",
265 "IPython.core.prompts",
266 "IPython.core.pylabtools",
267 "IPython.core.shellapp",
268 "IPython.core.splitinput",
269 "IPython.extensions.autoreload",
270 "IPython.extensions.storemagic",
271 "IPython.external.pickleshare",
272 "IPython.external.qt_for_kernel",
273 "IPython.external.qt_loaders",
274 "IPython.lib.backgroundjobs",
275 "IPython.lib.clipboard",
276 "IPython.lib.demo",
277 "IPython.lib.display",
278 "IPython.lib.editorhooks",
279 "IPython.lib.guisupport",
280 "IPython.lib.latextools",
281 "IPython.lib.lexers",
282 "IPython.lib.pretty",
283 "IPython.paths",
284 "IPython.sphinxext.ipython_console_highlighting",
285 "IPython.terminal.debugger",
286 "IPython.terminal.embed",
287 "IPython.terminal.interactiveshell",
288 "IPython.terminal.magics",
289 "IPython.terminal.prompts",
290 "IPython.terminal.pt_inputhooks",
291 "IPython.terminal.pt_inputhooks.asyncio",
292 "IPython.terminal.pt_inputhooks.glut",
293 "IPython.terminal.pt_inputhooks.gtk",
294 "IPython.terminal.pt_inputhooks.gtk3",
295 "IPython.terminal.pt_inputhooks.gtk4",
296 "IPython.terminal.pt_inputhooks.osx",
297 "IPython.terminal.pt_inputhooks.pyglet",
298 "IPython.terminal.pt_inputhooks.qt",
299 "IPython.terminal.pt_inputhooks.tk",
300 "IPython.terminal.pt_inputhooks.wx",
301 "IPython.terminal.ptutils",
302 "IPython.terminal.shortcuts",
303 "IPython.terminal.shortcuts.auto_match",
304 "IPython.terminal.shortcuts.auto_suggest",
305 "IPython.terminal.shortcuts.filters",
306 "IPython.utils._process_cli",
307 "IPython.utils._process_emscripten",
308 "IPython.utils.capture",
309 "IPython.utils.coloransi",
310 "IPython.utils.contexts",
311 "IPython.utils.decorators",
312 "IPython.utils.dir2",
313 "IPython.utils.frame",
314 "IPython.utils.io",
315 "IPython.utils.ipstruct",
316 "IPython.utils.openpy",
317 "IPython.utils.process",
318 "IPython.utils.py3compat",
319 "IPython.utils.strdispatch",
320 "IPython.utils.sysinfo",
321 "IPython.utils.tempdir",
322 "IPython.utils.terminal",
323 "IPython.utils.timing",
324 "IPython.utils.tokenutil",
325 "IPython.utils.version",
326 "IPython.utils.wildcard",
327
328 ]
329 disallow_untyped_defs = false
330 ignore_errors = true
331 ignore_missing_imports = true
332 disallow_untyped_calls = false
333 disallow_incomplete_defs = false
334 check_untyped_defs = true
335 disallow_untyped_decorators = false
336
337 [tool.pytest.ini_options]
338 minversion = "7" # keep in sync with project.optional-dependencies.test
339 addopts = [
340 "--durations=10",
341 "-pIPython.testing.plugin.pytest_ipdoctest",
342 "--ipdoctest-modules",
343 "--ignore=docs",
344 "--ignore=examples",
345 "--ignore=htmlcov",
346 "--ignore=ipython_kernel",
347 "--ignore=ipython_parallel",
348 "--ignore=results",
349 "--ignore=tmp",
350 "--ignore=tools",
351 "--ignore=traitlets",
352 "--ignore=tests/fake_ext_dir/",
353 "--ignore=IPython/sphinxext",
354 "--ignore=IPython/terminal/pt_inputhooks",
355 "--ignore=IPython/__main__.py",
356 "--ignore=IPython/external/qt_for_kernel.py",
357 "--ignore=IPython/html/widgets/widget_link.py",
358 "--ignore=IPython/html/widgets/widget_output.py",
359 "--ignore=IPython/terminal/console.py",
360 "--ignore=IPython/utils/_process_cli.py",
361 "--ignore=IPython/utils/_process_posix.py",
362 "--ignore=IPython/utils/_process_win32_controller.py",
363 "--ignore=IPython/utils/daemonize.py",
364 "--ignore=IPython/utils/eventful.py",
365 "--ignore=IPython/kernel",
366 "--ignore=IPython/consoleapp.py",
367 "--ignore=IPython/lib/kernel.py",
368 "--ignore=IPython/utils/jsonutil.py",
369 "--ignore=IPython/utils/log.py",
370 "--ignore=IPython/utils/signatures.py",
371 "--ignore=IPython/utils/version.py"
372 ]
373 doctest_optionflags = [
374 "NORMALIZE_WHITESPACE",
375 "ELLIPSIS"
376 ]
377 ipdoctest_optionflags = [
378 "NORMALIZE_WHITESPACE",
379 "ELLIPSIS"
380 ]
381 asyncio_mode = "strict"
382
383 [tool.pyright]
384 pythonPlatform="All"
385
386 [tool.setuptools]
387 zip-safe = false
388 platforms = ["Linux", "Mac OSX", "Windows"]
389 include-package-data = false
390
391 [tool.setuptools.packages.find]
392 include = ["IPython*"]
393 exclude = ["setupext", "tests*"]
394 namespaces = false
395
396 [tool.setuptools.package-data]
397 "IPython" = ["py.typed"]
398 "IPython.core" = ["profile/README*"]
399 "IPython.testing.plugin" = ["*.txt"]
400
401 [tool.setuptools.dynamic]
402 version = {attr = "IPython.core.release.__version__"}
403
404 [tool.coverage.run]
405 omit = [
406 # omit everything in /tmp as we run tempfile
407 "/tmp/*",
408 ]
409
410 [tool.ruff.lint]
411 extend-select = [
412 # "B", # flake8-bugbear
413 # "I", # isort
414 # that will be a problem for pytest fixture unless you swap with the usefixture decorator https://docs.pytest.org/en/7.1.x/how-to/fixtures.html#use-fixtures-in-classes-and-modules-with-usefixtures
415 # "ARG", # flake8-unused-arguments
416 # "C4", # flake8-comprehensions
417 # "EM", # flake8-errmsg
418 # "ICN", # flake8-import-conventions
419 # "G", # flake8-logging-format
420 # "PGH", # pygrep-hooks
421 # "PIE", # flake8-pie
422 # "PL", # pylint
423 # "PTH", # flake8-use-pathlib
424 # "PT", # flake8-pytest-style
425 # "RET", # flake8-return
426 # "RUF", # Ruff-specific
427 # "SIM", # flake8-simplify
428 # "T20", # flake8-print
429 # "UP", # pyupgrade
430 "UP004", # 1 [*] Class `...` inherits from `object`
431 # "UP006", # 1 [*] Use `list` instead of `t.List` for type annotation
432 # "UP006", # 1 [*] Use `tuple` instead of `t.Tuple` for type annotation
433 # "UP010", # 1 [*] Unnecessary `__future__` import `print_function` for target Python version
434 "UP011", # 1 [*] Unnecessary parentheses to `functools.lru_cache`
435 "UP018", # 1 [*] Unnecessary `bool` call (rewrite as a literal)
436 # "UP006", #182 [*] Use `...` instead of `...` for type annotation
437 # "UP007", # 5 Use `X | Y` for type annotations
438 # "UP007", #149 [*] Use `X | Y` for type annotations
439 # "UP008", # 63 Use `super()` instead of `super(__class__, self)`
440 # "UP009", # 61 [*] UTF-8 encoding declaration is unnecessary
441 # "UP015", # 2 [*] Unnecessary modes, use `w`
442 # "UP015", # 4 [*] Unnecessary mode argument
443 # "UP017", # 2 [*] Use `datetime.UTC` alias
444 # "UP020", # 15 [*] Use builtin `open`
445 # "UP024", # 16 [*] Replace aliased errors with `OSError`
446 # "UP025", # 91 [*] Remove unicode literals from strings
447 "UP028", # 3 Replace `yield` over `for` loop with `yield from`
448 "UP029", # 1 Unnecessary builtin import
449 # "UP030", # 28 Use implicit references for positional format fields
450 # "UP031", #386 Use format specifiers instead of percent format
451 # "UP032", # 75 [*] Use f-string instead of `format` call
452 "UP034", # 1 [*] Avoid extraneous parentheses
453 # "UP035", # 1 [*] Import from `re` instead
454 # "UP035", # 2 [*] Import from `typing` instead
455 # "UP035", # 2 `typing.Type` is deprecated, use `type` instead
456 # "UP035", # 4 `typing.Set` is deprecated, use `set` instead
457 # "UP035", # 11 `typing.Dict` is deprecated, use `dict` instead
458 # "UP035", # 12 `typing.Tuple` is deprecated, use `tuple` instead
459 # "UP035", # 14 `typing.List` is deprecated, use `list` instead
460 # "UP035", # 18 [*] Import from `collections.abc` instead
461 # "UP036", # 3 Version block is outdated for minimum Python version
462 "UP037", # 1 [*] Remove quotes from type annotation
463 # "UP038", # 21 Use `X | Y` in `isinstance` call instead of `(X, Y)`
464 # "YTT", # flake8-2020
465 # "EXE", # flake8-executable
466 # "PYI", # flake8-pyi
467 # "S", # flake8-bandit
468 ]
469 ignore = [
470 # "E501", # E501 Line too long (158 > 100 characters)
471 # "SIM105", # SIM105 Use `contextlib.suppress(...)`
472 # "PLR", # Design related pylint codes
473 # "S101", # Use of `assert` detected
474 "E713", # 1 Test for membership should be `not in`
475 "F601", # 3 Dictionary key literal `True` repeated (`True` hashes to the same value as `1`)
476 "E702", # 3 Multiple statements on one line (semicolon)
477 "E721", # 3 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks
478 "E401", # 5 Multiple imports on one line
479 "E711", # 14 Comparison to `None` should be `cond is None`
480 "E701", # 19 Multiple statements on one line (colon)
481 "E741", # 25 Ambiguous variable name: `<one letter>`
482 "E731", # 27 Do not assign a `lambda` expression, use a `def`
483 "E402", # 28 Module level import not at top of file
484 "E722", # 75 Do not use bare `except`
485 "F523", # 1 ; at end of line
486 "F403", # 7 import *` used; unable to detect undefined names
487 "F841", # 38 Local variable `...` is assigned to but never used
488 "F401", # 69 imported but unused
489 "F821", # 624 Undefined name
490 ]
491 unfixable = [
492 # Don't touch print statements
493 "T201",
494 # Don't touch noqa lines
495 "RUF100",
496 ]
497
498 [tool.ruff]
499 extend-exclude = ["tests"]