tenseleyflow/documentlanguagemodel / c18f898

Browse files

Fix CI import typing and test collision

Authored by mfwolffe <wolffemf@dukes.jmu.edu>
SHA
c18f8982a9eb2c78075b511c3364bbb246f743ea
Parents
dd160a6
Tree
9d49e26

4 changed files

StatusFile+-
M pyproject.toml 15 0
M src/dlm/data/audio_resample.py 2 2
M src/dlm/inference/backends/mlx_backend.py 1 1
R tests/unit/modality/test_registry.pytests/unit/modality/test_modality_registry.py 0 0
pyproject.tomlmodified
@@ -198,6 +198,21 @@ ignore_missing_imports = true
198198
 # actual return types aren't reflected in stubs.
199199
 disable_error_code = ["no-untyped-call"]
200200
 
201
+# Optional runtime deps used behind feature gates may be absent or
202
+# ship without type metadata on some CI runners. Keep those imports
203
+# narrow and local in code, and suppress missing-stub noise here
204
+# instead of scattering environment-specific inline ignores.
205
+[[tool.mypy.overrides]]
206
+module = [
207
+    "soxr",
208
+    "scipy",
209
+    "scipy.*",
210
+    "mlx_lm",
211
+    "mlx_lm.*",
212
+]
213
+ignore_missing_imports = true
214
+disable_error_code = ["no-untyped-call"]
215
+
201216
 # -------- pytest --------
202217
 [tool.pytest.ini_options]
203218
 testpaths = ["tests"]
src/dlm/data/audio_resample.pymodified
@@ -70,14 +70,14 @@ def _pick_backend() -> _Backend:
7070
     backend-pick time keeps the failure near the user's config.
7171
     """
7272
     try:
73
-        import soxr  # type: ignore[import-not-found]  # noqa: F401
73
+        import soxr  # noqa: F401
7474
     except ImportError:
7575
         pass
7676
     else:
7777
         return _soxr_resample
7878
 
7979
     try:
80
-        import scipy.signal  # type: ignore[import-untyped]  # noqa: F401
80
+        import scipy.signal  # noqa: F401
8181
     except ImportError:
8282
         pass
8383
     else:
src/dlm/inference/backends/mlx_backend.pymodified
@@ -164,7 +164,7 @@ class MlxBackend(InferenceBackend):
164164
         *,
165165
         adapter_name: str | None = None,
166166
     ) -> None:
167
-        from mlx_lm import load  # type: ignore[import-not-found, unused-ignore]
167
+        from mlx_lm import load
168168
 
169169
         from dlm.inference.loader import resolve_adapter_path
170170
 
tests/unit/modality/test_registry.py → tests/unit/modality/test_modality_registry.pyrenamed (100% similarity)