Skip to content

Commit 0b07265

Browse files
authored
Unpin Mypy (#1301)
* Unpin Mypy fixes #1279 Looks like 1.10.1 fixed itself? * Fix type errors * Update pins * Don't run Mypy on 3.8 too * wtf * Fix order
1 parent 6e25a0c commit 0b07265

File tree

3 files changed

+18
-10
lines changed

3 files changed

+18
-10
lines changed

.github/workflows/ci.yml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,16 +49,24 @@ jobs:
4949
- name: Prepare tox
5050
run: |
5151
V=${{ matrix.python-version }}
52+
DO_MYPY=1
5253
5354
if [[ "$V" = pypy-* ]]; then
55+
DO_MYPY=0
56+
5457
V=pypy3
55-
IS_PYPY=1
5658
else
59+
if [[ "$V" == "3.7" || "$V" == "3.8" ]]; then
60+
DO_MYPY=0
61+
echo "skipping $V"
62+
else
63+
echo "not skipping $V"
64+
fi
65+
5766
V=py$(echo $V | tr -d .)
58-
IS_PYPY=0
5967
fi
6068
61-
echo IS_PYPY=$IS_PYPY >>$GITHUB_ENV
69+
echo DO_MYPY=$DO_MYPY >>$GITHUB_ENV
6270
echo TOX_PYTHON=$V >>$GITHUB_ENV
6371
6472
python -Im pip install tox
@@ -68,7 +76,7 @@ jobs:
6876

6977
- run: python -Im tox run -e ${{ env.TOX_PYTHON }}-tests
7078
- run: python -Im tox run -e ${{ env.TOX_PYTHON }}-mypy
71-
if: env.IS_PYPY == '0' && matrix.python-version != '3.7'
79+
if: env.DO_MYPY == '1'
7280

7381
- name: Upload coverage data
7482
uses: actions/upload-artifact@v4

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@ dynamic = ["version", "readme"]
3131

3232
[project.optional-dependencies]
3333
tests-mypy = [
34-
'pytest-mypy-plugins; platform_python_implementation == "CPython" and python_version >= "3.8" and python_version < "3.13"',
34+
'pytest-mypy-plugins; platform_python_implementation == "CPython" and python_version >= "3.9" and python_version < "3.13"',
3535
# Since the mypy error messages keep changing, we have to keep updating this
3636
# pin.
37-
'mypy>=1.6,<1.10; platform_python_implementation == "CPython" and python_version >= "3.8"',
37+
'mypy>=1.10.1; platform_python_implementation == "CPython" and python_version >= "3.9"',
3838
]
3939
tests = [
4040
# For regression test to ensure cloudpickle compat doesn't break.

tests/test_mypy.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -589,7 +589,7 @@
589589
x: Optional[T]
590590
@classmethod
591591
def clsmeth(cls) -> None:
592-
reveal_type(cls) # N: Revealed type is "Type[main.A[T`1]]"
592+
reveal_type(cls) # N: Revealed type is "type[main.A[T`1]]"
593593
594594
- case: testAttrsForwardReference
595595
main: |
@@ -645,7 +645,7 @@
645645
b: str = attr.ib()
646646
@classmethod
647647
def new(cls) -> A:
648-
reveal_type(cls) # N: Revealed type is "Type[main.A]"
648+
reveal_type(cls) # N: Revealed type is "type[main.A]"
649649
return cls(6, 'hello')
650650
@classmethod
651651
def bad(cls) -> A:
@@ -680,7 +680,7 @@
680680
681681
@classmethod
682682
def foo(cls, x: Union[int, str]) -> Union[int, str]:
683-
reveal_type(cls) # N: Revealed type is "Type[main.A]"
683+
reveal_type(cls) # N: Revealed type is "type[main.A]"
684684
reveal_type(cls.other()) # N: Revealed type is "builtins.str"
685685
return x
686686
@@ -1411,4 +1411,4 @@
14111411
14121412
reveal_type(A) # N: Revealed type is "def () -> main.A"
14131413
if has(A):
1414-
reveal_type(A) # N: Revealed type is "Type[attr.AttrsInstance]"
1414+
reveal_type(A) # N: Revealed type is "type[attr.AttrsInstance]"

0 commit comments

Comments
 (0)