2022-02-19 08:06:25 +00:00
|
|
|
[tool.mypy]
|
2024-05-09 20:21:14 +00:00
|
|
|
python_version = "3.12"
|
2022-04-01 19:58:54 +00:00
|
|
|
mypy_path = ["src/py", "pyodide-build"]
|
|
|
|
show_error_codes = true
|
|
|
|
warn_unreachable = true
|
|
|
|
enable_error_code = ["ignore-without-code", "redundant-expr", "truthy-bool"]
|
2022-09-11 07:20:56 +00:00
|
|
|
plugins = ["pydantic.mypy"]
|
2022-04-01 19:58:54 +00:00
|
|
|
|
|
|
|
# Strict checks
|
|
|
|
warn_unused_configs = true
|
2022-02-23 22:10:53 +00:00
|
|
|
check_untyped_defs = true
|
2022-05-25 02:06:31 +00:00
|
|
|
disallow_any_generics = true
|
2022-04-01 19:58:54 +00:00
|
|
|
disallow_subclassing_any = false
|
|
|
|
disallow_untyped_calls = false
|
|
|
|
disallow_untyped_defs = false
|
2022-05-26 03:31:04 +00:00
|
|
|
disallow_incomplete_defs = true
|
2022-05-25 02:06:31 +00:00
|
|
|
disallow_untyped_decorators = true
|
2022-04-01 19:58:54 +00:00
|
|
|
no_implicit_optional = true
|
|
|
|
warn_redundant_casts = true
|
|
|
|
warn_unused_ignores = true
|
|
|
|
warn_return_any = false
|
2022-05-23 20:24:21 +00:00
|
|
|
no_implicit_reexport = true
|
|
|
|
strict_equality = true
|
2022-02-19 08:06:25 +00:00
|
|
|
|
|
|
|
[[tool.mypy.overrides]]
|
|
|
|
module = [
|
|
|
|
"_pyodide_core",
|
|
|
|
"docutils.parsers.rst",
|
|
|
|
"js",
|
2023-03-13 21:45:06 +00:00
|
|
|
"loky",
|
2022-04-01 19:58:54 +00:00
|
|
|
"matplotlib.*",
|
|
|
|
"PIL.*",
|
2023-03-13 21:45:06 +00:00
|
|
|
"pyodide_js",
|
2024-03-07 12:09:12 +00:00
|
|
|
"pyodide_js._api",
|
2023-03-13 21:45:06 +00:00
|
|
|
"pytest_pyodide",
|
2023-04-07 11:54:11 +00:00
|
|
|
"pytest_pyodide.runner",
|
|
|
|
"pytest_pyodide.utils",
|
2023-03-13 21:45:06 +00:00
|
|
|
"ruamel.yaml",
|
2022-12-02 23:12:33 +00:00
|
|
|
"termcolor",
|
|
|
|
"test",
|
2023-01-24 03:45:59 +00:00
|
|
|
"tomli",
|
2023-03-13 21:45:06 +00:00
|
|
|
"tomllib",
|
2023-01-14 13:59:42 +00:00
|
|
|
"typer",
|
2023-03-13 21:45:06 +00:00
|
|
|
"virtualenv",
|
2023-06-06 21:21:03 +00:00
|
|
|
"auditwheel_emscripten.*"
|
2022-02-19 08:06:25 +00:00
|
|
|
]
|
|
|
|
ignore_missing_imports = true
|
2022-02-20 22:13:37 +00:00
|
|
|
|
2023-06-06 21:21:03 +00:00
|
|
|
|
2023-02-06 23:35:20 +00:00
|
|
|
[tool.ruff]
|
2024-04-08 09:02:42 +00:00
|
|
|
lint.select = [
|
2023-03-13 21:45:06 +00:00
|
|
|
"B0", # bugbear (all B0* checks enabled by default)
|
|
|
|
"B904", # bugbear (Within an except clause, raise exceptions with raise ... from err)
|
|
|
|
"B905", # bugbear (zip() without an explicit strict= parameter set.)
|
|
|
|
"C9", # mccabe complexity
|
|
|
|
"E", # pycodestyles
|
|
|
|
"W", # pycodestyles
|
|
|
|
"F", # pyflakes
|
|
|
|
"I", # isort
|
|
|
|
"PGH", # pygrep-hooks
|
|
|
|
"PLC", # pylint conventions
|
|
|
|
"PLE", # pylint errors
|
|
|
|
"UP", # pyupgrade
|
2023-02-06 23:35:20 +00:00
|
|
|
]
|
2024-05-09 20:21:14 +00:00
|
|
|
lint.ignore = ["E402", "E501", "E731", "E741", "UP038"]
|
2023-03-13 21:45:06 +00:00
|
|
|
# line-length = 219 # E501: Recommended goal is 88 to match black
|
2023-02-06 23:35:20 +00:00
|
|
|
target-version = "py311"
|
|
|
|
|
2024-04-08 09:02:42 +00:00
|
|
|
[tool.ruff.lint.per-file-ignores]
|
2023-02-06 23:35:20 +00:00
|
|
|
"src/py/_pyodide/_base.py" = [
|
|
|
|
"PGH001", # No builtin `eval()` allowed
|
|
|
|
]
|
2023-03-13 21:45:06 +00:00
|
|
|
"src/tests/test_jsproxy.py" = [
|
|
|
|
"PGH001", # No builtin `eval()` allowed
|
|
|
|
]
|
2023-02-06 23:35:20 +00:00
|
|
|
"src/tests/test_typeconversions.py" = [
|
|
|
|
"PGH001", # No builtin `eval()` allowed
|
|
|
|
]
|
2023-03-28 11:28:28 +00:00
|
|
|
"tools/*" = [
|
|
|
|
"B008", # Do not perform function call `typer.Optional` in argument defaults
|
|
|
|
]
|
2023-02-06 23:35:20 +00:00
|
|
|
|
2024-04-08 09:02:42 +00:00
|
|
|
[tool.ruff.lint.flake8-bugbear]
|
2023-03-13 21:45:06 +00:00
|
|
|
extend-immutable-calls = ["typer.Argument", "typer.Option"]
|
2022-02-21 22:27:03 +00:00
|
|
|
|
2024-04-08 09:02:42 +00:00
|
|
|
[tool.ruff.lint.isort]
|
2023-02-06 23:35:20 +00:00
|
|
|
known-first-party = [
|
2022-02-21 22:27:03 +00:00
|
|
|
"pyodide",
|
|
|
|
"pyodide_js",
|
|
|
|
"micropip",
|
|
|
|
"pyodide_build",
|
|
|
|
"_pyodide",
|
2022-12-02 08:16:16 +00:00
|
|
|
"js",
|
2022-02-21 22:27:03 +00:00
|
|
|
]
|
2023-02-06 23:35:20 +00:00
|
|
|
known-third-party = [
|
2022-03-14 21:08:50 +00:00
|
|
|
"build",
|
2023-06-29 16:45:06 +00:00
|
|
|
"pyodide_lock",
|
2022-03-14 21:08:50 +00:00
|
|
|
]
|
2022-04-09 20:41:10 +00:00
|
|
|
|
2024-04-08 09:02:42 +00:00
|
|
|
[tool.ruff.lint.mccabe]
|
2023-03-13 21:45:06 +00:00
|
|
|
max-complexity = 31 # C901: Recommended goal is 10
|
2023-02-06 23:35:20 +00:00
|
|
|
|
2023-02-26 23:33:53 +00:00
|
|
|
[tool.pytest.ini_options]
|
|
|
|
norecursedirs = [
|
2023-03-13 21:45:06 +00:00
|
|
|
".artifacts",
|
2023-02-26 23:33:53 +00:00
|
|
|
"build",
|
|
|
|
"cpython",
|
|
|
|
"emsdk",
|
|
|
|
]
|
|
|
|
addopts = '''
|
|
|
|
--doctest-modules
|
|
|
|
--ignore-glob="**/dist/"
|
2024-05-09 20:21:14 +00:00
|
|
|
--ignore-glob="src/py/_pyodide/jsbind.py"
|
2023-09-19 11:33:58 +00:00
|
|
|
--ignore-glob="packages/**/extras/"
|
2023-02-26 23:33:53 +00:00
|
|
|
--tb=short
|
|
|
|
--dist-dir=dist'''
|
|
|
|
testpaths = [
|
|
|
|
"src",
|
|
|
|
"pyodide-build",
|
|
|
|
"packages",
|
|
|
|
]
|
|
|
|
asyncio_mode = "strict"
|
2023-10-14 19:13:27 +00:00
|
|
|
markers = [
|
|
|
|
"requires_dynamic_linking",
|
|
|
|
]
|
2023-02-26 23:33:53 +00:00
|
|
|
|
2024-06-05 11:12:34 +00:00
|
|
|
[tool._pyodide]
|
2024-07-16 11:44:45 +00:00
|
|
|
|
|
|
|
[tool.codespell]
|
|
|
|
ignore-words = 'tools/codespell_ignore_words.txt'
|
|
|
|
skip = 'benchmark/benchmarks/pystone_benchmarks/pystone.py,src/js/package-lock.json,tools/codespell_ignore_words.txt'
|