2018-10-23 17:53:13 +02:00
|
|
|
#
|
2022-09-06 12:28:45 +02:00
|
|
|
# spec file for python-typing_extensions
|
2018-10-23 17:53:13 +02:00
|
|
|
#
|
2022-04-20 13:34:56 +02:00
|
|
|
# Copyright (c) 2022 SUSE LLC
|
2018-10-23 17:53:13 +02:00
|
|
|
#
|
|
|
|
# All modifications and additions to the file contributed by third parties
|
|
|
|
# remain the property of their copyright owners, unless otherwise agreed
|
|
|
|
# upon. The license for this file, and modifications and additions to the
|
|
|
|
# file, is the same license as for the pristine package itself (unless the
|
|
|
|
# license for the pristine package is not an Open Source License, in which
|
|
|
|
# case the license is the MIT License). An "Open Source License" is a
|
|
|
|
# license that conforms to the Open Source Definition (Version 1.9)
|
|
|
|
# published by the Open Source Initiative.
|
|
|
|
|
2018-12-06 12:56:31 +01:00
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
|
|
|
#
|
|
|
|
|
2018-10-23 17:53:13 +02:00
|
|
|
|
|
|
|
%define modname typing_extensions
|
|
|
|
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
|
2020-03-12 08:52:18 +01:00
|
|
|
%bcond_without python2
|
2021-01-12 17:26:42 +01:00
|
|
|
%global flavor @BUILD_FLAVOR@%{nil}
|
|
|
|
%if "%{flavor}" == "test"
|
|
|
|
%define psuffix -test
|
|
|
|
%bcond_without test
|
|
|
|
%else
|
|
|
|
%define psuffix %{nil}
|
|
|
|
%bcond_with test
|
|
|
|
%endif
|
|
|
|
Name: python-typing_extensions%{psuffix}
|
2022-09-06 12:28:45 +02:00
|
|
|
Version: 4.3.0
|
2018-10-23 17:53:13 +02:00
|
|
|
Release: 0
|
|
|
|
Summary: Backported and Experimental Type Hints for Python 35+
|
2018-12-06 12:56:31 +01:00
|
|
|
License: Python-2.0
|
|
|
|
URL: https://github.com/python/typing/
|
|
|
|
Source0: https://files.pythonhosted.org/packages/source/t/typing_extensions/%{modname}-%{version}.tar.gz
|
2022-09-06 12:28:45 +02:00
|
|
|
# See https://github.com/python/typing_extensions/issues/61
|
|
|
|
Source1: https://raw.githubusercontent.com/python/typing_extensions/main/src/_typed_dict_test_helper.py
|
2022-04-20 13:34:56 +02:00
|
|
|
BuildRequires: %{python_module flit-core < 4}
|
|
|
|
BuildRequires: %{python_module flit-core >= 3.4}
|
|
|
|
BuildRequires: %{python_module pip}
|
2020-03-12 08:52:18 +01:00
|
|
|
BuildRequires: fdupes
|
|
|
|
BuildRequires: python-rpm-macros
|
|
|
|
BuildArch: noarch
|
2020-12-20 10:11:38 +01:00
|
|
|
Provides: python-typing-extensions = %{version}
|
2021-01-12 17:26:42 +01:00
|
|
|
%if 0%{?suse_version} > 1320 && %{with test}
|
2020-11-04 01:13:29 +01:00
|
|
|
BuildRequires: %{python_module testsuite}
|
2019-03-02 14:59:52 +01:00
|
|
|
%endif
|
2021-01-12 16:23:06 +01:00
|
|
|
%if %{with python2}
|
|
|
|
BuildRequires: python-typing >= 3.7.4
|
2019-03-02 14:59:52 +01:00
|
|
|
%endif
|
2021-01-12 16:23:06 +01:00
|
|
|
BuildRequires: (python3-typing >= 3.7.4 if python3-base < 3.5)
|
|
|
|
%if %{python_version_nodots} < 35
|
2020-03-12 08:52:18 +01:00
|
|
|
Requires: python-typing >= 3.7.4
|
2019-03-02 14:59:52 +01:00
|
|
|
%endif
|
2018-10-23 17:53:13 +02:00
|
|
|
%python_subpackages
|
|
|
|
|
|
|
|
%description
|
|
|
|
The ``typing`` module was added to the standard library in Python
|
|
|
|
3.5 on a provisional basis and will no longer be provisional in
|
|
|
|
Python 3.7. However, this means users of Python 3.5 - 3.6 who are
|
|
|
|
unable to upgrade will not be able to take advantage of new types
|
|
|
|
added to the ``typing`` module, such as ``typing.Text`` or
|
|
|
|
``typing.Coroutine``.
|
|
|
|
|
|
|
|
The ``typing_extensions`` module contains both backports of these
|
|
|
|
changes as well as experimental types that will eventually be
|
|
|
|
added to the ``typing`` module, such as ``Protocol``.
|
|
|
|
|
|
|
|
Users of other Python versions should continue to install and use
|
|
|
|
the ``typing`` module from PyPi instead of using this one unless
|
|
|
|
specifically writing code that must be compatible with multiple
|
|
|
|
Python versions or requires experimental types.
|
|
|
|
|
|
|
|
%prep
|
|
|
|
%setup -q -n %{modname}-%{version}
|
2022-09-06 12:28:45 +02:00
|
|
|
# This should not be necessary in the next release
|
|
|
|
if [ -f src/_typed_dict_test_helper.py ]; then
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
cp %{SOURCE1} src/
|
2018-10-23 17:53:13 +02:00
|
|
|
|
|
|
|
%build
|
2022-04-20 13:34:56 +02:00
|
|
|
%pyproject_wheel
|
2018-10-23 17:53:13 +02:00
|
|
|
|
2021-01-12 17:26:42 +01:00
|
|
|
%if ! %{with test}
|
2018-10-23 17:53:13 +02:00
|
|
|
%install
|
2022-04-20 13:34:56 +02:00
|
|
|
%pyproject_install
|
2021-01-12 17:26:42 +01:00
|
|
|
%python_expand %fdupes %{buildroot}%{$python_sitelib}
|
|
|
|
%endif
|
2018-10-23 17:53:13 +02:00
|
|
|
|
2021-01-12 17:26:42 +01:00
|
|
|
%if %{with test}
|
2018-10-23 17:53:13 +02:00
|
|
|
%check
|
2022-04-20 13:34:56 +02:00
|
|
|
%python_exec src/test_typing_extensions.py
|
2021-01-12 17:26:42 +01:00
|
|
|
%endif
|
2018-10-23 17:53:13 +02:00
|
|
|
|
2021-01-12 17:26:42 +01:00
|
|
|
%if ! %{with test}
|
2018-10-23 17:53:13 +02:00
|
|
|
%files %{python_files}
|
2018-12-06 12:56:31 +01:00
|
|
|
%license LICENSE
|
2022-09-06 12:28:45 +02:00
|
|
|
%doc CHANGELOG.md README.md
|
2021-01-12 16:23:06 +01:00
|
|
|
%{python_sitelib}/typing_extensions.py*
|
|
|
|
%pycache_only %{python_sitelib}/__pycache__/typing_extensions*
|
|
|
|
%{python_sitelib}/typing_extensions-%{version}*-info
|
2021-01-12 17:26:42 +01:00
|
|
|
%endif
|
2018-10-23 17:53:13 +02:00
|
|
|
|
|
|
|
%changelog
|