pyodide/pyproject.toml

126 lines
2.7 KiB
TOML
Raw Normal View History

2022-02-19 08:06:25 +00:00
[tool.mypy]
python_version = "3.11"
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"]
plugins = ["pydantic.mypy"]
2022-04-01 19:58:54 +00:00
# Strict checks
warn_unused_configs = true
check_untyped_defs = true
disallow_any_generics = true
2022-04-01 19:58:54 +00:00
disallow_subclassing_any = false
disallow_untyped_calls = false
disallow_untyped_defs = false
disallow_incomplete_defs = true
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
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",
"loky",
2022-04-01 19:58:54 +00:00
"matplotlib.*",
"PIL.*",
"pyodide_js",
"pytest_pyodide",
"pytest_pyodide.runner",
"pytest_pyodide.utils",
"ruamel.yaml",
"termcolor",
"test",
2023-01-24 03:45:59 +00:00
"tomli",
"tomllib",
"typer",
"virtualenv",
"auditwheel_emscripten.*"
2022-02-19 08:06:25 +00:00
]
ignore_missing_imports = true
2022-02-20 22:13:37 +00:00
[tool.ruff]
select = [
"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
]
ignore = ["E402", "E501", "E731", "E741"]
# line-length = 219 # E501: Recommended goal is 88 to match black
target-version = "py311"
[tool.ruff.per-file-ignores]
"src/py/_pyodide/_base.py" = [
"PGH001", # No builtin `eval()` allowed
]
"src/tests/test_jsproxy.py" = [
"PGH001", # No builtin `eval()` allowed
]
"src/tests/test_typeconversions.py" = [
"PGH001", # No builtin `eval()` allowed
]
"tools/*" = [
"B008", # Do not perform function call `typer.Optional` in argument defaults
]
[tool.ruff.flake8-bugbear]
extend-immutable-calls = ["typer.Argument", "typer.Option"]
2022-02-21 22:27:03 +00:00
[tool.ruff.isort]
known-first-party = [
2022-02-21 22:27:03 +00:00
"pyodide",
"pyodide_js",
"micropip",
"pyodide_build",
"_pyodide",
"js",
2022-02-21 22:27:03 +00:00
]
known-third-party = [
"build",
"pyodide_lock",
]
[tool.ruff.mccabe]
max-complexity = 31 # C901: Recommended goal is 10
[tool.pytest.ini_options]
norecursedirs = [
".artifacts",
"build",
"cpython",
"emsdk",
]
addopts = '''
--doctest-modules
--ignore-glob="**/dist/"
--ignore-glob="packages/**/extras/"
--tb=short
--dist-dir=dist'''
testpaths = [
"src",
"pyodide-build",
"packages",
]
asyncio_mode = "strict"
markers = [
"requires_dynamic_linking",
]
[tool.pyodide]