]>
Commit | Line | Data |
---|---|---|
3ecdc3da ER |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without doc # don't build doc | |
4 | %bcond_with tests # do not perform "make test" | |
5 | %bcond_without python2 # CPython 2.x module | |
6 | %bcond_without python3 # CPython 3.x module | |
7 | ||
8 | %define module cached_property | |
9 | Summary: A cached-property for decorating methods in Python classes | |
10 | Name: python-%{module} | |
11 | Version: 1.3.0 | |
1f536287 | 12 | Release: 5 |
3ecdc3da ER |
13 | License: BSD |
14 | Group: Libraries/Python | |
15 | Source0: https://github.com/pydanny/cached-property/archive/34b1caf8/cached-property-%{version}.tar.gz | |
16 | # Source0-md5: 973727514d27e4f4a07358802c4943dc | |
17 | URL: https://github.com/pydanny/cached-property | |
18 | BuildRequires: rpm-pythonprov | |
19 | BuildRequires: rpmbuild(macros) >= 1.714 | |
20 | %if %{with python2} | |
21 | BuildRequires: python-modules | |
22 | BuildRequires: python-setuptools | |
23 | %if %{with tests} | |
24 | BuildRequires: python-freezegun | |
25 | BuildRequires: python-pytest | |
26 | BuildRequires: python-tox >= 1.7.2 | |
27 | %endif | |
28 | %endif | |
29 | %if %{with python3} | |
30 | BuildRequires: python3-modules | |
31 | BuildRequires: python3-setuptools | |
32 | %if %{with tests} | |
33 | BuildRequires: python3-freezegun | |
34 | BuildRequires: python3-pytest | |
35 | %endif | |
36 | %endif | |
37 | BuildArch: noarch | |
38 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
39 | ||
40 | %description | |
41 | cached_property allows properties in Python classes to be cached until | |
42 | the cache is invalidated or expired. | |
43 | ||
44 | %package -n python3-%{module} | |
45 | Summary: A cached-property for decorating methods in Python classes | |
46 | Group: Libraries/Python | |
47 | ||
48 | %description -n python3-%{module} | |
49 | cached_property allows properties in Python classes to be cached until | |
50 | the cache is invalidated or expired. | |
51 | ||
52 | %prep | |
53 | %setup -qc | |
54 | mv cached-property-*/* . | |
55 | ||
56 | %build | |
57 | %if %{with python2} | |
58 | %py_build | |
59 | %endif | |
60 | ||
61 | %if %{with python3} | |
62 | %py3_build | |
63 | %endif | |
64 | ||
65 | %if %{with tests} | |
66 | # FIXME: python3 tests do not run: it wants %{_bindir}/py.test but python3-pytest provides %{_bindir}/py.test-3.4 | |
67 | tox --sitepackages --skip-missing-interpreters | |
68 | %endif | |
69 | ||
70 | %install | |
71 | rm -rf $RPM_BUILD_ROOT | |
72 | %if %{with python2} | |
73 | %py_install | |
74 | %py_postclean | |
75 | %endif | |
76 | ||
77 | %if %{with python3} | |
78 | %py3_install | |
79 | %endif | |
80 | ||
81 | %clean | |
82 | rm -rf $RPM_BUILD_ROOT | |
83 | ||
84 | %if %{with python2} | |
85 | %files | |
86 | %defattr(644,root,root,755) | |
87 | %doc AUTHORS.rst HISTORY.rst CONTRIBUTING.rst README.rst LICENSE | |
88 | %{py_sitescriptdir}/%{module}.py[co] | |
89 | %{py_sitescriptdir}/%{module}-%{version}-py*.egg-info | |
90 | %endif | |
91 | ||
92 | %if %{with python3} | |
93 | %files -n python3-%{module} | |
94 | %defattr(644,root,root,755) | |
95 | %doc AUTHORS.rst HISTORY.rst CONTRIBUTING.rst README.rst LICENSE | |
96 | %{py3_sitescriptdir}/%{module}.py | |
97 | %{py3_sitescriptdir}/__pycache__/%{module}.*.pyc | |
98 | %{py3_sitescriptdir}/%{module}-%{version}-py*.egg-info | |
99 | %endif |