From 535b17073d212d6458d38e58eb12de485a471d5f192e995b15dc22dc96b02b46 Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Thu, 13 May 2021 18:20:31 +0000 Subject: [PATCH] - Add stdlib-typing_extensions.patch making typing_extensions package just an optional requirement (gh#omnilib/aioitertools#49). OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-aioitertools?expand=0&rev=3 --- python-aioitertools.changes | 6 ++++ python-aioitertools.spec | 13 ++++---- stdlib-typing_extensions.patch | 55 ++++++++++++++++++++++++++++++++++ 3 files changed, 69 insertions(+), 5 deletions(-) create mode 100644 stdlib-typing_extensions.patch diff --git a/python-aioitertools.changes b/python-aioitertools.changes index 4128523..2d4ea05 100644 --- a/python-aioitertools.changes +++ b/python-aioitertools.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Thu May 13 17:58:59 UTC 2021 - Matej Cepl + +- Add stdlib-typing_extensions.patch making typing_extensions + package just an optional requirement (gh#omnilib/aioitertools#49). + ------------------------------------------------------------------- Fri Jul 3 13:03:16 UTC 2020 - Marketa Calabkova diff --git a/python-aioitertools.spec b/python-aioitertools.spec index 5634957..494b30e 100644 --- a/python-aioitertools.spec +++ b/python-aioitertools.spec @@ -1,7 +1,7 @@ # # spec file for package python-aioitertools # -# Copyright (c) 2020 SUSE LLC +# Copyright (c) 2021 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -26,12 +26,15 @@ License: MIT Group: Development/Languages/Python URL: https://aioitertools.omnilib.dev Source: https://files.pythonhosted.org/packages/source/a/aioitertools/aioitertools-%{version}.tar.gz +# PATCH-FIX-UPSTREAM stdlib-typing_extensions.patch gh#omnilib/aioitertools#49 mcepl@suse.com +# Improve dependencies for Python 3.8+ +Patch0: stdlib-typing_extensions.patch BuildRequires: %{python_module asyncio} BuildRequires: %{python_module setuptools} -BuildRequires: %{python_module typing_extensions >= 3.7} +BuildRequires: %{python_module typing_extensions if %python-base < 3.8} BuildRequires: fdupes BuildRequires: python-rpm-macros -Requires: python-typing_extensions >= 3.7 +Requires: (python3-typing_extensions >= 3.7 if python3-base < 3.8) BuildArch: noarch %python_subpackages @@ -39,7 +42,7 @@ BuildArch: noarch Implementation of itertools, builtins, and more for AsyncIO and mixed-type iterables. %prep -%setup -q -n aioitertools-%{version} +%autosetup -p1 -n aioitertools-%{version} %build %python_build @@ -49,7 +52,7 @@ Implementation of itertools, builtins, and more for AsyncIO and mixed-type itera %python_expand %fdupes %{buildroot}%{$python_sitelib} %check -%python_expand PYTHONPATH=%{buildroot}%{$python_sitelib} $python -m unittest discover +%pyunittest discover -v %files %{python_files} %doc README.md CHANGELOG.md diff --git a/stdlib-typing_extensions.patch b/stdlib-typing_extensions.patch new file mode 100644 index 0000000..31a1fd6 --- /dev/null +++ b/stdlib-typing_extensions.patch @@ -0,0 +1,55 @@ +From b8a14c2bee11a954b01288669f4b35a5e4d4c493 Mon Sep 17 00:00:00 2001 +From: Bryan Forbes +Date: Mon, 4 Jan 2021 19:26:31 -0600 +Subject: [PATCH] Improve dependencies for Python 3.8+ + +--- + aioitertools/helpers.py | 8 ++++++-- + pyproject.toml | 2 +- + requirements.txt | 2 +- + 3 files changed, 8 insertions(+), 4 deletions(-) + +diff --git a/aioitertools/helpers.py b/aioitertools/helpers.py +index 44a3f26..2133233 100644 +--- a/aioitertools/helpers.py ++++ b/aioitertools/helpers.py +@@ -2,12 +2,16 @@ + # Licensed under the MIT license + + import inspect ++import sys + from typing import Awaitable, Union + +-from typing_extensions import Protocol +- + from .types import T + ++if sys.version_info < (3, 8): ++ from typing_extensions import Protocol ++else: ++ from typing import Protocol # pylint: disable=no-name-in-module ++ + + class Orderable(Protocol): # pragma: no cover + def __lt__(self, other): +diff --git a/pyproject.toml b/pyproject.toml +index 0a29286..d01886d 100644 +--- a/pyproject.toml ++++ b/pyproject.toml +@@ -8,7 +8,7 @@ author = "John Reese" + author-email = "john@noswap.com" + description-file = "README.md" + home-page = "https://aioitertools.omnilib.dev" +-requires = ["typing_extensions>=3.7"] ++requires = ["typing_extensions>=3.7; python_version < '3.8'"] + requires-python = ">=3.6" + classifiers = [ + "Development Status :: 4 - Beta", +diff --git a/requirements.txt b/requirements.txt +index 4ab797e..264c3c0 100644 +--- a/requirements.txt ++++ b/requirements.txt +@@ -1 +1 @@ +-typing_extensions>=3.7 +\ No newline at end of file ++typing_extensions>=3.7;python_version<"3.8"