Skip to content

micropython-stdlib/VERSIONS #818

@Josverl

Description

@Josverl

The VERSIONS file in the stdlib-stubs may need to be adjusted as it refers to modules that are not available.

The VERSIONS file in stdlib is used by type checkers like mypy and pyright (and more generally, by tools that consume typeshed stubs) to determine:

  • Which standard library modules and submodules are available in which Python versions.
  • When a module was introduced and, if applicable, when it was removed or deprecated.

How it is used

  • Stub selection:
    When you run a type checker targeting a specific Python version, it consults the VERSIONS file to know which stubs to include. For example, if you target Python 3.7, only modules listed as available in 3.7 will be considered.
  • Error reporting:
    If your code imports a module that is not available in your configured Python version (according to VERSIONS), the type checker can report an error or warning.
  • Stub generation and packaging:
    Tools that build or distribute stubs use this file to package only the relevant stubs for each Python version.

Example

If you run mypy with --python-version 3.7 and try to import zoneinfo, mypy will check zoneinfo: 3.9- and report that zoneinfo is not available in Python 3.7.

References

The file is not read directly by mypy or pyright at runtime, but is used by the typeshed build process and by tools that generate the bundled stubs for these type checkers.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requeststdlibmicropython version of stdlib

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions