Debian Codegraph @

debian/patches/skip-ast-serialize

raw
1 From: Michael R. Crusoe <[email protected]>
2 Subject: turn off native parsing
3 Forwarded: not-needed
4
5 The Python package ast_serialize is not available in Debian yet.
6 --- mypy.orig/mypy/main.py
7 +++ mypy/mypy/main.py
8 @@ -99,7 +99,6 @@
9
10 if options.num_workers:
11 # Supporting both parsers would be really tricky, so just support the new one.
12 - options.native_parser = True
13 if options.num_workers < 0:
14 fail("error: Number of workers cannot be negative", stderr, options)
15 if options.cache_dir == os.devnull:
16 @@ -113,6 +112,8 @@
17 stderr,
18 options,
19 )
20 + options.num_workers = 0
21 + # native parser is not yet supported in Debian
22
23 if options.allow_redefinition and not options.local_partial_types:
24 fail(
25 @@ -1180,11 +1181,7 @@
26
27 # Experimental parallel type-checking support.
28 internals_group.add_argument(
29 - "-n",
30 - "--num-workers",
31 - type=int,
32 - default=0,
33 - help="Number of separate mypy worker processes (experimental)",
34 + "-n", "--num-workers", type=int, default=0, help=argparse.SUPPRESS
35 )
36
37 report_group = parser.add_argument_group(
38 @@ -1297,10 +1294,15 @@
39 help=argparse.SUPPRESS,
40 )
41 # --native-parser enables the native parser (experimental)
42 - add_invertible_flag(
43 - "--native-parser",
44 + np_arg = parser.add_argument(
45 + "--native-parser", default=False, action="store_false", help=argparse.SUPPRESS
46 + )
47 + parser.add_argument(
48 + invert_flag_name("--native-parser"),
49 default=False,
50 - help="Enable faster parser that parses directly to mypy AST",
51 + dest=np_arg.dest,
52 + action="store_false",
53 + help=argparse.SUPPRESS,
54 )
55 # --logical-deps adds some more dependencies that are not semantically needed, but
56 # may be helpful to determine relative importance of classes and functions for overall
57 --- mypy.orig/mypy/nativeparse.py
58 +++ mypy/mypy/nativeparse.py
59 @@ -22,7 +22,7 @@
60 import time
61 from typing import Final, cast
62
63 -import ast_serialize
64 +import ast_serialize # type: ignore[import-not-found, unused-ignore]
65 from librt.internal import (
66 read_float as read_float_bare,
67 read_int as read_int_bare,
68 @@ -254,7 +254,7 @@
69 # module may be not ready in a thread sometimes.
70 t0 = time.time()
71 while ast_serialize is None:
72 - time.sleep(0.0001) # type: ignore[unreachable]
73 + time.sleep(0.0001)
74 if time.time() - t0 > 10.0:
75 raise ImportError("Cannot import ast_serialize")
76 ast_bytes, errors, ignores, import_bytes, ast_data = ast_serialize.parse(
77 --- mypy.orig/PKG-INFO
78 +++ mypy/PKG-INFO
79 @@ -30,7 +30,6 @@
80 Requires-Dist: pathspec>=1.0.0
81 Requires-Dist: tomli>=1.1.0; python_version < "3.11"
82 Requires-Dist: librt>=0.11.0; platform_python_implementation != "PyPy"
83 -Requires-Dist: ast-serialize<1.0.0,>=0.3.0
84 Provides-Extra: dmypy
85 Requires-Dist: psutil>=4.0; extra == "dmypy"
86 Provides-Extra: mypyc
87 --- mypy.orig/pyproject.toml
88 +++ mypy/pyproject.toml
89 @@ -14,8 +14,6 @@
90 # the following is from build-requirements.txt
91 "types-psutil",
92 "types-setuptools",
93 - # required to work around a mypyc import bug
94 - "ast-serialize>=0.3.0,<1.0.0",
95 ]
96 build-backend = "setuptools.build_meta"
97
98 @@ -58,7 +56,6 @@
99 "pathspec>=1.0.0",
100 "tomli>=1.1.0; python_version<'3.11'",
101 "librt>=0.11.0; platform_python_implementation != 'PyPy'",
102 - "ast-serialize>=0.3.0,<1.0.0",
103 ]
104 dynamic = ["version"]
105
106 --- mypy.orig/mypy.egg-info/PKG-INFO
107 +++ mypy/mypy.egg-info/PKG-INFO
108 @@ -30,7 +30,6 @@
109 Requires-Dist: pathspec>=1.0.0
110 Requires-Dist: tomli>=1.1.0; python_version < "3.11"
111 Requires-Dist: librt>=0.11.0; platform_python_implementation != "PyPy"
112 -Requires-Dist: ast-serialize<1.0.0,>=0.3.0
113 Provides-Extra: dmypy
114 Requires-Dist: psutil>=4.0; extra == "dmypy"
115 Provides-Extra: mypyc
116 --- mypy.orig/mypy.egg-info/requires.txt
117 +++ mypy/mypy.egg-info/requires.txt
118 @@ -1,6 +1,5 @@
119 mypy_extensions>=1.0.0
120 pathspec>=1.0.0
121 -ast-serialize<1.0.0,>=0.3.0
122
123 [:platform_python_implementation != "PyPy"]
124 librt>=0.11.0