Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Pyright CI test doesn't recognize requires_python in METADATA.toml #14025

Copy link
Copy link
Closed as duplicate of#10722
@Avasam

Description

@Avasam
Issue body actions

The test pyright: Run test cases can fail for older Python versions due to using newer features. For example, in #13968 (comment) I typed a class with a dataclass decorator using kwargs added to Python 3.10. Despite setting requires_python = ">=3.10" in stubs/networkx/METADATA.toml

Example run (whilst the build logs are still available) https://github.com/python/typeshed/actions/runs/14921000784/job/41916216049?pr=13968

One possible solution with the current setup, is to collect stubs whose requires_python don't match the current Python version, and pass them to pyright's file exclusion.


Similarly, if running tests/runtests.py on a third-party stub, requires_python should be taken into account rather than only relying on _PYTHON_VERSION.
Edit: #14051

Metadata

Metadata

Assignees

No one assigned

    Labels

    project: infrastructuretypeshed build, test, documentation, or distribution relatedtypeshed build, test, documentation, or distribution related

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.