2 %bcond_without tests # unit tests
3 %bcond_without python2 # CPython 2.x module
4 %bcond_without python3 # CPython 3.x module
6 %define module ratelimit
7 %define egg_name ratelimit
8 %define pypi_name ratelimit
9 Summary: A function decorator preventing a function from being called more often than that allowed
10 Name: python-%{module}
14 Group: Libraries/Python
15 Source0: https://github.com/tomasbasham/ratelimit/archive/refs/tags/v%{version}.tar.gz
16 # Source0-md5: ef2e15527c4514751527157b588bb25e
17 URL: https://github.com/tomasbasham/ratelimit
19 BuildRequires: python-modules >= 1:2.5
20 BuildRequires: python-setuptools
22 #BuildRequires: python-
26 BuildRequires: python3-modules >= 1:3.2
27 BuildRequires: python3-setuptools
29 #BuildRequires: python3-
32 BuildRequires: rpm-pythonprov
33 BuildRequires: rpmbuild(macros) >= 1.714
34 Requires: python-modules >= 1:2.5
36 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
39 A function decorator preventing a function from being called more
40 often than that allowed.
42 %package -n python3-%{module}
43 Summary: A function decorator preventing a function from being called more often than that allowed
44 Group: Libraries/Python
45 Requires: python3-modules >= 1:3.2
47 %description -n python3-%{module}
48 A function decorator preventing a function from being called more
49 often than that allowed.
52 %setup -q -n %{pypi_name}-%{version}
59 %{__python} -m pytest tests
67 %{__python3} -m pytest tests
72 rm -rf $RPM_BUILD_ROOT
84 rm -rf $RPM_BUILD_ROOT
88 %defattr(644,root,root,755)
90 %{py_sitescriptdir}/%{module}
91 %{py_sitescriptdir}/%{egg_name}-%{version}-py*.egg-info
95 %files -n python3-%{module}
96 %defattr(644,root,root,755)
98 %{py3_sitescriptdir}/%{module}
99 %{py3_sitescriptdir}/%{egg_name}-%{version}-py*.egg-info