From 4aa02517f52b36be00a0d252f21d60cd7d34c54a Mon Sep 17 00:00:00 2001 From: Jukka Lehtosalo Date: Mon, 11 Jul 2022 12:46:19 +0100 Subject: [PATCH 1/6] Default to Python 3.7 in test cases --- mypy/defaults.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mypy/defaults.py b/mypy/defaults.py index dc9e49c2e9c6..724834636316 100644 --- a/mypy/defaults.py +++ b/mypy/defaults.py @@ -3,7 +3,7 @@ from typing_extensions import Final PYTHON2_VERSION: Final = (2, 7) -PYTHON3_VERSION: Final = (3, 6) +PYTHON3_VERSION: Final = (3, 7) PYTHON3_VERSION_MIN: Final = (3, 4) CACHE_DIR: Final = ".mypy_cache" CONFIG_FILE: Final = ["mypy.ini", ".mypy.ini"] From fc57dda7198a7833c8d9c40ae972dfd9749c518f Mon Sep 17 00:00:00 2001 From: Jukka Lehtosalo Date: Mon, 11 Jul 2022 12:46:49 +0100 Subject: [PATCH 2/6] Update test cases --- test-data/unit/check-incremental.test | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test-data/unit/check-incremental.test b/test-data/unit/check-incremental.test index 79fa1c92c52e..b724ed51d17c 100644 --- a/test-data/unit/check-incremental.test +++ b/test-data/unit/check-incremental.test @@ -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" @@ -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 From a3da33a125db4a50669b3e5590a2db942aa78010 Mon Sep 17 00:00:00 2001 From: Jukka Lehtosalo Date: Mon, 11 Jul 2022 12:59:14 +0100 Subject: [PATCH 3/6] Update more tests --- test-data/unit/fine-grained-cache-incremental.test | 6 +++--- test-data/unit/fine-grained-modules.test | 4 ++-- test-data/unit/pythoneval.test | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/test-data/unit/fine-grained-cache-incremental.test b/test-data/unit/fine-grained-cache-incremental.test index 79e8abdb9776..50f93dd35af3 100644 --- a/test-data/unit/fine-grained-cache-incremental.test +++ b/test-data/unit/fine-grained-cache-incremental.test @@ -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] @@ -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] == diff --git a/test-data/unit/fine-grained-modules.test b/test-data/unit/fine-grained-modules.test index 80a2883ee756..f20891e6c87f 100644 --- a/test-data/unit/fine-grained-modules.test +++ b/test-data/unit/fine-grained-modules.test @@ -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 diff --git a/test-data/unit/pythoneval.test b/test-data/unit/pythoneval.test index b59d50feb986..d3c6cfb31d6d 100644 --- a/test-data/unit/pythoneval.test +++ b/test-data/unit/pythoneval.test @@ -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 @@ -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) From a8dd50de07f77842abb4f9b3227675b1c3261459 Mon Sep 17 00:00:00 2001 From: Jukka Lehtosalo Date: Mon, 11 Jul 2022 13:14:25 +0100 Subject: [PATCH 4/6] Update github actions --- .github/workflows/test.yml | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 71223846bc38..1971a86c7090 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -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 @@ -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' 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) From 52823ed2a0744820d0101041f8c9572169c700ae Mon Sep 17 00:00:00 2001 From: Jukka Lehtosalo Date: Mon, 11 Jul 2022 13:23:04 +0100 Subject: [PATCH 5/6] Add comments --- mypy/defaults.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/mypy/defaults.py b/mypy/defaults.py index 724834636316..7765feeb91e1 100644 --- a/mypy/defaults.py +++ b/mypy/defaults.py @@ -3,8 +3,16 @@ from typing_extensions import Final PYTHON2_VERSION: Final = (2, 7) + +# 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 = [ From 38ca7af4d44ae4109763c50f08739c66fac32808 Mon Sep 17 00:00:00 2001 From: Shantanu <12621235+hauntsaninja@users.noreply.github.com> Date: Thu, 14 Jul 2022 20:32:19 -0700 Subject: [PATCH 6/6] Update .github/workflows/test.yml --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1971a86c7090..f4b1a6ab975a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -70,7 +70,7 @@ jobs: toxenv: py tox_extra_args: "-n 2 mypyc/test/test_run.py mypyc/test/test_external.py" - name: mypyc runtime tests with py37-debug-build-ubuntu - python: '3.7' + python: '3.7.13' arch: x64 os: ubuntu-latest toxenv: py