Skip to content

scripts/runtests.py cannot run tests/mypy_test.py #10599

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

Closed
Screwtapello opened this issue Aug 21, 2023 · 1 comment · Fixed by #10600
Closed

scripts/runtests.py cannot run tests/mypy_test.py #10599

Screwtapello opened this issue Aug 21, 2023 · 1 comment · Fixed by #10600

Comments

@Screwtapello
Copy link
Contributor

Steps to reproduce:

  1. clone a fresh copy of the repo

     git clone https://github.com/python/typeshed.git
     cd typeshed
    
  2. Set up a local development enviroment as described in CONTRIBUTING.md:

     python3 -m venv .venv
     .venv/bin/pip install -U pip
     .venv/bin/pip install -r requirements-tests.txt
    
  3. Run the local tests as described in tests/README.md:

     .venv/bin/python3 scripts/runtests.py stdlib/xml
    

Expected results:

  • All tests pass or are skipped

Actual results:

mypy tests fail:

Running mypy for Python 3.7...
usage: mypy_test.py [-h] [-x [EXCLUDE ...]] [-v] [-p [{3.12,3.11,3.10,3.9,3.8} ...]]
                    [--platform [{linux,win32,darwin} ...]]
                    [filter ...]
mypy_test.py: error: argument -p/--python-version: invalid choice: '3.7' (choose from '3.12', '3.11', '3.10', '3.9', '3.8')

It looks like #10559 removed "3.7" from the tests/mypy_test.py wrapper, so it would reject requests to test types in Python 3.7 style, but did not update scripts/runtests.py to stop asking for Python 3.7 style.

Adding "3.7" back to the list of acceptable Python versions in tests/mypy_test.py gets things working nicely for me; alternatively, updating scripts/runtests.py to ask for Python 3.8 support works too.

@srittau
Copy link
Collaborator

srittau commented Aug 21, 2023

Thanks for the report! Python 3.7 is only semi-supported in typeshed, since mypy dropped support. Even if we only officially drop support for 3.7 in January 2024 (#10113), I will send a PR to use 3.8 in runtests to prevent any potential problems.

srittau added a commit to srittau/typeshed that referenced this issue Aug 21, 2023
We only support running mypy using 3.8+ up, since mypy 1.5 dropped
support for running with Python 3.7.

Closes: python#10599
srittau added a commit that referenced this issue Aug 21, 2023
We only support running mypy using 3.8+ up, since mypy 1.5 dropped
support for running with Python 3.7.

Closes: #10599
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 a pull request may close this issue.

2 participants