-
Notifications
You must be signed in to change notification settings - Fork 1.2k
/
pyproject.toml
138 lines (126 loc) · 4.82 KB
/
pyproject.toml
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
[tool.mypy]
strict = true
enable_error_code = ["ignore-without-code", "redundant-expr", "truthy-bool"]
warn_unreachable = true
# Sync with .pre-commit-config.yaml
exclude = '''
(?x)(
^build/
| ^pyximages/
| conf\.py$
| .*/setup.*\.py$
| .*/demo.py$
| .*/auto_examples/
| advanced/mathematical_optimization/examples/plot_gradient_descent\.py$
| advanced/mathematical_optimization/examples/helper/compare_optimizers\.py$
| advanced/advanced_numpy/examples/view-colors\.py$
| advanced/advanced_numpy/examples/stride-diagonals\.py$
| advanced/interfacing_with_c/cython_numpy/test_cos_doubles\.py$
| advanced/interfacing_with_c/numpy_shared/test_cos_doubles\.py$
| advanced/interfacing_with_c/swig.*\.py$
| advanced/advanced_numpy/examples/myobject_test\.py$
| advanced/interfacing_with_c/numpy_shared/test_cos_doubles\.py$
| advanced/interfacing_with_c/numpy_c_api/test_cos_module_np\.py$
| intro/numpy/solutions/2_a_call_fortran\.py$
| advanced/advanced_numpy/examples/mandelplot\.py$
| intro/numpy/solutions/2_5_markov_chain\.py$
| intro/matplotlib/examples/plot_bar\.py$
)
'''
# intro/numpy/solutions/2_5_markov_chain.py -> https://github.com/numpy/numpy/issues/27957
# intro/matplotliub/examples/plot_bar.py -> https://github.com/matplotlib/matplotlib/issues/29332
# Can make these more strict over time
allow_untyped_defs = true
allow_untyped_calls = true
[[tool.mypy.overrides]]
module = "scipy"
ignore_missing_imports = true
[[tool.mypy.overrides]]
module = "matplotlib.pyplot.*"
disable_error_code = ["arg-type"]
[[tool.mypy.overrides]]
module = "mpl_toolkits.mplot3d.*"
ignore_missing_imports = true
[[tool.mypy.overrides]]
module = "sklearn.*"
ignore_missing_imports = true
[[tool.mypy.overrides]]
module = "seaborn.*"
ignore_missing_imports = true
[[tool.mypy.overrides]]
module = "statsmodels.*"
ignore_missing_imports = true
[[tool.mypy.overrides]]
module = "pyamg.*"
ignore_missing_imports = true
[tool.pytest.ini_options]
minversion = "8.2"
doctest_optionflags = "NUMBER NORMALIZE_WHITESPACE ELLIPSIS"
xfail_strict = true
filterwarnings = [
"error",
"ignore:FigureCanvasAgg is non-interactive:UserWarning",
"ignore:datetime.datetime.utcfromtimestamp:DeprecationWarning",
"ignore:'scipy.sparse.linalg.cg' keyword argument:DeprecationWarning",
]
addopts = [
"-ra", "--showlocals", "--strict-markers", "--strict-config",
"--ignore=advanced/advanced_numpy/examples/myobject_test.py",
"--ignore=advanced/interfacing_with_c/ctypes_numpy/test_cos_doubles.py",
"--ignore=advanced/interfacing_with_c/cython_numpy/test_cos_doubles.py",
"--ignore=advanced/interfacing_with_c/numpy_c_api/test_cos_module_np.py",
"--ignore=advanced/interfacing_with_c/numpy_shared/test_cos_doubles.py",
"--ignore=advanced/interfacing_with_c/swig_numpy/test_cos_doubles.py",
"--ignore=intro/scipy/examples/plot_t_test.py",
]
log_cli_level = "info"
[tool.ruff]
target-version = "py311"
[tool.ruff.lint]
select = [
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"E", # pycodestyle-error
"EM", # flake8-errmsg
"EXE", # flake8-executable
"FURB", # refurb
"NPY", # NumPy specific rules
"PD", # pandas-vet
"PGH", # pygrep-hooks
"PIE", # flake8-pie
"PL", # pylint
# "PTH", # flake8-use-pathlib
"PYI", # flake8-pyi
# "RET", # flake8-return
"RUF", # ruff-specific
"SIM", # flake8-simplify
"SIM2", # simplify boolean comparisons
"UP", # pyupgrade
"YTT" # flake8-2020
]
ignore = [
"B006", # Do not use mutable data structures for argument defaults
"B007", # Loop control variable {name} not used within loop body
"B018", # Found useless expression. Either assign it to a variable or remove it.
"B905", # Zip without explicit `strict` keyword
"E402", # Module level import not at top of file
"E501", # Line too long
"E741", # Ambiguous variable name
"E721", # Do not compare types, use `isinstance()`
"E731", # Do not assign a `lambda` expression, use a `def`
"EM101", # Exception must not use a string literal, assign to variable first
"EM102", # Exception must not use an f-string literal, assign to variable first
"ISC001", # Conflicts with formatter
"NPY002", # Replace legacy np.random.{method_name} call with np.random.Generator
"PD002", # inplace=True should be avoided; it has inconsistent behavior
"PLR", # pylint-refactor
"PLR09", # Too many <...>
"PLR2004", # Magic value used in comparison
"PLW0127", # Self-assignment of variable {name}
"PLW2901", # Outer {outer_kind} variable {name} overwritten by inner {inner_kind} target
"RUF005", # Consider {expression} instead of concatenation
"RUF015", # Prefer next({iterable}) over single element slice
"SIM115" # Use context handler for opening files
]
[tool.ruff.format]
docstring-code-format = true