Skip to content

Commit 51c8f9c

Browse files
authored
Enable mypy and disable jedi on PyPy (#3075)
1 parent 65a3dcb commit 51c8f9c

File tree

3 files changed

+15
-17
lines changed

3 files changed

+15
-17
lines changed

src/trio/_tests/test_exports.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -172,8 +172,6 @@ def no_underscores(symbols: Iterable[str]) -> set[str]:
172172
elif tool == "mypy":
173173
if not RUN_SLOW: # pragma: no cover
174174
pytest.skip("use --run-slow to check against mypy")
175-
if sys.implementation.name != "cpython":
176-
pytest.skip("mypy not installed in tests on pypy")
177175

178176
cache = Path.cwd() / ".mypy_cache"
179177

@@ -266,10 +264,10 @@ def no_hidden(symbols: Iterable[str]) -> set[str]:
266264
if (not symbol.startswith("_")) or symbol.startswith("__")
267265
}
268266

269-
if tool == "mypy":
270-
if sys.implementation.name != "cpython":
271-
pytest.skip("mypy not installed in tests on pypy")
267+
if tool == "jedi" and sys.implementation.name != "cpython":
268+
pytest.skip("jedi does not support pypy")
272269

270+
if tool == "mypy":
273271
cache = Path.cwd() / ".mypy_cache"
274272

275273
_ensure_mypy_cache_updated()

test-requirements.in

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,22 @@ pyright
66
pyOpenSSL >= 22.0.0 # for the ssl + DTLS tests
77
trustme # for the ssl + DTLS tests
88
pylint # for pylint finding all symbols tests
9-
jedi # for jedi code completion tests
9+
jedi; implementation_name == "cpython" # for jedi code completion tests
1010
cryptography>=41.0.0 # cryptography<41 segfaults on pypy3.10
1111

1212
# Tools
1313
black; implementation_name == "cpython"
14-
mypy; implementation_name == "cpython"
15-
types-pyOpenSSL; implementation_name == "cpython" # and annotations
14+
mypy
1615
ruff >= 0.4.3
1716
astor # code generation
1817
uv >= 0.2.24
1918
codespell
2019

2120
# https://github.com/python-trio/trio/pull/654#issuecomment-420518745
22-
mypy-extensions; implementation_name == "cpython"
21+
mypy-extensions
2322
typing-extensions
24-
types-cffi; implementation_name == "cpython"
23+
types-cffi
24+
types-pyOpenSSL
2525
# annotations in doc files
2626
types-docutils
2727
sphinx

test-requirements.txt

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -63,17 +63,17 @@ iniconfig==2.0.0
6363
# via pytest
6464
isort==5.13.2
6565
# via pylint
66-
jedi==0.19.1
66+
jedi==0.19.1 ; implementation_name == 'cpython'
6767
# via -r test-requirements.in
6868
jinja2==3.1.4
6969
# via sphinx
7070
markupsafe==2.1.5
7171
# via jinja2
7272
mccabe==0.7.0
7373
# via pylint
74-
mypy==1.11.1 ; implementation_name == 'cpython'
74+
mypy==1.11.1
7575
# via -r test-requirements.in
76-
mypy-extensions==1.0.0 ; implementation_name == 'cpython'
76+
mypy-extensions==1.0.0
7777
# via
7878
# -r test-requirements.in
7979
# black
@@ -87,7 +87,7 @@ packaging==24.1
8787
# black
8888
# pytest
8989
# sphinx
90-
parso==0.8.4
90+
parso==0.8.4 ; implementation_name == 'cpython'
9191
# via jedi
9292
pathspec==0.12.1 ; implementation_name == 'cpython'
9393
# via black
@@ -145,15 +145,15 @@ tomlkit==0.13.2
145145
# via pylint
146146
trustme==1.1.0
147147
# via -r test-requirements.in
148-
types-cffi==1.16.0.20240331 ; implementation_name == 'cpython'
148+
types-cffi==1.16.0.20240331
149149
# via
150150
# -r test-requirements.in
151151
# types-pyopenssl
152152
types-docutils==0.21.0.20240724
153153
# via -r test-requirements.in
154-
types-pyopenssl==24.1.0.20240722 ; implementation_name == 'cpython'
154+
types-pyopenssl==24.1.0.20240722
155155
# via -r test-requirements.in
156-
types-setuptools==71.1.0.20240818 ; implementation_name == 'cpython'
156+
types-setuptools==71.1.0.20240818
157157
# via types-cffi
158158
typing-extensions==4.12.2
159159
# via

0 commit comments

Comments
 (0)