Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion docs/source/faq.rst
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,8 @@ the following aspects, among others:
Does it run on PyPy?
*********************

No. MyPy relies on `typed-ast
Somewhat. With PyPy 3.8, mypy is at least able to type check itself.
With older versions of PyPy, mypy relies on `typed-ast
<https://github.com/python/typed_ast>`_, which uses several APIs that
PyPy does not support (including some internal CPython APIs).

Expand Down
2 changes: 1 addition & 1 deletion mypy-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
typing_extensions>=3.7.4
mypy_extensions>=0.4.3,<0.5.0
typed_ast>=1.4.0,<1.5.0
typed_ast>=1.4.0,<1.5.0; python_version<'3.8'
tomli>=1.1.0,<1.2.0
6 changes: 4 additions & 2 deletions mypy/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import gc
import json
import os
import platform
import re
import stat
import sys
Expand Down Expand Up @@ -201,8 +202,9 @@ def _build(sources: List[BuildSource],
stderr: TextIO,
extra_plugins: Sequence[Plugin],
) -> BuildResult:
# This seems the most reasonable place to tune garbage collection.
gc.set_threshold(150 * 1000)
if platform.python_implementation() == 'CPython':
# This seems the most reasonable place to tune garbage collection.
gc.set_threshold(150 * 1000)

data_dir = default_data_dir()
fscache = fscache or FileSystemCache()
Expand Down
1 change: 1 addition & 0 deletions test-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ pytest-xdist>=1.34.0,<2.0.0
pytest-forked>=1.3.0,<2.0.0
pytest-cov>=2.10.0,<3.0.0
py>=1.5.2
typed_ast>=1.4.0,<1.5.0; python_version>='3.8'

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn;t python_version>='3.8' backwards?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, we still need typed_ast for the Python 2 tests even on newer Python 3.xs

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm, so eventually there will be some acrobatics needed to exclude pypy and skip those tests

typed_ast>=1.4.0,<1.5.0; python_version>='3.8' and platform_python_implementation != 'PyPy'

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes :/ for now we are just going to run mypy on itself. At some point we can look into actual test coverage, but wheels for dependencies like lxml and psutil aren't available on Windows so that's already an issue.

virtualenv>=20.6.0
setuptools!=50
importlib-metadata>=4.6.1,<5.0.0