You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
python3 runtests.py fails if python version == 3.11 #14487
Following the contributor guide I run the command python3 runtests.py and I got an error, based on the python version that I use in my virtualenv vs the one listed in the ini file (3.7).
To Reproduce
python3runtests.py
Expected Behavior
No errors
Actual Behavior
run self: ['/Users/alessioizzo/alessio/mypy/venv/bin/python3', '-m', 'mypy', '--config-file', 'mypy_self_check.ini', '-p', 'mypy']
mypy/config_parser.py:16: error: Cannot find implementation or library stub for module named "tomli" [import]
import tomli as tomllib
^
mypy/config_parser.py:16: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports
mypy/modulefinder.py:22: error: Cannot find implementation or library stub for module named "tomli" [import]
import tomli as tomllib
^
Found 2 errors in 2 files (checked 169 source files)
FAILED: self
Your Environment
Mypy version used: latest from git clone
Mypy command-line flags:
Mypy configuration options from mypy.ini (and other config files): mypy_self_check.ini
Python version used: 3.11
OS: macos Apple M1 Pro, Ventura 13.1
I guess that the solution can be to remove the python version from the ini file. I'm going to open a pull request for this one if this happens to be a bug.
Activity
aless10 commentedon Jan 21, 2023
I add that, removing the python version from the
mypy_self_check.inifile, I got these errorsJukkaL commentedon Jan 21, 2023
I've seen this as well. As a workaround, you can run
pip install tomli.We want to always type check in 3.7 mode to make sure we don't use any features from more recent Python versions.
The fix would be to install
tomliintest-requirements.txt, I guess.@aless10 Would you like to contribute a fix? It should be easy.
aless10 commentedon Jan 21, 2023
Ok, but while running the runtests.py command, I got this error
I'd like also to fix this and update the README in order to explicit the fact that we want to use the 3.7 version. Is that ok?
Thanks
Fix missing self check dependency on 3.11 (#14492)