[med-svn] [Git][med-team/mypy][master] 2 commits: Cherry-pick Python3.9 patches from upstream

Michael R. Crusoe gitlab at salsa.debian.org
Wed Oct 14 11:32:09 BST 2020



Michael R. Crusoe pushed to branch master at Debian Med / mypy


Commits:
729015b7 by Michael R. Crusoe at 2020-10-14T12:31:06+02:00
Cherry-pick Python3.9 patches from upstream

- - - - -
af00356f by Michael R. Crusoe at 2020-10-14T12:31:31+02:00
release 0.790-2

- - - - -


4 changed files:

- debian/changelog
- + debian/patches/py39
- debian/patches/series
- debian/rules


Changes:

=====================================
debian/changelog
=====================================
@@ -1,3 +1,10 @@
+mypy (0.790-2) unstable; urgency=medium
+
+  * debian/patches/py39: from upstream to support Python 3.9
+  * debian/rules: skip the tests on Python3.9 as python3-lxml needs a rebuild
+
+ -- Michael R. Crusoe <crusoe at debian.org>  Wed, 14 Oct 2020 12:31:21 +0200
+
 mypy (0.790-1) unstable; urgency=medium
 
   * New upstream version


=====================================
debian/patches/py39
=====================================
@@ -0,0 +1,46 @@
+Subject: py39: fix mypyc complaints
+From: hauntsaninja <>
+Origin: upstream, https://github.com/python/mypy/pull/9562 https://github.com/python/mypy/pull/9552
+
+--- mypy.orig/mypy/fastparse.py
++++ mypy/mypy/fastparse.py
+@@ -169,7 +169,9 @@
+         tree.path = fnam
+         tree.is_stub = is_stub_file
+     except SyntaxError as e:
+-        if sys.version_info < (3, 9) and e.filename == "<fstring>":
++        # alias to please mypyc
++        is_py38_or_earlier = sys.version_info < (3, 9)
++        if is_py38_or_earlier and e.filename == "<fstring>":
+             # In Python 3.8 and earlier, syntax errors in f-strings have lineno relative to the
+             # start of the f-string. This would be misleading, as mypy will report the error as the
+             # lineno within the file.
+@@ -1210,9 +1212,11 @@
+     def visit_Subscript(self, n: ast3.Subscript) -> IndexExpr:
+         e = IndexExpr(self.visit(n.value), self.visit(n.slice))
+         self.set_line(e, n)
++        # alias to please mypyc
++        is_py38_or_earlier = sys.version_info < (3, 9)
+         if (
+             isinstance(n.slice, ast3.Slice) or
+-            (sys.version_info < (3, 9) and isinstance(n.slice, ast3.ExtSlice))
++            (is_py38_or_earlier and isinstance(n.slice, ast3.ExtSlice))
+         ):
+             # Before Python 3.9, Slice has no line/column in the raw ast. To avoid incompatibility
+             # visit_Slice doesn't set_line, even in Python 3.9 on.
+@@ -1257,11 +1261,13 @@
+ 
+     # ExtSlice(slice* dims)
+     def visit_ExtSlice(self, n: ast3.ExtSlice) -> TupleExpr:
+-        return TupleExpr(self.translate_expr_list(n.dims))
++        # cast for mypyc's benefit on Python 3.9
++        return TupleExpr(self.translate_expr_list(cast(Any, n).dims))
+ 
+     # Index(expr value)
+     def visit_Index(self, n: Index) -> Node:
+-        return self.visit(n.value)
++        # cast for mypyc's benefit on Python 3.9
++        return self.visit(cast(Any, n).value)
+ 
+ 
+ class TypeConverter:


=====================================
debian/patches/series
=====================================
@@ -1,3 +1,4 @@
+py39
 older_pytest
 mypyc_analysis
 ignore_mypyc


=====================================
debian/rules
=====================================
@@ -75,7 +75,8 @@ ifeq (,$(filter nocheck,$(DEB_BUILD_PROFILES)))
 	# 	--config-file {dir}/mypy_self_check.ini -p mypy" dh_auto_test
 	# ^^^ requires pytest > 6.0.0
 	dh_auto_install
-	set -e; for v in $(PY3VERS); do \
+	#set -e; for v in $(PY3VERS); do 
+	set -e; for v in 3.8; do \
 		PATH=$$PATH:$(CURDIR)/debian/mypy/usr/bin/ python$$v -m pytest -n auto \
 		-o testpaths=mypy/test -o python_files=test*.py \
 		-k "not StubtestMiscUnit" \



View it on GitLab: https://salsa.debian.org/med-team/mypy/-/compare/7b4d679fa109b57bd25bf853131775b687548ca7...af00356f4b834627dc9e8604f9df61fb6b2ae5c1

-- 
View it on GitLab: https://salsa.debian.org/med-team/mypy/-/compare/7b4d679fa109b57bd25bf853131775b687548ca7...af00356f4b834627dc9e8604f9df61fb6b2ae5c1
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20201014/c872fd24/attachment-0001.html>


More information about the debian-med-commit mailing list