41
41
42
42
[dependency-groups ]
43
43
dev = [
44
- { include-group = " test" },
45
- " lefthook>=1.11.13" ,
44
+ { include-group = " lint" },
45
+ { include-group = " mypy" },
46
+ { include-group = " test_runtime" },
47
+ { include-group = " test_static" },
48
+ " lefthook==1.11.14" ,
46
49
]
47
- test = [
48
- " numpy>=1.25" ,
49
- " pytest==8.3.3" ,
50
- " pytest-cov>=6" ,
51
- " pytest-github-actions-annotate-failures>=0.3.0" ,
52
- " sybil>=8.0.0" ,
50
+ lint = [
51
+ " ruff==0.12.1" ,
53
52
]
54
53
mypy = [
55
- " mypy>=1.16.0"
54
+ " mypy==1.16.1" ,
55
+ " orjson>=3.10.18; python_version<'3.14'" , # used by mypy
56
+ ]
57
+ test_runtime = [
58
+ " pytest==8.4.1" ,
59
+ " pytest-cov>=6.2.1" ,
60
+ " pytest-github-actions-annotate-failures==0.3.0" ,
61
+ " sybil==9.1.0" ,
62
+ ]
63
+ test_static = [
64
+ { include-group = " mypy" },
65
+ " numpy>=1.25" ,
56
66
]
57
67
58
68
@@ -75,28 +85,14 @@ version_tuple = {version_tuple!r}
75
85
76
86
77
87
[tool .mypy ]
78
- files = [" src" , " tests" ]
79
- python_version = " 3.10"
80
- mypy_path = " src"
88
+ mypy_path = [" src" ]
89
+ namespace_packages = true
81
90
82
91
strict = true
83
- disallow_incomplete_defs = true
84
- disallow_untyped_defs = true
85
- disable_bytearray_promotion = true # Note(2024-12-05): these are private flags
86
- disable_memoryview_promotion = true # Note(2024-12-05): these are private flags
92
+ allow_redefinition_new = true
93
+ local_partial_types = true
87
94
enable_error_code = [" ignore-without-code" , " redundant-expr" , " truthy-bool" ]
88
-
89
- warn_return_any = true
90
95
warn_unreachable = true
91
- warn_unused_configs = true
92
-
93
- [[tool .mypy .overrides ]]
94
- module = " sybil.*"
95
- ignore_missing_imports = true
96
-
97
- [[tool .mypy .overrides ]]
98
- module = " tests.*"
99
- disallow_untyped_defs = false
100
96
101
97
102
98
[tool .pytest .ini_options ]
@@ -114,9 +110,8 @@ version_tuple = {version_tuple!r}
114
110
" ignore:ast\\ .Str is deprecated and will be removed in Python 3\\ .14:DeprecationWarning" ,
115
111
]
116
112
log_cli_level = " INFO"
117
- minversion = " 8.3"
118
- testpaths = [" README.md" , " src/" , " tests/" ]
119
- norecursedirs = [" docs/_build" ]
113
+ minversion = " 8.4"
114
+ testpaths = [" README.md" , " src/" , " tests/runtime/" ]
120
115
xfail_strict = true
121
116
122
117
@@ -138,6 +133,16 @@ version_tuple = {version_tuple!r}
138
133
" ISC001" , # Conflicts with formatter
139
134
]
140
135
136
+ [tool .ruff .lint .pylint ]
137
+ allow-dunder-method-names = [
138
+ " __array_api_version__" ,
139
+ " __array_namespace__" ,
140
+ " __array_namespace_info__" ,
141
+ " __dlpack__" ,
142
+ " __dlpack_device__" ,
143
+ " __dlpack_device__" ,
144
+ ]
145
+
141
146
[tool .ruff .lint .per-file-ignores ]
142
147
"tests/*.py" = [" ANN201" , " D1" , " S101" ]
143
148
@@ -149,7 +154,7 @@ version_tuple = {version_tuple!r}
149
154
150
155
[tool .ruff .lint .isort ]
151
156
combine-as-imports = true
152
- extra-standard-library = [" typing_extensions" ]
157
+ extra-standard-library = [" _typeshed " , " typing_extensions" ]
153
158
known-local-folder = [" array_api_typing" ]
154
159
155
160
[tool .ruff .format ]
0 commit comments