Skip to content

Commit eca15d9

Browse files
authored
Put all mypy_test.py version parsing in mypy_test.py (#14974)
1 parent 37dceef commit eca15d9

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

.github/workflows/tests.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,7 @@ jobs:
6262
sudo apt-get update -q && sudo apt-get install -qy $PACKAGES
6363
fi
6464
- name: Run mypy_test.py
65-
run: |
66-
# python-version can sometimes be pinned to a specific version or to "-dev", but
67-
# mypy understands only X.Y version numbers.
68-
MYPY_PY_VERSION=$(echo ${{ matrix.python-version }} | cut -d - -f 1 | cut -d . -f 1-2)
69-
python ./tests/mypy_test.py --platform=${{ matrix.platform }} --python-version=${MYPY_PY_VERSION}
65+
run: python ./tests/mypy_test.py --platform=${{ matrix.platform }} --python-version=${{ matrix.python-version }}
7066

7167
regression-tests:
7268
name: "mypy: Run test cases"

tests/mypy_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ def remove_dev_suffix(version: str) -> str:
7878
"""
7979
if version.endswith("-dev"):
8080
return version[: -len("-dev")]
81-
return version
81+
return ".".join(version.split(".")[:2])
8282

8383

8484
parser = argparse.ArgumentParser(

0 commit comments

Comments
 (0)