Skip to content

CI: Run ty on NumPy's type stubs#31956

Open
jelle-openai wants to merge 2 commits into
numpy:mainfrom
jelle-openai:jelle/codex/add-ty-stub-ci
Open

CI: Run ty on NumPy's type stubs#31956
jelle-openai wants to merge 2 commits into
numpy:mainfrom
jelle-openai:jelle/codex/add-ty-stub-ci

Conversation

@jelle-openai

Copy link
Copy Markdown
Contributor

PR summary

Add a Python 3.14 ty job covering the production stubs and pin ty alongside the other typing tools. To get ty to pass, I disabled the invalid-method-override rule (it had >200 hits I think, not really fixable) and mostly # ty: ignored the rest. Most issues found by ty were the same as ones already flagged by mypy and pyright. There are also a lot of subclass-of-final-class; perhaps it makes sense to disable that rule globally too?

AI Disclosure

The PR was fully written by Codex.

Add a Python 3.14 ty job covering the production stubs and pin ty alongside the other typing tools. Keep invalid-type-form enabled so shadowed dtype annotations are caught, while disabling runtime-incompatible override checks and narrowly suppressing the remaining intentional typing helpers.
Comment thread numpy/_typing/_ufunc.pyi
Comment thread numpy/__init__.pyi Outdated
Comment thread pyproject.toml Outdated
Comment thread pyproject.toml Outdated
Comment thread pyproject.toml Outdated
Address review feedback by relying on NumPy's minimum supported Python version, simplifying stub discovery, and disabling subclass-of-final-class globally instead of repeating inline suppressions.
@jorenham jorenham self-requested a review July 10, 2026 21:19
@jorenham jorenham added the triage review Issue/PR to be discussed at the next triage meeting label Jul 12, 2026
@jorenham

Copy link
Copy Markdown
Member

This is probably worth discussing a bit before merging, so I've added the "triage review" label. Would you be willing to come to a NumPy community meeting or triage meeting to @jelle-openai? See https://scientific-python.org/calendars/ for the data.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

41 - Static typing component: CI triage review Issue/PR to be discussed at the next triage meeting

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants