-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpython3-propcache.spec
88 lines (74 loc) · 2.15 KB
/
python3-propcache.spec
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# Conditional build:
%bcond_without doc # API documentation
%bcond_without tests # unit tests
%define module propcache
Summary: Accelerated property cache
Name: python3-%{module}
Version: 0.2.1
Release: 1
License: Apache
Group: Libraries/Python
Source0: https://pypi.debian.net/%{module}/%{module}-%{version}.tar.gz
# Source0-md5: c642caac1415818205011277008142ea
URL: https://pypi.org/project/propcache/
BuildRequires: python3-Cython
BuildRequires: python3-build
BuildRequires: python3-installer
BuildRequires: python3-modules >= 1:3.9
%if %{with tests}
BuildRequires: python3-pytest-xdist
%endif
BuildRequires: rpm-pythonprov
BuildRequires: rpmbuild(macros) >= 2.044
%if %{with doc}
BuildRequires: sphinx-pdg-3
%endif
Requires: python3-modules >= 1:3.2
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
%description
The module provides a fast implementation of cached properties for
Python 3.9+.
%package apidocs
Summary: API documentation for Python %{module} module
Summary(pl.UTF-8): Dokumentacja API modułu Pythona %{module}
Group: Documentation
%description apidocs
API documentation for Python %{module} module.
%description apidocs -l pl.UTF-8
Dokumentacja API modułu Pythona %{module}.
%prep
%setup -q -n %{module}-%{version}
%build
%py3_build_pyproject
%if %{with tests}
%{__python} -m zipfile -e build-3/*.whl build-3-test
# use explicit plugins list for reliable builds (delete PYTEST_PLUGINS if empty)
PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
PYTEST_PLUGINS=pytest_codspeed,xdist,benchmark \
%{__python3} -m pytest -o pythonpath="$PWD/build-3-test" tests
%endif
%if %{with doc}
%{__make} -C docs html \
SPHINXBUILD=sphinx-build-3
rm -rf docs/_build/html/_sources
%endif
%install
rm -rf $RPM_BUILD_ROOT
%py3_install_pyproject
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(644,root,root,755)
%doc CHANGES.rst README.rst
%dir %{py3_sitedir}/%{module}
%{py3_sitedir}/%{module}/*.py
%{py3_sitedir}/%{module}/*.pyx
%{py3_sitedir}/%{module}/py.typed
%{py3_sitedir}/%{module}/__pycache__
%attr(755,root,root) %{py3_sitedir}/%{module}/*.so
%{py3_sitedir}/%{module}-%{version}.dist-info
%if %{with doc}
%files apidocs
%defattr(644,root,root,755)
%doc docs/_build/html/*
%endif