-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
109 lines (99 loc) · 3.33 KB
/
pyproject.toml
File metadata and controls
109 lines (99 loc) · 3.33 KB
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
# DataLab-Web is a JavaScript/TypeScript project (see ``package.json``).
# This ``pyproject.toml`` only carries Python tooling configuration for the
# automated test suite that exercises the in-browser Python layer
# (``src/runtime/*.py``) headlessly under CPython.
#
# Python 3.11+ is required: ``src/runtime/processor.py`` relies on
# ``isinstance(list[SignalObj], type)`` returning ``False``, which is broken
# under CPython 3.9 and 3.10 (both report ``True``) and was fixed in 3.11.
[project]
name = "datalab-web-tests"
version = "0.0.0"
description = "Test-only Python configuration for DataLab-Web"
requires-python = ">=3.11"
[tool.pytest.ini_options]
minversion = "7.0"
testpaths = ["tests/python"]
python_files = ["test_*.py"]
python_classes = ["Test*"]
python_functions = ["test_*"]
addopts = [
"-ra",
"--strict-markers",
"--tb=short",
]
filterwarnings = [
"ignore::DeprecationWarning:sigima.*",
"ignore::DeprecationWarning:guidata.*",
]
markers = [
"slow: marks tests as slow (deselect with -m 'not slow')",
]
[tool.coverage.run]
branch = true
source = ["src/runtime"]
omit = [
# Pyodide-only glue is not exercised under CPython.
"*/macro_proxy.py",
"*/_guidata_backends_shim.py",
"*/_guidata_jsonschema_shim.py",
]
[tool.coverage.report]
show_missing = true
skip_covered = false
exclude_lines = [
"pragma: no cover",
"raise NotImplementedError",
"if TYPE_CHECKING:",
"if __name__ == .__main__.:",
]
[tool.coverage.html]
directory = "htmlcov-python"
[tool.coverage.xml]
output = "coverage-python.xml"
[tool.ruff.lint.per-file-ignores]
# Macro templates are evaluated inside Pyodide with a pre-injected ``proxy``
# global and are wrapped in an async function by the macro runner before
# execution. Both the ``proxy`` reference and top-level ``await`` are
# intentional and not actionable on a per-file basis.
"src/macros/templates/*.py" = ["F704", "F821"]
[tool.pylint.MASTER]
# ``__init__.py`` does not exist (the modules live under ``src/runtime`` and
# are pushed into Pyodide individually); list the files explicitly so the
# rare scenarios where users invoke ``pylint src/runtime`` still work.
ignore-paths = ["src/runtime/dlplugins", "src/runtime/builtin_plugins"]
[tool.pylint."MESSAGES CONTROL"]
# Project-wide disables — each is justified by a recurring DataLab-Web
# pattern that is intentional and not actionable on a per-call basis.
disable = [
# Stylistic complexity rules — DataLab desktop disables the same set;
# the in-browser bridge inherits the long Sigima-style entry points.
"duplicate-code",
"fixme",
"too-many-arguments",
"too-many-branches",
"too-many-instance-attributes",
"too-many-lines",
"too-many-locals",
"too-many-public-methods",
"too-many-statements",
"too-many-positional-arguments",
]
[tool.pylint.TYPECHECK]
# ``js`` and ``pyodide.ffi`` only resolve inside Pyodide; ``datalab`` and
# ``datalab.plugins`` resolve only when the user-shipped ``datalab`` shim
# package is mounted under ``/home/pyodide``. ``dlw_*`` are sibling
# modules pushed into Pyodide's filesystem alongside ``bootstrap.py``.
# Tell pylint they are real.
ignored-modules = [
"js",
"pyodide",
"pyodide.ffi",
"datalab",
"datalab.plugins",
"datalab.registries",
"datalab.errors",
"dlw_processor",
"dlw_interactive_fit",
"dlw_h5browser",
]