Repository navigation
Expand file tree
/
Copy pathpyproject.toml
More file actions
111 lines (97 loc) · 3.73 KB
/
Copy pathpyproject.toml
File metadata and controls
111 lines (97 loc) · 3.73 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
110
111
# Development environment for the monorepo (not a package itself).
# `poetry install` here creates one venv with every package installed in
# develop mode plus the lint/type/test tooling.
[project]
name = "lambdafeedback-packages"
requires-python = ">=3.12,<4.0" # <4.0: lf-toolkit (dev only) requires it
[tool.poetry]
package-mode = false
[tool.poetry.group.dev.dependencies]
lambdafeedback-slr-parsing = { path = "slr_parsing", develop = true }
lambdafeedback-criteria = { path = "criteria", develop = true }
lambdafeedback-expression-parsing = { path = "expression_parsing", develop = true }
lambdafeedback-units = { path = "units", develop = true }
# Dev-only: tests check the criteria feedback helpers against the real
# lf_toolkit Result. Not a runtime dependency until lf_toolkit stops shipping
# its dev tools as runtime requirements (docs/upstream-lf-toolkit.md).
lf-toolkit = { git = "https://github.com/lambda-feedback/toolkit-python.git", rev = "ae52fa6f23c585f2595e6f32dc56ac8984c8fc50" }
pytest = "^9.1"
pytest-cov = "^7.0"
ruff = "^0.16"
mypy = "^2.3"
[tool.pytest.ini_options]
filterwarnings = [
"error::SyntaxWarning",
# Our own deprecations are errors; third-party ones (e.g. antlr's typing.io) are not.
"error::DeprecationWarning:lambdafeedback",
]
[tool.ruff]
target-version = "py312"
line-length = 120
[tool.ruff.lint]
select = ["E", "F", "W", "I", "UP", "B", "SIM", "RUF", "N", "TID"]
# Ambiguous-unicode checks: parsing Greek letters, Unicode dashes and unit
# symbols (Ω, µ, Å) is the point of this code.
# UP040: keep `X: TypeAlias = ...`. A PEP 695 `type X = ...` is a lazy TypeAliasType, so
# isinstance() against the public alias unions (e.g. TokenSpec) and get_args() would stop working.
ignore = ["RUF001", "RUF002", "RUF003", "UP040"]
[tool.ruff.lint.flake8-tidy-imports.banned-api]
"re".msg = "Use str methods or a small scanner instead of regular expressions."
[tool.ruff.lint.per-file-ignores]
# Test cases and names carried over verbatim from compareExpressions.
# Tests may use re.escape for pytest.raises(match=...).
"*/tests/*" = ["E501", "N802", "TID251"]
[tool.ruff.lint.isort]
known-first-party = ["lambdafeedback"]
[tool.mypy]
python_version = "3.12"
files = ["scripts/check_dist.py", "scripts/release_version.py", "tools/parity/corpus.py", "tools/parity/check.py", "slr_parsing/src", "criteria/src", "expression_parsing/src", "units/src"]
namespace_packages = true
explicit_package_bases = true
mypy_path = [
"tools/parity",
"slr_parsing/src",
"criteria/src",
"expression_parsing/src",
"units/src",
]
warn_unused_configs = true
warn_redundant_casts = true
warn_unused_ignores = true
# Strict checking, spelled out: `strict` itself is global-only.
[[tool.mypy.overrides]]
module = [
"lambdafeedback.slr_parsing",
"lambdafeedback.slr_parsing.*",
"lambdafeedback.criteria",
"lambdafeedback.criteria.*",
"lambdafeedback.units",
"lambdafeedback.units.*",
]
disallow_untyped_defs = true
disallow_incomplete_defs = true
disallow_untyped_calls = true
disallow_untyped_decorators = true
disallow_any_generics = true
disallow_subclassing_any = true
check_untyped_defs = true
warn_return_any = true
no_implicit_reexport = true
strict_equality = true
extra_checks = true
# SymPy's own annotations are too loose for the strict flags; require typed
# definitions and check their bodies.
[[tool.mypy.overrides]]
module = [
"lambdafeedback.expression_parsing",
"lambdafeedback.expression_parsing.*",
]
disallow_untyped_defs = true
disallow_incomplete_defs = true
check_untyped_defs = true
no_implicit_reexport = true
strict_equality = true
# Neither ships type information.
[[tool.mypy.overrides]]
module = ["latex2sympy2_extended", "latex2sympy2_extended.*", "sympy", "sympy.*"]
ignore_missing_imports = true