Gentoo Archives: gentoo-commits

From: "Michał Górny" <mgorny@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-python/mypy/, dev-python/mypy/files/
Date: Fri, 26 Feb 2021 14:35:26
Message-Id: 1614349989.2d14e70d597d62cdf758f83ed19fc5126179350a.mgorny@gentoo
1 commit: 2d14e70d597d62cdf758f83ed19fc5126179350a
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Fri Feb 26 14:26:21 2021 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Fri Feb 26 14:33:09 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2d14e70d
7
8 dev-python/mypy: Remove old
9
10 Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
11
12 dev-python/mypy/Manifest | 2 -
13 dev-python/mypy/files/mypy-0.790-py39-fixes.patch | 161 ----------------------
14 dev-python/mypy/mypy-0.790.ebuild | 76 ----------
15 3 files changed, 239 deletions(-)
16
17 diff --git a/dev-python/mypy/Manifest b/dev-python/mypy/Manifest
18 index aa88d3040ca..161f8763256 100644
19 --- a/dev-python/mypy/Manifest
20 +++ b/dev-python/mypy/Manifest
21 @@ -1,6 +1,4 @@
22 -DIST mypy-0.790.tar.gz 2082487 BLAKE2B f8efcb701b4b7533306948721968c9a01ab6c6e56ec99fe6c36e35aca50b52f29f518aee2268a628539a372b8024094ef2d4d87da580b4dd667f41133351596e SHA512 be670456bb64cd197bb6a73832b7e0fd6439ae4af128212328a41cd93d9f644a82e79ffb05bf4695e99bd9788244a24916bf765cf30a6f162cf3b471f45c25b8
23 DIST mypy-0.800.tar.gz 2119165 BLAKE2B 48ead6c893f7055f4b1c0167f61e07b647a15f3a13688e1a93f11ebfdfe70ec3ccba3678bb5cf0e61af8dacfa64c241e5b79f28af55e8bfc5ce0a81c409deca9 SHA512 e267fa288f9c538e5c1d0a115b353aabbfbbd46a372dbaefbf43abeae1e6b88cc1b3e0bb301881f20e20b4e69eeeff4be22cf330bf58eaad09b4ea152ab02c12
24 DIST mypy-0.812.tar.gz 2122474 BLAKE2B 3bfbfe3010798d49bcf00aa1d926ffa8a54be50fb2e88f4ffc3cde3edba80a9b74853de17126394dc1806c07b740b5f8e7775f2fe4b2312e0a85134b446a690b SHA512 ee89f56a7a01214540f9b727f153a075a097b161b7f654d926d1080ae540ec68303629a4fe691fcb53d37c3eb08924bf01d22cdf1c3761b414a3bc40af3363e6
25 -DIST mypy-typeshed-5be9c91.tar.gz 583006 BLAKE2B 08ab2b6d479ccc66493524482051e825c65c0a94ea5cac8e56a8ea1dca85eda6104e4ed3188b7d5ce1ea99058019d66a21a7e270e3ad9df694be67ea1e6a7ce9 SHA512 2912bcf66e0f550941eb9c1f34979644857448a4bec478cfc0d662e9a401ade93ccfb2f57b5348504b4d6f0f23e576da609167f1ec3a0861414fc9c7dea80243
26 DIST typeshed-8cad322a8ccf4b104cafbac2c798413edaa4f327.tar.gz 600618 BLAKE2B acc4397fba21db1bcc7b3ca0922fb561d19161579062e1ee506cadfbbb1de952e36fab6ce552bdca932757274c882a90a948e9dfc257905d7f2e90de9f22bf55 SHA512 728808a568074310bd700a6fe3d667ced01a36f4a6ed2fa6df9d7a784e3167e2c96f7b91dcca1f99d50e325165f3ddea6bbafeab2469a9105c1cb217f16beded
27 DIST typeshed-add4d92f050fb11d3901c6f0ee579a122d4a7a98.tar.gz 600241 BLAKE2B 2bf91ba7bfa2ed3e2369d70ab76ce152e00f321e79f36ef7c264d477e350579eaade222e8347b4105fb93b847d944ce0aa182466ce636649098a2df69c09ee5d SHA512 8497ee9719e162f84556407296d383e0b7e695cf6cd60bbf7f34c1d7aada3926fd5516ce7ea3863e11b3bcb87f12617733082f020718610e467877872f0b4487
28
29 diff --git a/dev-python/mypy/files/mypy-0.790-py39-fixes.patch b/dev-python/mypy/files/mypy-0.790-py39-fixes.patch
30 deleted file mode 100644
31 index a7a581ea896..00000000000
32 --- a/dev-python/mypy/files/mypy-0.790-py39-fixes.patch
33 +++ /dev/null
34 @@ -1,161 +0,0 @@
35 -From 13ae58ffe8bedb7da9f4c657297f0d61e681d671 Mon Sep 17 00:00:00 2001
36 -From: Shantanu <12621235+hauntsaninja@××××××××××××××××××××.com>
37 -Date: Sun, 30 Aug 2020 18:11:57 -0700
38 -Subject: [PATCH] mypy: get CI green for py39 (#9376)
39 -
40 -Due to Python 3.9's new parser, this has a different (and better) error
41 -message on Python 3.9.
42 -
43 -This is effectively a test of typed_ast / ast, so I don't think it
44 -matters too much. I'm happy to alternatively just get rid of the test
45 -altogether, or if people feel strongly, come up with a way to run the
46 -test when run with older Pythons.
47 -
48 -Co-authored-by: hauntsaninja <>
49 ----
50 - .travis.yml | 3 ---
51 - mypy/test/testcheck.py | 2 ++
52 - test-data/unit/check-kwargs.test | 7 -------
53 - test-data/unit/check-python39.test | 9 +++++++++
54 - 4 files changed, 11 insertions(+), 10 deletions(-)
55 - create mode 100644 test-data/unit/check-python39.test
56 -
57 -diff --git a/mypy/test/testcheck.py b/mypy/test/testcheck.py
58 -index 49a85861b6..39a35c7280 100644
59 ---- a/mypy/test/testcheck.py
60 -+++ b/mypy/test/testcheck.py
61 -@@ -94,6 +94,8 @@
62 - # Tests that use Python 3.8-only AST features (like expression-scoped ignores):
63 - if sys.version_info >= (3, 8):
64 - typecheck_files.append('check-python38.test')
65 -+if sys.version_info >= (3, 9):
66 -+ typecheck_files.append('check-python39.test')
67 -
68 - # Special tests for platforms with case-insensitive filesystems.
69 - if sys.platform in ('darwin', 'win32'):
70 -diff --git a/test-data/unit/check-kwargs.test b/test-data/unit/check-kwargs.test
71 -index 1dd450caae..a587be3e06 100644
72 ---- a/test-data/unit/check-kwargs.test
73 -+++ b/test-data/unit/check-kwargs.test
74 -@@ -53,13 +53,6 @@ f(b=[], a=A())
75 - class A: pass
76 - [builtins fixtures/list.pyi]
77 -
78 --[case testGivingSameKeywordArgumentTwice]
79 --import typing
80 --def f(a: 'A', b: 'B') -> None: pass
81 --f(a=A(), b=B(), a=A()) # E: keyword argument repeated
82 --class A: pass
83 --class B: pass
84 --
85 - [case testGivingArgumentAsPositionalAndKeywordArg]
86 - import typing
87 - def f(a: 'A', b: 'B' = None) -> None: pass
88 -diff --git a/test-data/unit/check-python39.test b/test-data/unit/check-python39.test
89 -new file mode 100644
90 -index 0000000000..0e9ec683ae
91 ---- /dev/null
92 -+++ b/test-data/unit/check-python39.test
93 -@@ -0,0 +1,9 @@
94 -+[case testGivingSameKeywordArgumentTwice]
95 -+# This test was originally in check-kwargs.test
96 -+# Python 3.9's new parser started producing a different error message here. Since this isn't the
97 -+# most important test, to deal with this we'll only run this test with Python 3.9 and later.
98 -+import typing
99 -+def f(a: 'A', b: 'B') -> None: pass
100 -+f(a=A(), b=B(), a=A()) # E: "f" gets multiple values for keyword argument "a"
101 -+class A: pass
102 -+class B: pass
103 -From ab1bd98cc8a6415398121a47c687ede6f4cca4fd Mon Sep 17 00:00:00 2001
104 -From: Shantanu <12621235+hauntsaninja@××××××××××××××××××××.com>
105 -Date: Thu, 8 Oct 2020 11:18:18 -0700
106 -Subject: [PATCH] py39: fix mypyc complaint (#9552)
107 -
108 -I was trying to build wheels for Python 3.9 as part of #9536, but ran
109 -into this issue. You'll notice a couple hundred lines up msullivan
110 -points out that mypyc can't handle conditional method definition, so
111 -that's not an option here.
112 -
113 -Co-authored-by: hauntsaninja <>
114 ----
115 - mypy/fastparse.py | 6 ++++--
116 - 1 file changed, 4 insertions(+), 2 deletions(-)
117 -
118 -diff --git a/mypy/fastparse.py b/mypy/fastparse.py
119 -index 2dafbf4e14..0b72214100 100644
120 ---- a/mypy/fastparse.py
121 -+++ b/mypy/fastparse.py
122 -@@ -1257,11 +1257,13 @@ def visit_Slice(self, n: ast3.Slice) -> SliceExpr:
123 -
124 - # ExtSlice(slice* dims)
125 - def visit_ExtSlice(self, n: ast3.ExtSlice) -> TupleExpr:
126 -- return TupleExpr(self.translate_expr_list(n.dims))
127 -+ # cast for mypyc's benefit on Python 3.9
128 -+ return TupleExpr(self.translate_expr_list(cast(Any, n.dims)))
129 -
130 - # Index(expr value)
131 - def visit_Index(self, n: Index) -> Node:
132 -- return self.visit(n.value)
133 -+ # cast for mypyc's benefit on Python 3.9
134 -+ return self.visit(cast(Any, n.value))
135 -
136 -
137 - class TypeConverter:
138 -From ffed88fb95fcbfdd1363f0f719bd3e13f8fe20e9 Mon Sep 17 00:00:00 2001
139 -From: Shantanu <12621235+hauntsaninja@××××××××××××××××××××.com>
140 -Date: Thu, 8 Oct 2020 15:00:42 -0700
141 -Subject: [PATCH] py39: fix mypyc complaints part 2 (#9562)
142 -
143 -Necessary because I previously didn't actually fix mypyc's complaint +
144 -mypyc has more complaints.
145 -The sys.version_info aliasing works around us hitting
146 -https://github.com/python/mypy/blob/08f207ef4a09f56d710d63775771ae921c41d4bc/mypyc/irbuild/expression.py#L44
147 -
148 -Co-authored-by: hauntsaninja <>
149 ----
150 - mypy/fastparse.py | 12 ++++++++----
151 - 1 file changed, 8 insertions(+), 4 deletions(-)
152 -
153 -diff --git a/mypy/fastparse.py b/mypy/fastparse.py
154 -index 0b72214100..3319cd6489 100644
155 ---- a/mypy/fastparse.py
156 -+++ b/mypy/fastparse.py
157 -@@ -169,7 +169,9 @@ def parse(source: Union[str, bytes],
158 - tree.path = fnam
159 - tree.is_stub = is_stub_file
160 - except SyntaxError as e:
161 -- if sys.version_info < (3, 9) and e.filename == "<fstring>":
162 -+ # alias to please mypyc
163 -+ is_py38_or_earlier = sys.version_info < (3, 9)
164 -+ if is_py38_or_earlier and e.filename == "<fstring>":
165 - # In Python 3.8 and earlier, syntax errors in f-strings have lineno relative to the
166 - # start of the f-string. This would be misleading, as mypy will report the error as the
167 - # lineno within the file.
168 -@@ -1210,9 +1212,11 @@ def visit_Attribute(self, n: Attribute) -> Union[MemberExpr, SuperExpr]:
169 - def visit_Subscript(self, n: ast3.Subscript) -> IndexExpr:
170 - e = IndexExpr(self.visit(n.value), self.visit(n.slice))
171 - self.set_line(e, n)
172 -+ # alias to please mypyc
173 -+ is_py38_or_earlier = sys.version_info < (3, 9)
174 - if (
175 - isinstance(n.slice, ast3.Slice) or
176 -- (sys.version_info < (3, 9) and isinstance(n.slice, ast3.ExtSlice))
177 -+ (is_py38_or_earlier and isinstance(n.slice, ast3.ExtSlice))
178 - ):
179 - # Before Python 3.9, Slice has no line/column in the raw ast. To avoid incompatibility
180 - # visit_Slice doesn't set_line, even in Python 3.9 on.
181 -@@ -1258,12 +1262,12 @@ def visit_Slice(self, n: ast3.Slice) -> SliceExpr:
182 - # ExtSlice(slice* dims)
183 - def visit_ExtSlice(self, n: ast3.ExtSlice) -> TupleExpr:
184 - # cast for mypyc's benefit on Python 3.9
185 -- return TupleExpr(self.translate_expr_list(cast(Any, n.dims)))
186 -+ return TupleExpr(self.translate_expr_list(cast(Any, n).dims))
187 -
188 - # Index(expr value)
189 - def visit_Index(self, n: Index) -> Node:
190 - # cast for mypyc's benefit on Python 3.9
191 -- return self.visit(cast(Any, n.value))
192 -+ return self.visit(cast(Any, n).value)
193 -
194 -
195 - class TypeConverter:
196
197 diff --git a/dev-python/mypy/mypy-0.790.ebuild b/dev-python/mypy/mypy-0.790.ebuild
198 deleted file mode 100644
199 index 35743fc5204..00000000000
200 --- a/dev-python/mypy/mypy-0.790.ebuild
201 +++ /dev/null
202 @@ -1,76 +0,0 @@
203 -# Copyright 1999-2020 Gentoo Authors
204 -# Distributed under the terms of the GNU General Public License v2
205 -
206 -EAPI=7
207 -
208 -PYTHON_COMPAT=( python3_{7..9} )
209 -DISTUTILS_USE_SETUPTOOLS=rdepend
210 -
211 -inherit distutils-r1
212 -
213 -DESCRIPTION="Optional static typing for Python"
214 -HOMEPAGE="http://www.mypy-lang.org/"
215 -# One module is missing from the PyPI tarball
216 -# https://github.com/python/mypy/pull/9587
217 -# conftest.py is missing at the moment
218 -# https://github.com/python/mypy/pull/9543
219 -TYPESHED_COMMIT="5be9c91"
220 -SRC_URI="
221 - https://github.com/python/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz
222 - https://api.github.com/repos/python/typeshed/tarball/${TYPESHED_COMMIT} -> mypy-typeshed-${TYPESHED_COMMIT}.tar.gz
223 -"
224 -
225 -LICENSE="MIT"
226 -SLOT="0"
227 -KEYWORDS="~alpha amd64 arm arm64 ~ia64 ppc ppc64 sparc x86"
228 -
229 -# stubgen collides with this package: https://bugs.gentoo.org/585594
230 -RDEPEND="
231 - !dev-util/stubgen
232 - >=dev-python/psutil-4[${PYTHON_USEDEP}]
233 - >=dev-python/typed-ast-1.4.0[${PYTHON_USEDEP}]
234 - <dev-python/typed-ast-1.5.0[${PYTHON_USEDEP}]
235 - >=dev-python/typing-extensions-3.7.4[${PYTHON_USEDEP}]
236 - >=dev-python/mypy_extensions-0.4.3[${PYTHON_USEDEP}]
237 - <dev-python/mypy_extensions-0.5.0[${PYTHON_USEDEP}]
238 -"
239 -BDEPEND="
240 - test? (
241 - >=dev-python/attrs-18.0[${PYTHON_USEDEP}]
242 - >=dev-python/lxml-4.4.0[${PYTHON_USEDEP}]
243 - >=dev-python/pytest-6.0.0[${PYTHON_USEDEP}]
244 - >=dev-python/pytest-xdist-1.18[${PYTHON_USEDEP}]
245 - >=dev-python/py-1.5.2[${PYTHON_USEDEP}]
246 - >=dev-python/virtualenv-16.0.0[${PYTHON_USEDEP}]
247 - )
248 -"
249 -
250 -PATCHES=(
251 - # https://github.com/python/mypy/commit/13ae58ffe8bedb7da9f4c657297f0d61e681d671
252 - # https://github.com/python/mypy/commit/ab1bd98cc8a6415398121a47c687ede6f4cca4fd
253 - # https://github.com/python/mypy/commit/ffed88fb95fcbfdd1363f0f719bd3e13f8fe20e9
254 - "${FILESDIR}/${P}-py39-fixes.patch"
255 -)
256 -
257 -distutils_enable_sphinx docs/source dev-python/sphinx_rtd_theme
258 -distutils_enable_tests pytest
259 -
260 -src_unpack() {
261 - unpack ${A}
262 - rmdir "${S}/mypy/typeshed" || die
263 - mv "${WORKDIR}/python-typeshed-${TYPESHED_COMMIT}" "${S}/mypy/typeshed"
264 -}
265 -
266 -python_prepare_all() {
267 - # https://github.com/python/mypy/commit/2f291f2e312dd3bf2c05c45da0b032b240bfd7ab
268 - # Avoid a big patch by deleting the file manually
269 - rm test-data/samples/crawl.py || die
270 - distutils-r1_python_prepare_all
271 -}
272 -
273 -python_test() {
274 - # Some mypy/test/testcmdline.py::PythonCmdlineSuite tests
275 - # fail with high COLUMNS values
276 - local -x COLUMNS=80
277 - pytest -vv || die "Tests fail with ${EPYTHON}"
278 -}