Commit d895810
Fix the mypy errors at source instead of exempting two modules
The previous commit exempted 'dolfinx.la' and 'dolfinx.fem.petsc' from
disallow_any_unimported and warn_unused_ignores. That is a blunt
instrument: it turns off two checks for every line of two modules to
silence three specific errors. Remove it and address them where they
occur, which is what AGENTS.md asks for -- PETSc-related type checking
disabled on a per-line basis.
- 'la.to_scipy' declares a scipy return type, and scipy is untyped, so
the declaration itself trips disallow_any_unimported. Ignore that one
signature.
- The two '# type: ignore[attr-defined]' comments on the cffi lib
attributes in 'fem/petsc.py' are never used, because the attributes
are Any while cffi is untyped. Delete them.
scipy and cffi move into the existing third-party ignore_missing_imports
list, beside ufl, ffcx, gmsh and the rest, rather than sitting in a block
of their own.
Verified in a container reproducing the CI leg: 'Success' for all three
targets, 30, 27 and 84 source files.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>1 parent 09638d1 commit d895810
3 files changed
Lines changed: 9 additions & 21 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2059 | 2059 | | |
2060 | 2060 | | |
2061 | 2061 | | |
2062 | | - | |
| 2062 | + | |
2063 | 2063 | | |
2064 | 2064 | | |
2065 | 2065 | | |
2066 | 2066 | | |
2067 | | - | |
| 2067 | + | |
2068 | 2068 | | |
2069 | 2069 | | |
2070 | 2070 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
276 | 276 | | |
277 | 277 | | |
278 | 278 | | |
279 | | - | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
280 | 282 | | |
281 | 283 | | |
282 | 284 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
111 | 111 | | |
112 | 112 | | |
113 | 113 | | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | 114 | | |
133 | 115 | | |
134 | 116 | | |
| |||
195 | 177 | | |
196 | 178 | | |
197 | 179 | | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
198 | 184 | | |
199 | 185 | | |
200 | 186 | | |
| |||
0 commit comments