]>
Commit | Line | Data |
---|---|---|
e01687ac JK |
1 | # |
2 | # Conditional build: | |
bfd07881 JB |
3 | %bcond_without doc # Sphinx documentation |
4 | %bcond_without tests # unit tests | |
e01687ac JK |
5 | |
6 | %define pypi_name backports.functools_lru_cache | |
7 | ||
8 | Summary: Backport of functools.lru_cache from Python 3.3 | |
bfd07881 | 9 | Summary(pl.UTF-8): Backport functools.lru_cache z Pythona 3.3 |
e01687ac | 10 | Name: python-%{pypi_name} |
adda5a1a JB |
11 | Version: 1.6.4 |
12 | Release: 1 | |
e01687ac JK |
13 | License: MIT |
14 | Group: Libraries/Python | |
bfd07881 JB |
15 | #Source0Download: https://pypi.org/simple/backports.functools_lru_cache/ |
16 | Source0: https://files.pythonhosted.org/packages/source/b/backports.functools_lru_cache/%{pypi_name}-%{version}.tar.gz | |
adda5a1a | 17 | # Source0-md5: 8fed424f30bf9554235aa02997b7574c |
e01687ac | 18 | URL: https://github.com/jaraco/backports.functools_lru_cache |
bfd07881 | 19 | BuildRequires: python-modules >= 1:2.6 |
e01687ac | 20 | BuildRequires: python-setuptools |
adda5a1a JB |
21 | BuildRequires: python-setuptools_scm >= 3.4.1 |
22 | BuildRequires: python-toml | |
bfd07881 | 23 | %if %{with tests} |
adda5a1a | 24 | BuildRequires: python-pytest >= 4.6 |
bfd07881 | 25 | %endif |
e01687ac JK |
26 | BuildRequires: rpm-pythonprov |
27 | BuildRequires: rpmbuild(macros) >= 1.714 | |
bfd07881 | 28 | %if %{with doc} |
adda5a1a JB |
29 | BuildRequires: python3-jaraco.packaging >= 8.2 |
30 | BuildRequires: python3-rst.linker >= 1.9 | |
31 | BuildRequires: sphinx-pdg-3 | |
bfd07881 | 32 | %endif |
e01687ac | 33 | Requires: python-backports |
bfd07881 | 34 | Requires: python-modules >= 1:2.6 |
e01687ac JK |
35 | BuildArch: noarch |
36 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
37 | ||
38 | %description | |
39 | Backport of functools.lru_cache from Python 3.3. | |
40 | ||
bfd07881 JB |
41 | %description |
42 | Backport functools.lru_cache z Pythona 3.3. | |
43 | ||
44 | %package apidocs | |
45 | Summary: API documentation for Python backports.functools_lru_cache module | |
46 | Summary(pl.UTF-8): Dokumentacja API modułu Pythona backports.functools_lru_cache | |
47 | Group: Documentation | |
48 | ||
49 | %description apidocs | |
50 | API documentation for Python backports.functools_lru_cache module. | |
51 | ||
52 | %description apidocs -l pl.UTF-8 | |
53 | Dokumentacja API modułu Pythona backports.functools_lru_cache. | |
54 | ||
e01687ac JK |
55 | %prep |
56 | %setup -q -n %{pypi_name}-%{version} | |
57 | ||
58 | %build | |
bfd07881 JB |
59 | %py_build |
60 | ||
61 | %if %{with tests} | |
adda5a1a | 62 | PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \ |
bfd07881 JB |
63 | %{__python} -m pytest tests |
64 | %endif | |
65 | ||
66 | %if %{with doc} | |
67 | cd docs | |
adda5a1a | 68 | sphinx-build-3 -b html . _build/html |
bfd07881 | 69 | %endif |
e01687ac JK |
70 | |
71 | %install | |
72 | rm -rf $RPM_BUILD_ROOT | |
73 | ||
74 | %py_install | |
75 | ||
76 | %py_postclean | |
77 | ||
bfd07881 | 78 | %{__rm} $RPM_BUILD_ROOT%{py_sitescriptdir}/backports/__init__.* |
e01687ac JK |
79 | |
80 | %clean | |
81 | rm -rf $RPM_BUILD_ROOT | |
82 | ||
83 | %files | |
84 | %defattr(644,root,root,755) | |
bfd07881 | 85 | %doc CHANGES.rst LICENSE README.rst |
e01687ac JK |
86 | %{py_sitescriptdir}/backports/functools_lru_cache.py[co] |
87 | %{py_sitescriptdir}/%{pypi_name}-%{version}-py*.egg-info | |
bfd07881 JB |
88 | |
89 | %if %{with doc} | |
90 | %files apidocs | |
91 | %defattr(644,root,root,755) | |
92 | %doc docs/_build/html/{_static,*.html,*.js} | |
93 | %endif |