Skip to content

Refactor/unify stub discovery#16021

Draft
srittau wants to merge 5 commits into
python:mainfrom
srittau:refactor-stub-discovery
Draft

Refactor/unify stub discovery#16021
srittau wants to merge 5 commits into
python:mainfrom
srittau:refactor-stub-discovery

Conversation

@srittau

@srittau srittau commented Jul 16, 2026

Copy link
Copy Markdown
Collaborator
  • Add a StubFile class with sub-classes StdlibStubFile and ThirdPartyStubFile to describe stubs files.
  • Add a stdlib_stubs function to collect the stdlib stub files for a specific Python version.
  • Add a third_party_stubs function to collect all third-party stub files or the stub files of a specific distribution.
  • Add path_stubs to collect all stub files in a certain path.
  • Use the new function in mypy_test.py, ty_test.py, and stubsabot.py.

Depends on #16020

srittau added 3 commits July 16, 2026 13:06
`parse_stdlib_versions_file` now returns a class with methods
`supported_versions_for_module` and `is_supported`, obsoleting
stand-alone function `supported_versions_for_module`.
* Add a `StubFile` class with sub-classes `StdlibStubFile` and
  `ThirdPartyStubFile` to describe stubs files.
* Add a `stdlib_stubs` function to collect the stdlib stub files for a
  specific Python version.
* Add a `third_party_stubs` function to collect all third-party stub
  files or the stub files of a specific distribution.
* Add `path_stubs` to collect all stub files in a certain path.
* `parse_stdlib_versions_file` now returns a class with methods
  `supported_versions_for_module` and `is_supported`, obsoleting
  stand-alone function `supported_versions_for_module`.
* Use the new function in `mypy_test.py`, `ty_test.py`, and
  `stubsabot.py`.
@srittau srittau changed the title Refactor stub discovery Refactor/unify stub discovery Jul 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant