- Add stdlib-typing_extensions.patch to avoid necessity for BR

python-typing_extensions (gh#aio-libs/aiohttp#5374).

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-aiohttp?expand=0&rev=62
This commit is contained in:
Matej Cepl 2021-05-13 22:26:12 +00:00 committed by Git OBS Bridge
parent a2d8fc6328
commit 88044c4f35
3 changed files with 73 additions and 4 deletions

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Thu May 13 21:58:35 UTC 2021 - Matej Cepl <mcepl@suse.com>
- Add stdlib-typing_extensions.patch to avoid necessity for BR
python-typing_extensions (gh#aio-libs/aiohttp#5374).
-------------------------------------------------------------------
Sun Feb 28 13:09:40 UTC 2021 - Michael Ströder <michael@stroeder.com>

View File

@ -26,6 +26,9 @@ License: Apache-2.0
URL: https://github.com/aio-libs/aiohttp
Source: https://files.pythonhosted.org/packages/source/a/aiohttp/aiohttp-%{version}.tar.gz
Patch0: unbundle-http-parser.patch
# PATCH-FIX-UPSTREAM stdlib-typing_extensions.patch gh#aio-libs/aiohttp#5374 mcepl@suse.com
# Fix typing_extensions imports.
Patch1: stdlib-typing_extensions.patch
BuildRequires: %{python_module Cython}
BuildRequires: %{python_module async_timeout >= 3.0}
BuildRequires: %{python_module attrs >= 17.3.0}
@ -35,7 +38,7 @@ BuildRequires: %{python_module freezegun}
BuildRequires: %{python_module idna_ssl >= 1.0}
BuildRequires: %{python_module multidict >= 4.5}
BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module typing_extensions >= 3.6.5}
BuildRequires: %{python_module typing_extensions >= 3.6.5 if %python-base < 3.8}
BuildRequires: %{python_module yarl >= 1.0}
BuildRequires: fdupes
BuildRequires: http-parser-devel
@ -46,8 +49,8 @@ Requires: python-attrs >= 17.3.0
Requires: python-chardet >= 2.0
Requires: python-gunicorn
Requires: python-multidict >= 4.5
Requires: python-typing_extensions >= 3.6.5
Requires: python-yarl >= 1.0
Requires: (python3-typing_extensions >= 3.6.5 if python3-base < 3.8)
Recommends: python-aiodns
Recommends: python-brotlipy
Recommends: python-cChardet
@ -94,8 +97,8 @@ Asynchronous HTTP client/server framework for Python.
HTML documentation on the API and examples for %{name}.
%prep
%setup -q -n aiohttp-%{version}
%patch0 -p1
%autosetup -p1 -n aiohttp-%{version}
# Prevent building with vendor version
rm vendor/http-parser/*.c

View File

@ -0,0 +1,60 @@
---
aiohttp/helpers.py | 5 ++++-
aiohttp/tracing.py | 5 ++++-
aiohttp/web_urldispatcher.py | 5 ++++-
setup.py | 2 +-
4 files changed, 13 insertions(+), 4 deletions(-)
--- a/aiohttp/helpers.py
+++ b/aiohttp/helpers.py
@@ -45,7 +45,10 @@ from urllib.request import getproxies
import async_timeout
import attr
from multidict import MultiDict, MultiDictProxy
-from typing_extensions import Protocol
+try:
+ from typing import Protocol
+except (ImportError, ModuleNotFoundError):
+ from typing_extensions import Protocol
from yarl import URL
from . import hdrs
--- a/aiohttp/tracing.py
+++ b/aiohttp/tracing.py
@@ -9,7 +9,10 @@ from .client_reqrep import ClientRespons
from .signals import Signal
if TYPE_CHECKING: # pragma: no cover
- from typing_extensions import Protocol
+ try:
+ from typing import Protocol
+ except (ImportError, ModuleNotFoundError):
+ from typing_extensions import Protocol
from .client import ClientSession
--- a/aiohttp/web_urldispatcher.py
+++ b/aiohttp/web_urldispatcher.py
@@ -33,7 +33,10 @@ from typing import (
cast,
)
-from typing_extensions import TypedDict
+try:
+ from typing import TypedDict
+except (ImportError, ModuleNotFoundError):
+ from typing_extensions import TypedDict
from yarl import URL, __version__ as yarl_version # type: ignore
from . import hdrs
--- a/setup.py
+++ b/setup.py
@@ -70,7 +70,7 @@ install_requires = [
"async_timeout>=3.0,<4.0",
"yarl>=1.0,<2.0",
'idna-ssl>=1.0; python_version<"3.7"',
- "typing_extensions>=3.6.5",
+ 'typing_extensions>=3.7.4; python_version<"3.8"',
]