1 # NOTE: for versions >= 5.0 (for python 3.6+) see python3-importlib_resources.spec
4 %bcond_without doc # Sphinx documentation
5 %bcond_without tests # unit tests
6 %bcond_without python2 # CPython 2.x module
7 %bcond_with python3 # CPython 3.x module (built from python3-importlib_resources.spec)
9 Summary: Read resources from Python packages
10 Summary(pl.UTF-8): Odczyt zasobów z pakietów Pythona
11 Name: python-importlib_resources
12 # keep 3.x here for python2 support
16 Group: Libraries/Python
17 #Source0Download: https://pypi.org/simple/importlib-resources/
18 Source0: https://files.pythonhosted.org/packages/source/i/importlib-resources/importlib_resources-%{version}.tar.gz
19 # Source0-md5: 8db307bae9ec6c3c84298d75230e8043
20 URL: https://pypi.org/project/importlib-resources/
22 BuildRequires: python-modules >= 1:2.7
23 BuildRequires: python-setuptools
24 BuildRequires: python-setuptools_scm >= 3.4.1
25 BuildRequires: python-toml
27 BuildRequires: python-contextlib2
28 BuildRequires: python-pathlib2
29 BuildRequires: python-singledispatch
30 BuildRequires: python-typing
31 BuildRequires: python-zipp >= 0.4
35 BuildRequires: python3-modules >= 1:3.6
36 BuildRequires: python3-setuptools
37 BuildRequires: python3-setuptools_scm >= 3.4.1
38 BuildRequires: python3-toml
40 %if "%{py3_ver}" < "3.8"
41 BuildRequires: python3-zipp >= 0.4
45 BuildRequires: rpm-pythonprov
46 BuildRequires: rpmbuild(macros) >= 1.714
48 BuildRequires: python-jaraco.packaging
49 BuildRequires: python-rst.linker
50 BuildRequires: sphinx-pdg-2
52 Requires: python-modules >= 1:2.7
54 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
57 importlib_resources is a backport of Python 3.9's standard library
58 importlib.resources module for Python 2.7, and 3.6 through 3.8. Users
59 of Python 3.9 and beyond should use the standard library module.
61 The key goal of this module is to replace parts of pkg_resources with
62 a solution in Python's stdlib that relies on well-defined APIs. This
63 makes reading resources included in packages easier, with more stable
64 and consistent semantics.
66 %description -l pl.UTF-8
67 importlib_resources to backport modułu importlib.resources z
68 biblioteki standardowej Pythona 3.9, przeznaczony dla Pythona 2.7 oraz
69 od 3.6 do 3.8. Użytkownicy Pythona 3.9 i nowszego powinni używać
70 modułu z biblioteki standardowej.
72 Głównym celem tego modułu jest zastąpienie części pkg_resources
73 rozwiązaniem obecnym w bibliotece standardowej Pythona, opartym na
74 dobrze zdefiniowanym API. Czyni to czytanie zasobów z pakietów
75 łatwiejszym, z bardziej stabilną i spójną semantyką.
77 %package -n python3-importlib_resources
78 Summary: Read resources from Python packages
79 Summary(pl.UTF-8): Odczyt zasobów z pakietów Pythona
80 Group: Libraries/Python
81 Requires: python3-modules >= 1:3.6
83 %description -n python3-importlib_resources
84 importlib_resources is a backport of Python 3.9's standard library
85 importlib.resources module for Python 2.7, and 3.6 through 3.8. Users
86 of Python 3.9 and beyond should use the standard library module.
88 The key goal of this module is to replace parts of pkg_resources with
89 a solution in Python's stdlib that relies on well-defined APIs. This
90 makes reading resources included in packages easier, with more stable
91 and consistent semantics.
93 %description -n python3-importlib_resources -l pl.UTF-8
94 importlib_resources to backport modułu importlib.resources z
95 biblioteki standardowej Pythona 3.9, przeznaczony dla Pythona 2.7 oraz
96 od 3.6 do 3.8. Użytkownicy Pythona 3.9 i nowszego powinni używać
97 modułu z biblioteki standardowej.
99 Głównym celem tego modułu jest zastąpienie części pkg_resources
100 rozwiązaniem obecnym w bibliotece standardowej Pythona, opartym na
101 dobrze zdefiniowanym API. Czyni to czytanie zasobów z pakietów
102 łatwiejszym, z bardziej stabilną i spójną semantyką.
105 Summary: API documentation for Python importlib_resources module
106 Summary(pl.UTF-8): Dokumentacja API modułu Pythona importlib_resources
110 API documentation for Python importlib_resources module.
112 %description apidocs -l pl.UTF-8
113 Dokumentacja API modułu Pythona importlib_resources.
116 %setup -q -n importlib_resources-%{version}
123 %{__python} -m unittest discover
131 %{__python3} -m unittest discover
136 sphinx-build-2 -b html docs docs/_build/html
140 rm -rf $RPM_BUILD_ROOT
153 rm -rf $RPM_BUILD_ROOT
157 %defattr(644,root,root,755)
158 %doc LICENSE README.rst
159 %{py_sitescriptdir}/importlib_resources
160 %{py_sitescriptdir}/importlib_resources-%{version}-py*.egg-info
164 %files -n python3-importlib_resources
165 %defattr(644,root,root,755)
166 %doc LICENSE README.rst
167 %{py3_sitescriptdir}/importlib_resources
168 %{py3_sitescriptdir}/importlib_resources-%{version}-py*.egg-info
173 %defattr(644,root,root,755)
174 %doc docs/_build/html/{_static,*.html,*.js}