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

Skip to content

Commit 64e5052

Browse files
authored
Depend on ast-serialize by default (#21297)
This way parallel checking is available in the default install (as an experimental feature in mypy 2.0). We'll still support `pip install mypy[native-parser]` as a no-op for backward compat.
1 parent 3b2b1dd commit 64e5052

5 files changed

Lines changed: 6 additions & 6 deletions

File tree

docs/source/common_issues.rst

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -232,8 +232,7 @@ improved performance. You can ensure the presence of orjson using the ``faster-c
232232

233233
python3 -m pip install -U mypy[faster-cache]
234234

235-
Mypy may depend on orjson by default in the future. To use faster, native parser, use the
236-
``native-parse`` extra. Native parser will be default in near future.
235+
Mypy may depend on orjson by default in the future.
237236

238237
Types of empty collections
239238
--------------------------

mypy-requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ mypy_extensions>=1.0.0
66
pathspec>=1.0.0
77
tomli>=1.1.0; python_version<'3.11'
88
librt>=0.9.0; platform_python_implementation != 'PyPy'
9+
ast-serialize>=0.2.0,<1.0.0

mypy/nativeparse.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@
2626
try:
2727
import ast_serialize # type: ignore[import-not-found, unused-ignore]
2828
except ImportError:
29-
print("error: native parser not installed")
30-
print("note: to install run `pip install mypy[native-parser]`")
29+
print("error: ast-serialize package not installed")
30+
print("note: to install run `pip install ast-serialize`")
3131
sys.exit(2)
3232

3333
from librt.internal import (

pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ dependencies = [
5656
"pathspec>=1.0.0",
5757
"tomli>=1.1.0; python_version<'3.11'",
5858
"librt>=0.9.0; platform_python_implementation != 'PyPy'",
59+
"ast-serialize>=0.2.0,<1.0.0",
5960
]
6061
dynamic = ["version"]
6162

@@ -65,7 +66,7 @@ mypyc = ["setuptools>=50"]
6566
reports = ["lxml"]
6667
install-types = ["pip"]
6768
faster-cache = ["orjson"]
68-
native-parser = ["ast-serialize>=0.2.0,<1.0.0"]
69+
native-parser = []
6970

7071
[project.urls]
7172
Homepage = "https://www.mypy-lang.org/"

test-requirements.in

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,3 @@ pytest-cov>=2.10.0
1313
setuptools>=77.0.3
1414
tomli>=1.1.0 # needed even on py311+ so the self check passes with --python-version 3.10
1515
pre_commit>=3.5.0
16-
ast-serialize>=0.2.0,<1.0.0

0 commit comments

Comments
 (0)