1
0

Compare commits

2 Commits

Author SHA256 Message Date
b1f28936b4 Accepting request 1219372 from devel:languages:python
- add patch support-mypy-1.11.patch so we can support this package
  until all software moved to the newer trio (forwarded request 1219371 from rrahl0)

OBS-URL: https://build.opensuse.org/request/show/1219372
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-trio-typing?expand=0&rev=2
2024-10-30 16:38:41 +00:00
Richard Rahl
c967706ac6 - add patch support-mypy-1.11.patch so we can support this package
until all software moved to the newer trio

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-trio-typing?expand=0&rev=3
2024-10-30 09:20:48 +00:00
3 changed files with 63 additions and 3 deletions

View File

@@ -1,3 +1,9 @@
-------------------------------------------------------------------
Wed Oct 30 09:19:13 UTC 2024 - Richard Rahl <rrahl0@opensuse.org>
- add patch support-mypy-1.11.patch so we can support this package
until all software moved to the newer trio
-------------------------------------------------------------------
Mon Mar 25 07:51:35 UTC 2024 - Richard Rahl <rrahl0@proton.me>

View File

@@ -21,19 +21,21 @@ Name: python-trio-typing
Version: 0.10.0
Release: 0
Summary: Static type checking support for Trio and related projects
License: MIT OR Apache-2.0
License: Apache-2.0 OR MIT
URL: https://github.com/python-trio/trio-typing
Source: https://files.pythonhosted.org/packages/source/t/trio-typing/trio-typing-%{version}.tar.gz
BuildRequires: python-rpm-macros
## https://github.com/python-trio/trio-typing/pull/97
Patch0: support-mypy-1.11.patch
BuildRequires: %{python_module pip}
BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module wheel}
BuildRequires: python-rpm-macros
# SECTION test requirements
BuildRequires: %{python_module pytest}
BuildRequires: %{python_module mypy}
BuildRequires: %{python_module async_generator}
BuildRequires: %{python_module importlib-metadata}
BuildRequires: %{python_module mypy_extensions >= 0.4.2}
BuildRequires: %{python_module mypy}
BuildRequires: %{python_module packaging}
BuildRequires: %{python_module trio >= 0.16.0}
BuildRequires: %{python_module typing_extensions >= 3.7.4}

52
support-mypy-1.11.patch Normal file
View File

@@ -0,0 +1,52 @@
From 5e00c376a93fa5a1b0213ae1f9d7cc3f717bb922 Mon Sep 17 00:00:00 2001
From: Redoubts <Redoubts@users.noreply.github.com>
Date: Wed, 25 Sep 2024 21:21:33 -0400
Subject: [PATCH] Update plugin.py
Use TypeVarId for mypy 1.11
Don't use is_noreturn
---
trio_typing/plugin.py | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/trio_typing/plugin.py b/trio_typing/plugin.py
index 31f4887..76ccbbf 100644
--- a/trio_typing/plugin.py
+++ b/trio_typing/plugin.py
@@ -22,6 +22,7 @@
Overloaded,
TypeVarLikeType,
TypeVarType,
+ TypeVarId,
Instance,
UnionType,
UninhabitedType,
@@ -134,9 +135,7 @@ def decode_agen_types_from_return_type(
return (
yield_type,
send_type,
- UninhabitedType(
- is_noreturn=True, line=ctx.context.line, column=ctx.context.column
- ),
+ UninhabitedType(line=ctx.context.line, column=ctx.context.column),
)
else:
return (
@@ -464,7 +463,7 @@ def start_soon(
TypeVarType(
"__T{}".format(arg_idx),
"__T{}".format(arg_idx),
- -len(fn_type.variables) - arg_idx - 1,
+ TypeVarId(-len(fn_type.variables) - arg_idx - 1),
[],
ctx.api.named_generic_type("builtins.object", []),
line=ctx.context.line,
@@ -477,7 +476,7 @@ def start_soon(
TypeVarType(
"__T{}".format(arg_idx),
"__T{}".format(arg_idx),
- -len(fn_type.variables) - arg_idx - 1,
+ TypeVarId(-len(fn_type.variables) - arg_idx - 1),
[],
ctx.api.named_generic_type("builtins.object", []),
line=ctx.context.line,