Distribute stdlib types as types-stdlib
Open
Nobody has claimed this yet.
project: policy
- Dominant language
- Python
- Stars
- 5.1k
- Forks
- 2.1k
- Avg merge
- 1d 19h
- Merged PRs (30d)
- 82
Description
This has been briefly discussed before, but I think it would be a good idea if we started distributing the stdlib types in a separate package types-stdlib, similar to third-party packages:
- Type checkers could optionally depend on (a specific version of) that package, instead of shipping their own copy, reducing coupling and arguably improving maintainability.
- Third-party stubs could require a minimum version of the
types-stdlibpackage, for example if they are relying on_typeshedfeatures or for cases like #5762. Type checkers that opt to distribute a copy of the stdlib, could warn if incompatible stubs are used.
Technical considerations:
- The versioning scheme would be similar to third-party stubs, e.g.
types-stdlib 3.10.X, whereXis incremented automatically. We should probably increment the version number as soon as the first beta is released and we are reasonably sure we have added all new/changed API. - The stubs would be installed into a special directory, for example
stdlib, or even a non-importable name liketypes-stdlib(so we'd have stubsstdlib/sys.pyietc.) so that they are only used by type checkers that support this package and don't interfere.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the issue discussion and prior linked context, since no files, tests, or entry points are named. Define the package layout, versioning scheme, installation behavior, and compatibility expectations before implementation; done requires agreement on the design and a complete distribution path for the stdlib stubs.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100