]>
Commit | Line | Data |
---|---|---|
1c4b1841 JB |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without doc # Sphinx documentation | |
48c243fb | 4 | %bcond_without tests # unit tests |
1c4b1841 JB |
5 | |
6 | Summary: Read resources from Python packages | |
7 | Summary(pl.UTF-8): Odczyt zasobów z pakietów Pythona | |
67a852af JP |
8 | Name: python3-importlib_resources |
9 | Version: 5.1.0 | |
930ca83a | 10 | Release: 3 |
1c4b1841 JB |
11 | License: Apache v2.0 |
12 | Group: Libraries/Python | |
13 | #Source0Download: https://pypi.org/simple/importlib-resources/ | |
14 | Source0: https://files.pythonhosted.org/packages/source/i/importlib-resources/importlib_resources-%{version}.tar.gz | |
67a852af | 15 | # Source0-md5: a3ca1dce486f7fba1691938124e54133 |
1c4b1841 JB |
16 | Patch0: %{name}-no_wheel.patch |
17 | URL: https://pypi.org/project/importlib-resources/ | |
67a852af | 18 | BuildRequires: python3-modules >= 1:3.6 |
48c243fb | 19 | BuildRequires: python3-setuptools >= 1:42 |
dffa9cbb | 20 | BuildRequires: python3-setuptools_scm >= 5.0.1-2 |
48c243fb JB |
21 | BuildRequires: python3-toml |
22 | %if %{with tests} | |
23 | BuildRequires: python3-pytest >= 3.5 | |
24 | BuildRequires: python3-pytest-black >= 0.3.7 | |
25 | BuildRequires: python3-pytest-cov | |
26 | BuildRequires: python3-pytest-flake8 | |
27 | %if "%{py3_ver}" < "3.8" | |
28 | BuildRequires: python3-zipp >= 0.4 | |
29 | %endif | |
30 | %endif | |
1c4b1841 JB |
31 | BuildRequires: rpm-pythonprov |
32 | BuildRequires: rpmbuild(macros) >= 1.714 | |
33 | %if %{with doc} | |
48c243fb JB |
34 | BuildRequires: python3-jaraco.packaging >= 8.2 |
35 | BuildRequires: python3-rst.linker >= 1.9 | |
1c4b1841 JB |
36 | BuildRequires: sphinx-pdg-3 |
37 | %endif | |
67a852af | 38 | Requires: python3-modules >= 1:3.6 |
1c4b1841 JB |
39 | BuildArch: noarch |
40 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
41 | ||
42 | %description | |
67a852af JP |
43 | importlib_resources is a backport of Python standard library |
44 | importlib.resources module for older Pythons. Users of Python 3.9 and | |
45 | beyond should use the standard library module, since for these | |
46 | versions, importlib_resources just delegates to that module. | |
1c4b1841 | 47 | |
1c4b1841 JB |
48 | The key goal of this module is to replace parts of pkg_resources with |
49 | a solution in Python's stdlib that relies on well-defined APIs. This | |
50 | makes reading resources included in packages easier, with more stable | |
51 | and consistent semantics. | |
52 | ||
67a852af | 53 | %description -l pl.UTF-8 |
1c4b1841 | 54 | importlib_resources to backport modułu importlib.resources z |
67a852af JP |
55 | biblioteki standardowej Pythona przeznaczony dla starszych wersji |
56 | Pythona. Użytkownicy Pythona 3.9 i nowszego powinni używać modułu z | |
57 | biblioteki standardowej. | |
1c4b1841 JB |
58 | |
59 | Głównym celem tego modułu jest zastąpienie części pkg_resources | |
60 | rozwiązaniem obecnym w bibliotece standardowej Pythona, opartym na | |
61 | dobrze zdefiniowanym API. Czyni to czytanie zasobów z pakietów | |
62 | łatwiejszym, z bardziej stabilną i spójną semantyką. | |
63 | ||
64 | %package apidocs | |
65 | Summary: API documentation for Python importlib_resources module | |
66 | Summary(pl.UTF-8): Dokumentacja API modułu Pythona importlib_resources | |
67 | Group: Documentation | |
68 | ||
69 | %description apidocs | |
70 | API documentation for Python importlib_resources module. | |
71 | ||
72 | %description apidocs -l pl.UTF-8 | |
73 | Dokumentacja API modułu Pythona importlib_resources. | |
74 | ||
75 | %prep | |
76 | %setup -q -n importlib_resources-%{version} | |
77 | %patch0 -p1 | |
78 | ||
79 | %build | |
1c4b1841 JB |
80 | %py3_build |
81 | ||
82 | %if %{with tests} | |
83 | %{__python3} -m unittest discover | |
84 | %endif | |
1c4b1841 JB |
85 | |
86 | %if %{with doc} | |
67a852af | 87 | sphinx-build-3 -b html docs docs/_build/html |
1c4b1841 JB |
88 | %endif |
89 | ||
90 | %install | |
91 | rm -rf $RPM_BUILD_ROOT | |
92 | ||
1c4b1841 | 93 | %py3_install |
1c4b1841 JB |
94 | |
95 | %clean | |
96 | rm -rf $RPM_BUILD_ROOT | |
97 | ||
1c4b1841 JB |
98 | %files |
99 | %defattr(644,root,root,755) | |
48c243fb | 100 | %doc CHANGES.rst LICENSE README.rst |
1c4b1841 JB |
101 | %{py3_sitescriptdir}/importlib_resources |
102 | %{py3_sitescriptdir}/importlib_resources-%{version}-py*.egg-info | |
1c4b1841 JB |
103 | |
104 | %if %{with doc} | |
105 | %files apidocs | |
106 | %defattr(644,root,root,755) | |
107 | %doc docs/_build/html/{_static,*.html,*.js} | |
108 | %endif |