diff --git a/python-inflect.spec b/python-inflect.spec index 4aa259e..56eb079 100644 --- a/python-inflect.spec +++ b/python-inflect.spec @@ -25,18 +25,21 @@ License: MIT Group: Development/Languages/Python URL: https://github.com/jaraco/inflect Source0: https://files.pythonhosted.org/packages/source/i/inflect/inflect-%{version}.tar.gz +# PATCH-FIX-UPSTREAM typing_extensions-version.patch bsc#[0-9]+ mcepl@suse.com +# Correct handling of the potential missing Annotated type +Patch0: typing_extensions-version.patch BuildRequires: %{python_module devel >= 3.8} -BuildRequires: %{python_module more-itertools} +BuildRequires: %{python_module more-itertools >= 8.5.0} BuildRequires: %{python_module pip} -Requires: %{python_module typeguard} BuildRequires: %{python_module pytest} BuildRequires: %{python_module setuptools_scm} BuildRequires: %{python_module typeguard} -BuildRequires: %{python_module typing_extensions} +BuildRequires: %{python_module typing_extensions if %python-base < 3.9} BuildRequires: %{python_module wheel} BuildRequires: fdupes BuildRequires: python-rpm-macros -Requires: more-itertools +Requires: %{python_module typeguard} +Requires: python-more-itertools >= 8.5.0 BuildArch: noarch %python_subpackages diff --git a/typing_extensions-version.patch b/typing_extensions-version.patch new file mode 100644 index 0000000..c86b3a1 --- /dev/null +++ b/typing_extensions-version.patch @@ -0,0 +1,16 @@ +--- + inflect/compat/py38.py | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/inflect/compat/py38.py ++++ b/inflect/compat/py38.py +@@ -1,7 +1,7 @@ + import sys + + +-if sys.version_info >= (3, 9): ++try: + from typing import Annotated +-else: # pragma: no cover ++except ImportError: + from typing_extensions import Annotated # noqa: F401