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