diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 5cbfab054fea..79998b1f94ab 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -62,11 +62,7 @@ jobs: sudo apt-get update -q && sudo apt-get install -qy $PACKAGES fi - name: Run mypy_test.py - run: | - # python-version can sometimes be pinned to a specific version or to "-dev", but - # mypy understands only X.Y version numbers. - MYPY_PY_VERSION=$(echo ${{ matrix.python-version }} | cut -d - -f 1 | cut -d . -f 1-2) - python ./tests/mypy_test.py --platform=${{ matrix.platform }} --python-version=${MYPY_PY_VERSION} + run: python ./tests/mypy_test.py --platform=${{ matrix.platform }} --python-version=${{ matrix.python-version }} regression-tests: name: "mypy: Run test cases" diff --git a/tests/mypy_test.py b/tests/mypy_test.py index fd26e05ca85e..5e263a9cbb15 100755 --- a/tests/mypy_test.py +++ b/tests/mypy_test.py @@ -78,7 +78,7 @@ def remove_dev_suffix(version: str) -> str: """ if version.endswith("-dev"): return version[: -len("-dev")] - return version + return ".".join(version.split(".")[:2]) parser = argparse.ArgumentParser(