[med-svn] [Git][python-team/packages/mypy][master] 3 commits: Refresh PQ patches.
Stefano Rivera (@stefanor)
gitlab at salsa.debian.org
Mon Sep 26 11:47:23 BST 2022
Stefano Rivera pushed to branch master at Debian Python Team / packages / mypy
Commits:
f7955c6c by Stefano Rivera at 2022-09-26T11:33:11+02:00
Refresh PQ patches.
- - - - -
30f3ee07 by Stefano Rivera at 2022-09-26T12:12:36+02:00
Patch: Python 3.10.7 support.
- - - - -
5e39685c by Stefano Rivera at 2022-09-26T12:37:06+02:00
Team upload.
- - - - -
10 changed files:
- debian/changelog
- debian/patches/intersphinx
- debian/patches/psutils-in-typeshed
- debian/patches/python3.10.3
- + debian/patches/python3.10.7
- + debian/patches/python3.19.7-tests
- debian/patches/series
- debian/patches/use_standard_sphinx_theme
- debian/patches/verbose
- debian/patches/walrus.patch
Changes:
=====================================
debian/changelog
=====================================
@@ -1,14 +1,17 @@
-mypy (0.971-3) UNRELEASED; urgency=medium
+mypy (0.971-3) unstable; urgency=medium
[ Michael R. Crusoe ]
* Stop skipping tests.
[ Stefano Rivera ]
+ * Team upload.
* Depend on python3-setuptools for autopkgtest, no longer a dependency of
python3-virtualenv.
* Recommend python3-setuptools, required by mypyc.
+ * Refresh PQ patches.
+ * Patch: Python 3.10.7 support.
- -- Michael R. Crusoe <crusoe at debian.org> Wed, 17 Aug 2022 19:51:00 +0200
+ -- Stefano Rivera <stefanor at debian.org> Mon, 26 Sep 2022 12:36:51 +0200
mypy (0.971-2) unstable; urgency=medium
=====================================
debian/patches/intersphinx
=====================================
@@ -7,9 +7,11 @@ Forwarded: not-needed
docs/source/conf.py | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
---- mypy.orig/docs/source/conf.py
-+++ mypy/docs/source/conf.py
-@@ -265,12 +265,12 @@
+diff --git a/docs/source/conf.py b/docs/source/conf.py
+index 6f6b8b2..9033dfc 100644
+--- a/docs/source/conf.py
++++ b/docs/source/conf.py
+@@ -265,12 +265,12 @@ texinfo_documents = [
rst_prolog = '.. |...| unicode:: U+2026 .. ellipsis\n'
intersphinx_mapping = {
=====================================
debian/patches/psutils-in-typeshed
=====================================
@@ -8,7 +8,7 @@ Forwarded: not-needed
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mypy/dmypy_server.py b/mypy/dmypy_server.py
-index 2f8fc7f..20d932f 100644
+index 3fbda6b..2db9936 100644
--- a/mypy/dmypy_server.py
+++ b/mypy/dmypy_server.py
@@ -874,7 +874,7 @@ MiB: Final = 2 ** 20
=====================================
debian/patches/python3.10.3
=====================================
@@ -18,9 +18,11 @@ Origin: upstream, https://github.com/python/mypy/commit/6b0e8485ac20a15fb7ad8762
test-data/unit/cmdline.test | 4 ++++
1 file changed, 4 insertions(+)
---- mypy.orig/test-data/unit/cmdline.test
-+++ mypy/test-data/unit/cmdline.test
-@@ -1288,6 +1288,10 @@
+diff --git a/test-data/unit/cmdline.test b/test-data/unit/cmdline.test
+index 3b3b64c..4718ec6 100644
+--- a/test-data/unit/cmdline.test
++++ b/test-data/unit/cmdline.test
+@@ -1288,6 +1288,10 @@ Found 1 error in 1 file (errors prevented further checking)
pkg/x.py:1: error: invalid syntax
Found 1 error in 1 file (errors prevented further checking)
== Return code: 2
=====================================
debian/patches/python3.10.7
=====================================
@@ -0,0 +1,34 @@
+From: hauntsaninja <hauntsaninja at gmail.com>
+Date: Wed, 24 Aug 2022 11:39:08 -0700
+Subject: Allow stubs to use newer syntax than 3.7
+
+Fixes #13499
+
+Today this code reads like "stubs should all target 3.7" and this
+is indeed how typeshed operates. But authors of pyi other than typeshed
+should probably be allowed to choose what Python version they're
+targetting.
+
+This code goes back to #3000 back in the typed_ast days, when this
+allowed stubs to use much newer syntax features than the base Python
+version, so in some ways this is in the spirit of the original code.
+
+Origin: upstream, https://github.com/python/mypy/commit/7a959e2f24d052aeebf4b211cdd1c5bd075035cf
+Bug-Upstream: https://github.com/python/mypy/issues/13499
+---
+ mypy/fastparse.py | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/mypy/fastparse.py b/mypy/fastparse.py
+index b5b31a6..f697e53 100644
+--- a/mypy/fastparse.py
++++ b/mypy/fastparse.py
+@@ -185,6 +185,8 @@ def parse(source: Union[str, bytes],
+ try:
+ if is_stub_file:
+ feature_version = defaults.PYTHON3_VERSION[1]
++ if options.python_version[0] == 3 and options.python_version[1] > feature_version:
++ feature_version = options.python_version[1]
+ else:
+ assert options.python_version[0] >= 3
+ feature_version = options.python_version[1]
=====================================
debian/patches/python3.19.7-tests
=====================================
@@ -0,0 +1,188 @@
+From: AlexWaygood <alex.waygood at gmail.com>
+Date: Mon, 26 Sep 2022 12:11:14 +0200
+Subject: Update pos-only unit tests for Python 3.10.7
+
+The CI has started to sporadically fail depending on whether 3.10.6 is
+picked up by GitHub Actions (okay) or 3.10.7 (not okay). For example:
+
+ https://github.com/python/mypy/actions/runs/3046671132/jobs/4909772702
+ https://github.com/python/mypy/actions/runs/3046723692/jobs/4909887963
+
+On Python 3.10.7 (but not on Python 3.10.6), mypy correctly rejects
+using PEP 570 syntax unless --python-version is set to 3.8 or higher
+(this is due to python/cpython#95935). However, this makes several unit
+tests fail.
+
+This PR updates those unit tests so that the CI passes on both 3.10.6
+and 3.10.7
+
+Origin: upstream, https://github.com/python/mypy/pull/13660
+---
+ test-data/unit/check-parameter-specification.test | 14 +++++++++-----
+ test-data/unit/check-python38.test | 16 +++++++++++++++-
+ 2 files changed, 24 insertions(+), 6 deletions(-)
+
+diff --git a/test-data/unit/check-parameter-specification.test b/test-data/unit/check-parameter-specification.test
+index 682ce93..8ff8a19 100644
+--- a/test-data/unit/check-parameter-specification.test
++++ b/test-data/unit/check-parameter-specification.test
+@@ -573,7 +573,7 @@ reveal_type(f(n)) # N: Revealed type is "def (builtins.int, builtins.bytes) ->
+ [builtins fixtures/paramspec.pyi]
+
+ [case testParamSpecConcatenateNamedArgs]
+-# flags: --strict-concatenate
++# flags: --python-version 3.8 --strict-concatenate
+ # this is one noticeable deviation from PEP but I believe it is for the better
+ from typing_extensions import ParamSpec, Concatenate
+ from typing import Callable, TypeVar
+@@ -595,12 +595,14 @@ def f2(c: Callable[P, R]) -> Callable[Concatenate[int, P], R]:
+ f2(lambda x: 42)(42, x=42)
+ [builtins fixtures/paramspec.pyi]
+ [out]
+-main:10: error: invalid syntax
++main:10: error: invalid syntax; you likely need to run mypy using Python 3.8 or newer
+ [out version>=3.8]
+ main:17: error: Incompatible return value type (got "Callable[[Arg(int, 'x'), **P], R]", expected "Callable[[int, **P], R]")
+ main:17: note: This may be because "result" has arguments named: "x"
+
+ [case testNonStrictParamSpecConcatenateNamedArgs]
++# flags: --python-version 3.8
++
+ # this is one noticeable deviation from PEP but I believe it is for the better
+ from typing_extensions import ParamSpec, Concatenate
+ from typing import Callable, TypeVar
+@@ -622,7 +624,7 @@ def f2(c: Callable[P, R]) -> Callable[Concatenate[int, P], R]:
+ f2(lambda x: 42)(42, x=42)
+ [builtins fixtures/paramspec.pyi]
+ [out]
+-main:9: error: invalid syntax
++main:11: error: invalid syntax; you likely need to run mypy using Python 3.8 or newer
+ [out version>=3.8]
+
+ [case testParamSpecConcatenateWithTypeVar]
+@@ -644,6 +646,8 @@ reveal_type(n(42)) # N: Revealed type is "None"
+ [builtins fixtures/paramspec.pyi]
+
+ [case testCallablesAsParameters]
++# flags: --python-version 3.8
++
+ # credits to https://github.com/microsoft/pyright/issues/2705
+ from typing_extensions import ParamSpec, Concatenate
+ from typing import Generic, Callable, Any
+@@ -661,9 +665,9 @@ reveal_type(abc)
+ bar(abc)
+ [builtins fixtures/paramspec.pyi]
+ [out]
+-main:11: error: invalid syntax
++main:13: error: invalid syntax; you likely need to run mypy using Python 3.8 or newer
+ [out version>=3.8]
+-main:14: note: Revealed type is "__main__.Foo[[builtins.int, b: builtins.str]]"
++main:16: note: Revealed type is "__main__.Foo[[builtins.int, b: builtins.str]]"
+
+ [case testSolveParamSpecWithSelfType]
+ from typing_extensions import ParamSpec, Concatenate
+diff --git a/test-data/unit/check-python38.test b/test-data/unit/check-python38.test
+index deded7a..fd326c9 100644
+--- a/test-data/unit/check-python38.test
++++ b/test-data/unit/check-python38.test
+@@ -115,21 +115,25 @@ def g(x: int): ...
+ ) # type: ignore # E: Unused "type: ignore" comment
+
+ [case testPEP570ArgTypesMissing]
+-# flags: --disallow-untyped-defs
++# flags: --python-version 3.8 --disallow-untyped-defs
+ def f(arg, /) -> None: ... # E: Function is missing a type annotation for one or more arguments
+
+ [case testPEP570ArgTypesBadDefault]
++# flags: --python-version 3.8
+ def f(arg: int = "ERROR", /) -> None: ... # E: Incompatible default for argument "arg" (default has type "str", argument has type "int")
+
+ [case testPEP570ArgTypesDefault]
++# flags: --python-version 3.8
+ def f(arg: int = 0, /) -> None:
+ reveal_type(arg) # N: Revealed type is "builtins.int"
+
+ [case testPEP570ArgTypesRequired]
++# flags: --python-version 3.8
+ def f(arg: int, /) -> None:
+ reveal_type(arg) # N: Revealed type is "builtins.int"
+
+ [case testPEP570Required]
++# flags: --python-version 3.8
+ def f(arg: int, /) -> None: ... # N: "f" defined here
+ f(1)
+ f("ERROR") # E: Argument 1 to "f" has incompatible type "str"; expected "int"
+@@ -137,6 +141,7 @@ f(arg=1) # E: Unexpected keyword argument "arg" for "f"
+ f(arg="ERROR") # E: Unexpected keyword argument "arg" for "f"
+
+ [case testPEP570Default]
++# flags: --python-version 3.8
+ def f(arg: int = 0, /) -> None: ... # N: "f" defined here
+ f()
+ f(1)
+@@ -145,6 +150,7 @@ f(arg=1) # E: Unexpected keyword argument "arg" for "f"
+ f(arg="ERROR") # E: Unexpected keyword argument "arg" for "f"
+
+ [case testPEP570Calls]
++# flags: --python-version 3.8 --no-strict-optional
+ from typing import Any, Dict
+ def f(p, /, p_or_kw, *, kw) -> None: ... # N: "f" defined here
+ d = None # type: Dict[Any, Any]
+@@ -157,6 +163,7 @@ f(**d) # E: Missing positional argument "p_or_kw" in call to "f"
+ [builtins fixtures/dict.pyi]
+
+ [case testPEP570Signatures1]
++# flags: --python-version 3.8
+ def f(p1: bytes, p2: float, /, p_or_kw: int, *, kw: str) -> None:
+ reveal_type(p1) # N: Revealed type is "builtins.bytes"
+ reveal_type(p2) # N: Revealed type is "builtins.float"
+@@ -164,6 +171,7 @@ def f(p1: bytes, p2: float, /, p_or_kw: int, *, kw: str) -> None:
+ reveal_type(kw) # N: Revealed type is "builtins.str"
+
+ [case testPEP570Signatures2]
++# flags: --python-version 3.8
+ def f(p1: bytes, p2: float = 0.0, /, p_or_kw: int = 0, *, kw: str) -> None:
+ reveal_type(p1) # N: Revealed type is "builtins.bytes"
+ reveal_type(p2) # N: Revealed type is "builtins.float"
+@@ -171,28 +179,33 @@ def f(p1: bytes, p2: float = 0.0, /, p_or_kw: int = 0, *, kw: str) -> None:
+ reveal_type(kw) # N: Revealed type is "builtins.str"
+
+ [case testPEP570Signatures3]
++# flags: --python-version 3.8
+ def f(p1: bytes, p2: float = 0.0, /, *, kw: int) -> None:
+ reveal_type(p1) # N: Revealed type is "builtins.bytes"
+ reveal_type(p2) # N: Revealed type is "builtins.float"
+ reveal_type(kw) # N: Revealed type is "builtins.int"
+
+ [case testPEP570Signatures4]
++# flags: --python-version 3.8
+ def f(p1: bytes, p2: int = 0, /) -> None:
+ reveal_type(p1) # N: Revealed type is "builtins.bytes"
+ reveal_type(p2) # N: Revealed type is "builtins.int"
+
+ [case testPEP570Signatures5]
++# flags: --python-version 3.8
+ def f(p1: bytes, p2: float, /, p_or_kw: int) -> None:
+ reveal_type(p1) # N: Revealed type is "builtins.bytes"
+ reveal_type(p2) # N: Revealed type is "builtins.float"
+ reveal_type(p_or_kw) # N: Revealed type is "builtins.int"
+
+ [case testPEP570Signatures6]
++# flags: --python-version 3.8
+ def f(p1: bytes, p2: float, /) -> None:
+ reveal_type(p1) # N: Revealed type is "builtins.bytes"
+ reveal_type(p2) # N: Revealed type is "builtins.float"
+
+ [case testPEP570Unannotated]
++# flags: --python-version 3.8
+ def f(arg, /): ... # N: "f" defined here
+ g = lambda arg, /: arg
+ def h(arg=0, /): ... # N: "h" defined here
+@@ -554,6 +567,7 @@ def foo() -> None:
+ [builtins fixtures/dict.pyi]
+
+ [case testOverloadWithPositionalOnlySelf]
++# flags: --python-version 3.8
+ from typing import overload, Optional
+
+ class Foo:
=====================================
debian/patches/series
=====================================
@@ -4,3 +4,5 @@ intersphinx
psutils-in-typeshed
python3.10.3
use_standard_sphinx_theme
+python3.10.7
+python3.19.7-tests
=====================================
debian/patches/use_standard_sphinx_theme
=====================================
@@ -1,15 +1,27 @@
-Author: Michael R. Crusoe <crusoe at debian.org>
-Description: skip the furo docs theme; it is no packaged yet for Debian
+From: "Michael R. Crusoe" <crusoe at debian.org>
+Date: Mon, 26 Sep 2022 11:32:05 +0200
+Subject: skip the furo docs theme; it is no packaged yet for Debian
+
Forwarded: not-needed
---- mypy.orig/docs/requirements-docs.txt
-+++ mypy/docs/requirements-docs.txt
+---
+ docs/requirements-docs.txt | 2 +-
+ docs/source/conf.py | 8 +++++++-
+ mypyc/doc/conf.py | 8 +++++++-
+ 3 files changed, 15 insertions(+), 3 deletions(-)
+
+diff --git a/docs/requirements-docs.txt b/docs/requirements-docs.txt
+index 395964a..7e3d31e 100644
+--- a/docs/requirements-docs.txt
++++ b/docs/requirements-docs.txt
@@ -1,2 +1,2 @@
sphinx>=4.2.0,<5.0.0
-furo>=2022.3.4
+sphinx-rtd-theme>=1.0.0,<2.0.0
---- mypy.orig/docs/source/conf.py
-+++ mypy/docs/source/conf.py
-@@ -103,7 +103,13 @@
+diff --git a/docs/source/conf.py b/docs/source/conf.py
+index 9033dfc..2f42b3e 100644
+--- a/docs/source/conf.py
++++ b/docs/source/conf.py
+@@ -103,7 +103,13 @@ pygments_style = 'sphinx'
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
@@ -24,9 +36,11 @@ Forwarded: not-needed
# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
---- mypy.orig/mypyc/doc/conf.py
-+++ mypy/mypyc/doc/conf.py
-@@ -50,7 +50,13 @@
+diff --git a/mypyc/doc/conf.py b/mypyc/doc/conf.py
+index fa980bb..0d88e9f 100644
+--- a/mypyc/doc/conf.py
++++ b/mypyc/doc/conf.py
+@@ -50,7 +50,13 @@ exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
=====================================
debian/patches/verbose
=====================================
@@ -8,7 +8,7 @@ Forwarded: not-needed
1 file changed, 1 insertion(+)
diff --git a/setup.py b/setup.py
-index 233ad30..2c12231 100644
+index 7999fb2..e3b3763 100644
--- a/setup.py
+++ b/setup.py
@@ -155,6 +155,7 @@ if USE_MYPYC:
=====================================
debian/patches/walrus.patch
=====================================
@@ -1,14 +1,17 @@
-From 9da4fb675dc36f8ea0ebdc38c9ae5e0de27038ac Mon Sep 17 00:00:00 2001
From: Shantanu <12621235+hauntsaninja at users.noreply.github.com>
Date: Wed, 27 Jul 2022 22:06:36 -0700
-Description: Fix walrus tests on Python 3.10+
+Subject: Fix walrus tests on Python 3.10+
+
+From 9da4fb675dc36f8ea0ebdc38c9ae5e0de27038ac Mon Sep 17 00:00:00 2001
+Origin: https://github.com/python/mypy/commit/9da4fb675dc36f8ea0ebdc38c9ae5e0de27038ac
+
Origin: https://github.com/python/mypy/commit/9da4fb675dc36f8ea0ebdc38c9ae5e0de27038ac
---
test-data/unit/check-python38.test | 16 +++++++++++-----
1 file changed, 11 insertions(+), 5 deletions(-)
diff --git a/test-data/unit/check-python38.test b/test-data/unit/check-python38.test
-index 6e21104c3d1..deded7a52f7 100644
+index 6e21104..deded7a 100644
--- a/test-data/unit/check-python38.test
+++ b/test-data/unit/check-python38.test
@@ -210,7 +210,7 @@ h(arg=0) # E: Unexpected keyword argument "arg" for "h"
View it on GitLab: https://salsa.debian.org/python-team/packages/mypy/-/compare/3b80f51fbf1977ee7812fcecbe33f3bd2bc736ab...5e39685c11b6114dd133b718bb9d3cf1bdb02abe
--
View it on GitLab: https://salsa.debian.org/python-team/packages/mypy/-/compare/3b80f51fbf1977ee7812fcecbe33f3bd2bc736ab...5e39685c11b6114dd133b718bb9d3cf1bdb02abe
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/20220926/72acb169/attachment-0001.htm>
More information about the debian-med-commit
mailing list