ci: unbreak the lint jobs (mypy python_version, dead doc links) - #848
Merged
Conversation
Both legs of the `Lint` workflow have been red on `main` since 2026-07-27, for reasons
unrelated to any change:
* **`Lint code`** - the `mypy` hook dies inside numpy's own stubs:
numpy/__init__.pyi:737:45: error: Type statement is only supported in Python 3.12 and greater
numpy's stubs now use PEP 695 syntax, while `[tool.mypy]` pins `python_version = "3.10"`,
so mypy aborts before checking any moscot code. Bump it to `3.12` (the project requires
`>=3.11`, and no supported interpreter is affected by checking under 3.12 semantics) and
drop `plugins = "numpy.typing.mypy_plugin"`, which numpy deprecated in 2.3 and will remove.
With mypy running again, five `type: ignore` comments turn out to be unnecessary
(`warn_unused_ignores` is on); they are removed. `mypy src` is then clean.
* **`Lint docs`** - `make linkcheck` fails on two external links that moved, both from a
tutorial in the `docs/notebooks` submodule, so they cannot be fixed from this repo. They
join the existing `linkcheck_ignore` list.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #848 +/- ##
=======================================
Coverage 76.62% 76.62%
=======================================
Files 36 36
Lines 4175 4175
Branches 670 670
=======================================
Hits 3199 3199
Misses 679 679
Partials 297 297
🚀 New features to boost your workflow:
|
`_load_dataset_from_url` forwards `**kwargs` to `anndata.read_h5ad`, but nine dataset docstrings advertised :func:`scanpy.read`, which scanpy no longer documents - so every one of them raised `py:func reference target not found`, and `lint-docs` builds with `-W`. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Collaborator
Author
|
@selmanozleyen, merging this, it's just linting stuff. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Both legs of the
Lintworkflow have been failing onmainsince 2026-07-27, at the same SHA and for reasons unrelated to any code change — the last green run was 2026-07-06. Neither failure is caused by moscot code. TheTestworkflow is separately red on 3.12 (see below).Lint codeThe
mypyhook aborts inside numpy's own stubs:numpy's stubs now use PEP 695 (
type X = …), which needspython_version >= 3.12, while[tool.mypy]still pinspython_version = "3.10". mypy therefore never reaches any moscot source — it has effectively not type-checked the project for a month.python_version = "3.12". The project requires>=3.11, so this only means checking under 3.12 semantics; no supported interpreter is dropped.plugins = "numpy.typing.mypy_plugin", deprecated in NumPy 2.3 and slated for removal.With mypy actually running again, five
type: ignorecomments are reported as unnecessary (warn_unused_ignores = true) — three in__init__.py, one inbase/cost.py(only thetype-varcode was stale,arg-typeis kept), one inproblems/time/_mixins.py. They are removed, after checkingmoscot.__version__/__author__still resolve.mypy srcis then clean: no issues found in 50 source files.The hook's environment installs only
numpy(additional_dependencies: [numpy>=1.25.0]), so this is exactly what CI checks. Running mypy in a fully populated environment surfaces ~140 further errors from third-party stubs; that is a separate discussion and this PR does not touch it.Lint docslint-docsbuilds withSPHINXOPTS = -W -q --keep-going, so anything that warns fails it. Two causes:make linkcheckreported two upstream 404s —muon.atac.tl.lsiand an openproblems dataset page — both from600_tutorial_translation.ipynb, which lives in thedocs/notebookssubmodule and so cannot be fixed here. They join the existinglinkcheck_ignorelist, in its established commented style.py:func reference target not found: scanpy.read. These come from dataset docstrings saying "Keyword arguments for :func:scanpy.read" — but_load_dataset_from_urlforwards**kwargstoanndata.read_h5ad(ormudata.read_h5mu), never toscanpy.read, which scanpy also no longer documents. Retargeted to :func:~anndata.io.read_h5ad, which fixes a factual error in the docs as well as the build. (pancreas_multiomealready documented the right functions and is untouched.)After this, the job has no broken links and no warnings left to trip
-W.Not fixed here
The
Testworkflow fails on ubuntu-3.12 and macOS-3.12 with 27 failures (3.11 passes) intest_annotation_mappingandtest_set_graph_xy. Those are pre-existing and orthogonal to lint: this PR touches only mypy config,linkcheck_ignoreand docstrings, and reproduces the identical 27 failures. I also reproduced them locally with and without an unrelated source change and got identical counts. Worth its own issue.Verification
mypy srcunder the hook's exact dependency set (mypy 1.15.0 + numpy only): clean.black,isort,ruff,rstcheck,doc8and the remaining hooks: pass (prettierneeds Node, which I don't have locally — untouched by this diff).pytest tests/solvers tests/utils: 56 passed.anndata.io.read_h5adconfirmed present in anndata's intersphinx inventory.Split out of #846, which is blocked on the same red lint.
🤖 Generated with Claude Code