Skip to content

Commit 07363bd

Browse files
committed
Fix recent mypy linter errors
1 parent a9e8d32 commit 07363bd

File tree

3 files changed

+4
-12
lines changed

3 files changed

+4
-12
lines changed

pyproject.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,6 @@ show_missing = true
186186

187187
[tool.mypy]
188188
strict = true
189-
plugins = ["numpy.typing.mypy_plugin"]
190189
enable_error_code = ["ignore-without-code", "redundant-expr", "truthy-bool"]
191190
warn_return_any = true
192191
warn_unused_configs = true

src/charonload/_finder.py

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,6 @@ def _load(module_name: str, config: ResolvedConfig) -> None:
123123

124124

125125
class _JITCompileStep(ABC):
126-
exception_cls = type(None)
127126
step_name = "<None>"
128127

129128
def __init__(self: Self, module_name: str, config: ResolvedConfig, step_number: tuple[int, int]) -> None:
@@ -150,7 +149,6 @@ def _run_impl(self: Self) -> None:
150149

151150

152151
class _CleanStep(_JITCompileStep):
153-
exception_cls = type(None)
154152
step_name = "Clean"
155153

156154
def __init__(self: Self, module_name: str, config: ResolvedConfig, step_number: tuple[int, int]) -> None:
@@ -236,7 +234,6 @@ def _torch_version_changed(self: Self) -> bool:
236234

237235

238236
class _InitializeStep(_JITCompileStep):
239-
exception_cls = type(None)
240237
step_name = "Initialize"
241238

242239
def __init__(self: Self, module_name: str, config: ResolvedConfig, step_number: tuple[int, int]) -> None:
@@ -255,7 +252,6 @@ def _run_impl(self: Self) -> None:
255252

256253

257254
class _CMakeConfigureStep(_JITCompileStep):
258-
exception_cls = CMakeConfigureError
259255
step_name = "CMake Configure"
260256

261257
def __init__(self: Self, module_name: str, config: ResolvedConfig, step_number: tuple[int, int]) -> None:
@@ -301,7 +297,7 @@ def _run_impl(self: Self) -> None:
301297
self.cache["cmake_configure_command"] = configure_command
302298
self.cache["status_cmake_configure"] = status
303299
if status == _StepStatus.FAILED:
304-
raise self.exception_cls(log)
300+
raise CMakeConfigureError(log)
305301

306302
def _cmake_generator(self: Self) -> list[str]:
307303
return ["-G", "Ninja Multi-Config"] if platform.system() != "Windows" else []
@@ -314,7 +310,6 @@ def _cmake_project_top_level_includes(self: Self) -> str:
314310

315311

316312
class _BuildStep(_JITCompileStep):
317-
exception_cls = BuildError
318313
step_name = "Build"
319314

320315
def __init__(self: Self, module_name: str, config: ResolvedConfig, step_number: tuple[int, int]) -> None:
@@ -351,11 +346,10 @@ def _run_impl(self: Self) -> None:
351346

352347
self.cache["status_build"] = status
353348
if status == _StepStatus.FAILED:
354-
raise self.exception_cls(log)
349+
raise BuildError(log)
355350

356351

357352
class _StubGenerationStep(_JITCompileStep):
358-
exception_cls = StubGenerationError
359353
step_name = "Stub Generation"
360354

361355
def __init__(self: Self, module_name: str, config: ResolvedConfig, step_number: tuple[int, int]) -> None:
@@ -417,7 +411,7 @@ def _run_impl(self: Self) -> None:
417411
self.cache["checksum"] = new_checksum
418412
self.cache["status_stub_generation"] = status
419413
if status == _StepStatus.FAILED:
420-
raise self.exception_cls(log)
414+
raise StubGenerationError(log)
421415

422416
def _windows_dll_directories(self: Self) -> list[str]:
423417
windows_dll_directories: str = self.cache["windows_dll_directories"]
@@ -433,7 +427,6 @@ def _compute_checksum(self: Self, full_extension_path: pathlib.Path) -> str:
433427

434428

435429
class _ImportPathStep(_JITCompileStep):
436-
exception_cls = type(None)
437430
step_name = "Import Path"
438431

439432
def __init__(self: Self, module_name: str, config: ResolvedConfig, step_number: tuple[int, int]) -> None:

src/charonload/pybind11_stubgen/__main__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def main() -> None:
4646
# Patch list of command line argument globally as this list cannot directly be passed to pybind11-stubgen
4747
sys.argv = [sys.argv[0], *original_args]
4848

49-
pybind11_stubgen.main() # type: ignore[no-untyped-call]
49+
pybind11_stubgen.main()
5050

5151

5252
if __name__ == "__main__": # pragma: no cover

0 commit comments

Comments
 (0)