Skip to content

Support max version marker of stdlib typeshed modules #10402

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 4, 2021

Conversation

srittau
Copy link
Contributor

@srittau srittau commented May 2, 2021

This implements python/typeshed#5304.

Test Plan

I verified this manually with the following test script:

import datetime

And running mypy using Python 3.9 in the following situations:

VERSIONS file mypy parameters expected result
2.7 none passes
2.7-3.10 none passes
2.7-3.9 none passes
2.7-3.8 none cannot find stub
2.7 --python-version=3.8 passes
2.7-3.9 --python-version=3.8 passes
2.7-3.8 --python-version=3.8 passes
2.7-3.7 --python-version=3.8 cannot find stub

I did the same with the following test script (as functools has a separate Python 2 stub):

import functools

@srittau
Copy link
Contributor Author

srittau commented May 3, 2021

Cc @JelleZijlstra I have slightly updated the code to support the open-ended 2.7- format.

@JelleZijlstra JelleZijlstra merged commit 8bc1115 into python:master May 4, 2021
@srittau srittau deleted the typeshed-max-version branch May 4, 2021 07:21
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.

2 participants