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
8 %define module cached_property
9 Summary: A cached-property for decorating methods in Python classes
10 Name: python-%{module}
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
21 BuildRequires: python-modules
22 BuildRequires: python-setuptools
24 BuildRequires: python-freezegun
25 BuildRequires: python-pytest
26 BuildRequires: python-tox >= 1.7.2
30 BuildRequires: python3-modules
31 BuildRequires: python3-setuptools
33 BuildRequires: python3-freezegun
34 BuildRequires: python3-pytest
38 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
41 cached_property allows properties in Python classes to be cached until
42 the cache is invalidated or expired.
44 %package -n python3-%{module}
45 Summary: A cached-property for decorating methods in Python classes
46 Group: Libraries/Python
48 %description -n python3-%{module}
49 cached_property allows properties in Python classes to be cached until
50 the cache is invalidated or expired.
54 mv cached-property-*/* .
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
71 rm -rf $RPM_BUILD_ROOT
82 rm -rf $RPM_BUILD_ROOT
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
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