[med-svn] [Git][python-team/packages/mypy][master] 2 commits: Replace old typing_extensions imports in tests

Colin Watson (@cjwatson) gitlab at salsa.debian.org
Mon Apr 7 18:09:08 BST 2025



Colin Watson pushed to branch master at Debian Python Team / packages / mypy


Commits:
34a6237a by Colin Watson at 2025-04-07T18:08:14+01:00
Replace old typing_extensions imports in tests

Closes: #1101856

- - - - -
092c08d1 by Colin Watson at 2025-04-07T18:08:31+01:00
releasing package mypy version 1.15.0-5

- - - - -


3 changed files:

- debian/changelog
- + debian/patches/replace-old-typing_extensions-imports.patch
- debian/patches/series


Changes:

=====================================
debian/changelog
=====================================
@@ -1,3 +1,10 @@
+mypy (1.15.0-5) unstable; urgency=medium
+
+  * Team upload.
+  * Replace old typing_extensions imports in tests (closes: #1101856).
+
+ -- Colin Watson <cjwatson at debian.org>  Mon, 07 Apr 2025 18:08:15 +0100
+
 mypy (1.15.0-4) unstable; urgency=medium
 
   * Team upload.


=====================================
debian/patches/replace-old-typing_extensions-imports.patch
=====================================
@@ -0,0 +1,107 @@
+From: Marc Mueller <30130371+cdce8p at users.noreply.github.com>
+Date: Sun, 16 Feb 2025 23:39:46 +0100
+Subject: Replace old typing_extensions imports in tests
+
+Origin: upstream, https://github.com/python/mypy/pull/18691
+Bug-Debian: https://bugs.debian.org/1101856
+Last-Update: 2025-04-07
+---
+ mypy/test/teststubtest.py | 29 +++++++++++++++++++++--------
+ 1 file changed, 21 insertions(+), 8 deletions(-)
+
+diff --git a/mypy/test/teststubtest.py b/mypy/test/teststubtest.py
+index f3199da..101b6f6 100644
+--- a/mypy/test/teststubtest.py
++++ b/mypy/test/teststubtest.py
+@@ -48,6 +48,11 @@ Callable: _SpecialForm = ...
+ Generic: _SpecialForm = ...
+ Protocol: _SpecialForm = ...
+ Union: _SpecialForm = ...
++ClassVar: _SpecialForm = ...
++
++Final = 0
++Literal = 0
++TypedDict = 0
+ 
+ class TypeVar:
+     def __init__(self, name, covariant: bool = ..., contravariant: bool = ...) -> None: ...
+@@ -71,6 +76,12 @@ class Match(Generic[AnyStr]): ...
+ class Sequence(Iterable[_T_co]): ...
+ class Tuple(Sequence[_T_co]): ...
+ class NamedTuple(tuple[Any, ...]): ...
++class _TypedDict(Mapping[str, object]):
++    __required_keys__: ClassVar[frozenset[str]]
++    __optional_keys__: ClassVar[frozenset[str]]
++    __total__: ClassVar[bool]
++    __readonly_keys__: ClassVar[frozenset[str]]
++    __mutable_keys__: ClassVar[frozenset[str]]
+ def overload(func: _T) -> _T: ...
+ def type_check_only(func: _T) -> _T: ...
+ def final(func: _T) -> _T: ...
+@@ -95,6 +106,8 @@ class tuple(Sequence[T_co], Generic[T_co]):
+ 
+ class dict(Mapping[KT, VT]): ...
+ 
++class frozenset(Generic[T]): ...
++
+ class function: pass
+ class ellipsis: pass
+ 
+@@ -1373,7 +1386,7 @@ class StubtestUnit(unittest.TestCase):
+         )
+         yield Case(
+             stub="""
+-            from typing_extensions import Final, Literal
++            from typing import Final, Literal
+             class BytesEnum(bytes, enum.Enum):
+                 a = b'foo'
+             FOO: Literal[BytesEnum.a]
+@@ -1915,7 +1928,7 @@ assert annotations
+     def test_good_literal(self) -> Iterator[Case]:
+         yield Case(
+             stub=r"""
+-            from typing_extensions import Literal
++            from typing import Literal
+ 
+             import enum
+             class Color(enum.Enum):
+@@ -1947,7 +1960,7 @@ assert annotations
+ 
+     @collect_cases
+     def test_bad_literal(self) -> Iterator[Case]:
+-        yield Case("from typing_extensions import Literal", "", None)  # dummy case
++        yield Case("from typing import Literal", "", None)  # dummy case
+         yield Case(
+             stub="INT_FLOAT_MISMATCH: Literal[1]",
+             runtime="INT_FLOAT_MISMATCH = 1.0",
+@@ -1998,7 +2011,7 @@ assert annotations
+         )
+         yield Case(
+             stub="""
+-            from typing_extensions import TypedDict
++            from typing import TypedDict
+ 
+             class _Options(TypedDict):
+                 a: str
+@@ -2019,8 +2032,8 @@ assert annotations
+     @collect_cases
+     def test_runtime_typing_objects(self) -> Iterator[Case]:
+         yield Case(
+-            stub="from typing_extensions import Protocol, TypedDict",
+-            runtime="from typing_extensions import Protocol, TypedDict",
++            stub="from typing import Protocol, TypedDict",
++            runtime="from typing import Protocol, TypedDict",
+             error=None,
+         )
+         yield Case(
+@@ -2385,8 +2398,8 @@ assert annotations
+         )
+         # The same is true for NamedTuples and TypedDicts:
+         yield Case(
+-            stub="from typing_extensions import NamedTuple, TypedDict",
+-            runtime="from typing_extensions import NamedTuple, TypedDict",
++            stub="from typing import NamedTuple, TypedDict",
++            runtime="from typing import NamedTuple, TypedDict",
+             error=None,
+         )
+         yield Case(


=====================================
debian/patches/series
=====================================
@@ -3,3 +3,4 @@ verbose
 intersphinx
 gnu-hurd-getsockname
 0005-pythoncapi_compat-don-t-define-Py_NULL-if-it-is-alre.patch
+replace-old-typing_extensions-imports.patch



View it on GitLab: https://salsa.debian.org/python-team/packages/mypy/-/compare/d87885ecf2f8c6ec037d81f2c50874c80912996d...092c08d1e4c633254d08c790eabd0d4a909f47ca

-- 
View it on GitLab: https://salsa.debian.org/python-team/packages/mypy/-/compare/d87885ecf2f8c6ec037d81f2c50874c80912996d...092c08d1e4c633254d08c790eabd0d4a909f47ca
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/20250407/faf6dd35/attachment-0001.htm>


More information about the debian-med-commit mailing list