forked from sympy/sympy
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
184 lines (166 loc) · 4.44 KB
/
pyproject.toml
File metadata and controls
184 lines (166 loc) · 4.44 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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
[tool.pytest.ini_options]
# Don't run the tests marked as slow by default.
addopts = "-m 'not slow and not tooslow'"
filterwarnings = [
'ignore:More than 20 figures have been opened.*:RuntimeWarning',
'ignore:FigureCanvasAgg is non-interactive, and thus cannot be shown:UserWarning',
]
# Only run tests under the sympy/ directory. Otherwise pytest will attempt to
# collect tests from e.g. the bin/ directory as well.
testpaths = [
"sympy",
"doc/src",
]
# Normalise output of doctests.
doctest_optionflags = [
"NORMALIZE_WHITESPACE",
"IGNORE_EXCEPTION_DETAIL",
"ELLIPSIS",
"FLOAT_CMP",
]
norecursedirs = [
"sympy/parsing/autolev/test-examples",
]
markers = [
"nocache_fail",
"tooslow",
]
[tool.coverage.report]
exclude_lines = [
"pragma: no cover",
"if TYPE_CHECKING:",
"assert False",
]
[tool.ruff]
# Enable Pyflakes `E` and `F` codes by default.
lint.select = [
"B015", # Useless comparison: a == b rather than a = b.
"C4",
"E",
"F",
"FURB",
"LOG",
"PIE810",
"PLE",
"PLR1736",
"PLW0602", # Global statement used but no assignment
"SIM101",
"SLOT",
"TC001",
"TC002",
"TC003",
"TC004",
"TC005",
"TRY002",
"BLE001", # except Exception or except BaseException
]
# Ignore rules that currently fail on the SymPy codebase
lint.ignore = [
"E401", # Multiple imports on one line
"E402", # Module level import not at top of file
"E501", # Line too long (<LENGTH> > 88 characters)
"E701", # Multiple statements on one line (colon)
"E702", # Multiple statements on one line (semicolon)
"E712", # Comparison to `<BOOL>` should be `cond is <BOOL>`
"E713", # Test for membership should be `not in`
"E714", # Test for object identity should be `is not`
"E721", # Do not compare types, use `isinstance()`
"E731", # Do not assign a `lambda` expression, use a `def`
"E741", # Ambiguous variable name: `<VARIABLE>`
"E743", # Ambiguous function name: `<FUNCTION>`
"FURB110", # Replace ternary `if` expression with `or` operator
"FURB187", # Use of assignment of `reversed` on list `{name}`
]
# Exclude paths currently excluded in the flake8 configuration
exclude = [
"sympy/assumptions/*generated.py",
"sympy/core/*_generated.py",
"sympy/core/benchmarks/",
"sympy/parsing/latex/_antlr/*",
"sympy/parsing/autolev/_antlr/*",
"sympy/parsing/autolev/test-examples/*",
"sympy/plotting/pygletplot/*",
"sympy/parsing/latex/_parse_latex_antlr.py",
"sympy/parsing/autolev/_listener_autolev_antlr.py",
"sympy/integrals/rubi/*",
]
# Black default, although irrelevant with E501 ignored
line-length = 88
# Allow unused variables when underscore-prefixed.
lint.dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
# Per-file ignores currently specified in the flake8 configuration
[tool.ruff.lint.per-file-ignores]
"sympy/interactive/session.py" = ["F821"]
# Global mypy settings:
[tool.mypy]
warn_unused_configs = true
exclude = [
"sympy/parsing/autolev/test-examples",
]
# Per module settings:
[[tool.mypy.overrides]]
module = [
"sympy.parsing.latex._antlr.*",
"sympy.parsing.autolev._antlr.*",
"sympy.benchmarks.*",
"sympy.plotting.pygletplot.*",
]
ignore_errors = true
# Third-party untyped code:
[[tool.mypy.overrides]]
module = [
"antlr4.*",
"Cython.*",
"flint.*",
"gmpy.*",
"gmpy2.*",
"IPython.*",
"lxml.*",
"matchpy.*",
"matplotlib.*",
"mpmath.*",
"numpy.*",
"PIL.*",
"pycosat.*",
"pyglet.*",
"pymc.*",
"pymc3.*",
"python-sat.*",
"pytest.*",
"_pytest.*",
"sage.*",
"scipy.*",
"symengine.*",
"aesara.*",
"xml.*",
"pydy.*",
"theano.*",
"multiset.*",
"pysat.*",
"bpython.*"
]
ignore_missing_imports = true
# pyright type checker settings:
[tool.pyright]
include = ["sympy"]
exclude = [
"sympy/matrices/common.py",
"sympy/matrices/matrices.py",
"sympy/matrices/tests/test_matrices.py",
"sympy/matrices/tests/test_commonmatrix.py",
"sympy/matrices/benchmarks",
]
# This complains when self or cls is not used as the parameter name for an
# instance method or class method. Since this is used a lot in SymPy we disable
# this check.
reportSelfClsParameterName = false
[tool.slotscheck]
strict-imports = true
exclude-modules = '''
(
sympy.parsing.latex._antlr
|sympy.parsing.autolev._antlr
|sympy.galgebra
|sympy.plotting.pygletplot
)
'''