From d028714a4f2d3abae96d0514929eacb6569bbd51 Mon Sep 17 00:00:00 2001 From: Sebastian Rittau Date: Mon, 24 Jan 2022 11:37:29 +0100 Subject: [PATCH 1/3] Use Python 3.9 to run mypy --- .github/workflows/mypy_primer.yml | 2 +- .github/workflows/tests.yml | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/mypy_primer.yml b/.github/workflows/mypy_primer.yml index b793b3c2c828..9abf18fffc0a 100644 --- a/.github/workflows/mypy_primer.yml +++ b/.github/workflows/mypy_primer.yml @@ -26,7 +26,7 @@ jobs: fetch-depth: 0 - uses: actions/setup-python@v2 with: - python-version: "3.10" + python-version: "3.9" # 3.10.2 introduced a regression with mypy - name: Install dependencies run: pip install git+https://github.com/hauntsaninja/mypy_primer.git - name: Run mypy_primer diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index e58c13ccdb50..a0c57c386e6d 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -60,6 +60,8 @@ jobs: steps: - uses: actions/checkout@v2 - uses: actions/setup-python@v2 + with: + python-version: "3.9" # 3.10.2 introduced a regression with mypy - run: pip install $(grep tomli== requirements-tests.txt) $(grep mypy== requirements-tests.txt) - run: ./tests/mypy_test.py --platform=${{ matrix.platform }} --python-version=${{ matrix.python-version }} From 10b791b3d80b168cfccb64884c48a7751c08d825 Mon Sep 17 00:00:00 2001 From: Sebastian Rittau Date: Mon, 24 Jan 2022 11:44:54 +0100 Subject: [PATCH 2/3] Try Python 3.8 --- .github/workflows/mypy_primer.yml | 2 +- .github/workflows/tests.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/mypy_primer.yml b/.github/workflows/mypy_primer.yml index 9abf18fffc0a..971f80891184 100644 --- a/.github/workflows/mypy_primer.yml +++ b/.github/workflows/mypy_primer.yml @@ -26,7 +26,7 @@ jobs: fetch-depth: 0 - uses: actions/setup-python@v2 with: - python-version: "3.9" # 3.10.2 introduced a regression with mypy + python-version: "3.8" # 3.10.2 introduced a regression with mypy - name: Install dependencies run: pip install git+https://github.com/hauntsaninja/mypy_primer.git - name: Run mypy_primer diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index a0c57c386e6d..39426daabff0 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -61,7 +61,7 @@ jobs: - uses: actions/checkout@v2 - uses: actions/setup-python@v2 with: - python-version: "3.9" # 3.10.2 introduced a regression with mypy + python-version: "3.8" # 3.10.2 introduced a regression with mypy - run: pip install $(grep tomli== requirements-tests.txt) $(grep mypy== requirements-tests.txt) - run: ./tests/mypy_test.py --platform=${{ matrix.platform }} --python-version=${{ matrix.python-version }} From e04aa1eed4480d2d10b54880181bb40159832057 Mon Sep 17 00:00:00 2001 From: Sebastian Rittau Date: Mon, 24 Jan 2022 11:51:02 +0100 Subject: [PATCH 3/3] Use future import --- tests/mypy_test.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/mypy_test.py b/tests/mypy_test.py index 0e36f0fa6ec3..c250646f3360 100755 --- a/tests/mypy_test.py +++ b/tests/mypy_test.py @@ -12,6 +12,8 @@ 5. Repeat steps 2-4 for other mypy runs (e.g. --py2) """ +from __future__ import annotations + import argparse import os import re