15
0

- 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
This commit is contained in:
2021-05-13 18:20:31 +00:00
committed by Git OBS Bridge
parent 6fcd93ce52
commit 535b17073d
3 changed files with 69 additions and 5 deletions

View File

@@ -1,3 +1,9 @@
-------------------------------------------------------------------
Thu May 13 17:58:59 UTC 2021 - Matej Cepl <mcepl@suse.com>
- 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 <mcalabkova@suse.com>

View File

@@ -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

View File

@@ -0,0 +1,55 @@
From b8a14c2bee11a954b01288669f4b35a5e4d4c493 Mon Sep 17 00:00:00 2001
From: Bryan Forbes <bryan@reigndropsfall.net>
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"