Skip to content

Use Python 3.7 as default in tests, drop 3.6 in CI (#13101) #13253

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 1 commit into from
Jul 27, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,27 +31,27 @@ jobs:
arch: x64
os: windows-latest
toxenv: py37
- name: Test suite with py37-ubuntu
python: '3.7'
- name: Test suite with py38-ubuntu
python: '3.8'
arch: x64
os: ubuntu-latest
toxenv: py
tox_extra_args: "-n 2"
- name: Test suite with py38-ubuntu
python: '3.8'
- name: Test suite with py39-ubuntu
python: '3.9'
arch: x64
os: ubuntu-latest
toxenv: py
tox_extra_args: "-n 2"
- name: Test suite with py36-ubuntu, mypyc-compiled
python: '3.6'
- name: Test suite with py37-ubuntu, mypyc-compiled
python: '3.7'
arch: x64
os: ubuntu-latest
toxenv: py
tox_extra_args: "-n 2"
test_mypyc: true
- name: Test suite with py39-ubuntu, mypyc-compiled
python: '3.9'
- name: Test suite with py310-ubuntu, mypyc-compiled
python: '3.10'
arch: x64
os: ubuntu-latest
toxenv: py
Expand All @@ -63,17 +63,17 @@ jobs:
os: ubuntu-latest
toxenv: py
tox_extra_args: "-n 2"
- name: mypyc runtime tests with py36-macos
python: '3.6'
- name: mypyc runtime tests with py37-macos
python: '3.7'
arch: x64
os: macos-latest
toxenv: py
tox_extra_args: "-n 2 mypyc/test/test_run.py mypyc/test/test_external.py"
- name: mypyc runtime tests with py36-debug-build-ubuntu
python: '3.6.8'
- name: mypyc runtime tests with py37-debug-build-ubuntu
python: '3.7.13'
arch: x64
os: ubuntu-latest
toxenv: py36
toxenv: py
tox_extra_args: "-n 2 mypyc/test/test_run.py mypyc/test/test_external.py"
debug_build: true
- name: Type check our own code (py37-ubuntu)
Expand Down
10 changes: 9 additions & 1 deletion mypy/defaults.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,16 @@
from typing_extensions import Final

PYTHON2_VERSION: Final = (2, 7)
PYTHON3_VERSION: Final = (3, 6)

# Earliest fully supported Python 3.x version. Used as the default Python
# version in tests. Mypy wheels should be built starting with this version,
# and CI tests should be run on this version (and later versions).
PYTHON3_VERSION: Final = (3, 7)

# Earliest Python 3.x version supported via --python-version 3.x. To run
# mypy, at least version PYTHON3_VERSION is needed.
PYTHON3_VERSION_MIN: Final = (3, 4)

CACHE_DIR: Final = ".mypy_cache"
CONFIG_FILE: Final = ["mypy.ini", ".mypy.ini"]
PYPROJECT_CONFIG_FILES: Final = ["pyproject.toml"]
Expand Down
4 changes: 2 additions & 2 deletions test-data/unit/check-incremental.test
Original file line number Diff line number Diff line change
Expand Up @@ -3744,7 +3744,7 @@ import b
[file b.py]
-- This is a heinous hack, but we simulate having a invalid cache by clobbering
-- the proto deps file with something with mtime mismatches.
[file ../.mypy_cache/3.6/@deps.meta.json.2]
[file ../.mypy_cache/3.7/@deps.meta.json.2]
{"snapshot": {"__main__": "a7c958b001a45bd6a2a320f4e53c4c16", "a": "d41d8cd98f00b204e9800998ecf8427e", "b": "d41d8cd98f00b204e9800998ecf8427e", "builtins": "c532c89da517a4b779bcf7a964478d67"}, "deps_meta": {"@root": {"path": "@root.deps.json", "mtime": 0}, "__main__": {"path": "__main__.deps.json", "mtime": 0}, "a": {"path": "a.deps.json", "mtime": 0}, "b": {"path": "b.deps.json", "mtime": 0}, "builtins": {"path": "builtins.deps.json", "mtime": 0}}}
[file ../.mypy_cache/.gitignore]
# Another hack to not trigger a .gitignore creation failure "false positive"
Expand Down Expand Up @@ -3779,7 +3779,7 @@ import b
[file b.py]
-- This is a heinous hack, but we simulate having a invalid cache by deleting
-- the proto deps file.
[delete ../.mypy_cache/3.6/@deps.meta.json.2]
[delete ../.mypy_cache/3.7/@deps.meta.json.2]
[file b.py.2]
# uh
-- Every file should get reloaded, since the cache was invalidated
Expand Down
6 changes: 3 additions & 3 deletions test-data/unit/fine-grained-cache-incremental.test
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ a.py:8: note: x: expected "int", got "str"
[file b.py]
-- This is a heinous hack, but we simulate having a invalid cache by clobbering
-- the proto deps file with something with mtime mismatches.
[file ../.mypy_cache/3.6/@deps.meta.json.2]
[file ../.mypy_cache/3.7/@deps.meta.json.2]
{"snapshot": {"__main__": "a7c958b001a45bd6a2a320f4e53c4c16", "a": "d41d8cd98f00b204e9800998ecf8427e", "b": "d41d8cd98f00b204e9800998ecf8427e", "builtins": "c532c89da517a4b779bcf7a964478d67"}, "deps_meta": {"@root": {"path": "@root.deps.json", "mtime": 0}, "__main__": {"path": "__main__.deps.json", "mtime": 0}, "a": {"path": "a.deps.json", "mtime": 0}, "b": {"path": "b.deps.json", "mtime": 0}, "builtins": {"path": "builtins.deps.json", "mtime": 0}}}

[file b.py.2]
Expand Down Expand Up @@ -234,8 +234,8 @@ x = 10
[file p/c.py]
class C: pass

[delete ../.mypy_cache/3.6/b.meta.json.2]
[delete ../.mypy_cache/3.6/p/c.meta.json.2]
[delete ../.mypy_cache/3.7/b.meta.json.2]
[delete ../.mypy_cache/3.7/p/c.meta.json.2]

[out]
==
4 changes: 2 additions & 2 deletions test-data/unit/fine-grained-modules.test
Original file line number Diff line number Diff line change
Expand Up @@ -2198,11 +2198,11 @@ import waitress
[file a.py.3]
import requests
[out]
a.py:1: error: Library stubs not installed for "waitress" (or incompatible with Python 3.6)
a.py:1: error: Library stubs not installed for "waitress" (or incompatible with Python 3.7)
a.py:1: note: Hint: "python3 -m pip install types-waitress"
a.py:1: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports
==
==
a.py:1: error: Library stubs not installed for "requests" (or incompatible with Python 3.6)
a.py:1: error: Library stubs not installed for "requests" (or incompatible with Python 3.7)
a.py:1: note: Hint: "python3 -m pip install types-requests"
a.py:1: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports
4 changes: 2 additions & 2 deletions test-data/unit/pythoneval.test
Original file line number Diff line number Diff line change
Expand Up @@ -1553,7 +1553,7 @@ from scribe import x
import maxminddb # Python 3 stubs available for maxminddb
import foobar_asdf
[out]
_testIgnoreImportIfNoPython3StubAvailable.py:4: error: Library stubs not installed for "maxminddb" (or incompatible with Python 3.6)
_testIgnoreImportIfNoPython3StubAvailable.py:4: error: Library stubs not installed for "maxminddb" (or incompatible with Python 3.7)
_testIgnoreImportIfNoPython3StubAvailable.py:4: note: Hint: "python3 -m pip install types-maxminddb"
_testIgnoreImportIfNoPython3StubAvailable.py:4: note: (or run "mypy --install-types" to install all missing stub packages)
_testIgnoreImportIfNoPython3StubAvailable.py:4: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports
Expand All @@ -1565,7 +1565,7 @@ import maxminddb
[out]
_testNoPython3StubAvailable.py:1: error: Cannot find implementation or library stub for module named "scribe"
_testNoPython3StubAvailable.py:1: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports
_testNoPython3StubAvailable.py:3: error: Library stubs not installed for "maxminddb" (or incompatible with Python 3.6)
_testNoPython3StubAvailable.py:3: error: Library stubs not installed for "maxminddb" (or incompatible with Python 3.7)
_testNoPython3StubAvailable.py:3: note: Hint: "python3 -m pip install types-maxminddb"
_testNoPython3StubAvailable.py:3: note: (or run "mypy --install-types" to install all missing stub packages)

Expand Down