1
1
#
2
- # spec file for python-typing_extensions
2
+ # spec file for package python-typing_extensions
3
3
#
4
4
# Copyright (c) 2022 SUSE LLC
5
5
#
16
16
#
17
17
18
18
19
- %define modname typing_extensions
20
- %{?! python_module:%define python_module() python-%{**} python3-%{**}}
21
- %bcond_without python2
22
- %global flavor @BUILD_FLAVOR@%{nil }
23
- %if "%{flavor }" == "test"
24
- %define psuffix -test
25
- %bcond_without test
26
- %else
27
- %define psuffix %{nil }
28
- %bcond_with test
29
- %endif
30
- Name: python-typing_extensions%{psuffix }
31
- Version: 4.3.0
19
+ Name: python-typing_extensions
20
+ Version: 4.4.0
32
21
Release: 0
33
- Summary: Backported and Experimental Type Hints for Python 35 +
22
+ Summary: Backported and Experimental Type Hints for Python 3.7 +
34
23
License: Python-2.0
35
24
URL: https://github.com/python/typing/
36
- Source0: https://files.pythonhosted.org/packages/source/t/typing_extensions/%{ modname } -%{version }.tar.gz
25
+ Source0: https://files.pythonhosted.org/packages/source/t/typing_extensions/typing_extensions -%{version }.tar.gz
37
26
# See https://github.com/python/typing_extensions/issues/61
38
- Source1: https://raw.githubusercontent.com/python/typing_extensions/main /src/_typed_dict_test_helper.py
39
- BuildRequires: %{python_module flit-core < 4 }
40
- BuildRequires: %{python_module flit-core >= 3.4}
27
+ Source1: https://raw.githubusercontent.com/python/typing_extensions/%{ version } /src/_typed_dict_test_helper.py
28
+ BuildRequires: %{python_module base >= 3.7 }
29
+ BuildRequires: %{python_module flit-core >= 3.4 with % python -flit-core < 4 }
41
30
BuildRequires: %{python_module pip}
31
+ BuildRequires: %{python_module testsuite}
42
32
BuildRequires: fdupes
43
33
BuildRequires: python-rpm-macros
34
+ Provides: python-typing-extensions = %{version }-%{release }
44
35
BuildArch: noarch
45
- Provides: python-typing-extensions = %{version }
46
- %if 0%{?suse_version } > 1320 && %{with test }
47
- BuildRequires: %{python_module testsuite}
48
- %endif
49
- %if %{with python2 }
50
- BuildRequires: python-typing >= 3.7.4
51
- %endif
52
- BuildRequires: (python3-typing >= 3.7.4 if python3-base < 3.5)
53
- %if %{python_version_nodots } < 35
54
- Requires: python-typing >= 3.7.4
55
- %endif
56
36
%python_subpackages
57
37
58
38
%description
59
- The ``typing`` module was added to the standard library in Python
60
- 3.5 on a provisional basis and will no longer be provisional in
61
- Python 3.7. However, this means users of Python 3.5 - 3.6 who are
62
- unable to upgrade will not be able to take advantage of new types
63
- added to the ``typing`` module, such as ``typing.Text`` or
64
- ``typing.Coroutine``.
39
+ The typing_extensions module serves two related purposes:
40
+
41
+ * Enable use of new type system features on older Python versions.
42
+ For example, typing.TypeGuard is new in Python 3.10, but
43
+ typing_extensions allows users on previous Python versions to use
44
+ it too.
45
+ * Enable experimentation with new type system PEPs before they are
46
+ accepted and added to the typing module.
47
+
48
+ New features may be added to typing_extensions as soon as they are
49
+ specified in a PEP that has been added to the python/peps repository.
50
+ If the PEP is accepted, the feature will then be added to typing for
51
+ the next CPython release. No typing PEP has been rejected so far, so
52
+ we haven't yet figured out how to deal with that possibility.
65
53
66
- The ``typing_extensions`` module contains both backports of these
67
- changes as well as experimental types that will eventually be
68
- added to the ``typing`` module, such as ``Protocol``.
54
+ Starting with version 4.0.0, typing_extensions uses Semantic Versioning.
55
+ The major version is incremented for all backwards-incompatible changes.
56
+ Therefore, it's safe to depend on typing_extensions like this:
57
+ typing_extensions >= x.y, < (x+1),
58
+ where x.y is the first version that includes all features you need.
69
59
70
- Users of other Python versions should continue to install and use
71
- the ``typing`` module from PyPi instead of using this one unless
72
- specifically writing code that must be compatible with multiple
73
- Python versions or requires experimental types.
60
+ typing_extensions supports Python versions 3.7 and higher.
61
+ In the future, support for older Python versions will be dropped some time
62
+ after that version reaches end of life.
74
63
75
64
%prep
76
- %setup -q -n %{ modname } -%{version }
65
+ %setup -q -n typing_extensions -%{version }
77
66
# This should not be necessary in the next release
78
67
if [ -f src/_typed_dict_test_helper.py ]; then
79
68
exit 1
@@ -83,24 +72,20 @@ cp %{SOURCE1} src/
83
72
%build
84
73
%pyproject_wheel
85
74
86
- %if ! %{with test }
87
75
%install
88
76
%pyproject_install
89
77
%python_expand %fdupes %{buildroot }%{$python_sitelib }
90
- %endif
91
78
92
- %if %{with test }
93
79
%check
94
- %python_exec src/test_typing_extensions.py
95
- %endif
80
+ pushd src
81
+ %pyunittest -v test_typing_extensions
82
+ popd
96
83
97
- %if ! %{with test }
98
84
%files %{python_files }
99
85
%license LICENSE
100
86
%doc CHANGELOG.md README.md
101
87
%{python_sitelib }/typing_extensions.py*
102
88
%pycache_only %{python_sitelib }/__pycache__/typing_extensions*
103
89
%{python_sitelib }/typing_extensions-%{version }* -info
104
- %endif
105
90
106
91
%changelog
0 commit comments