]> git.pld-linux.org Git - packages/python-ratelimit.git/blame - python-ratelimit.spec
rebuild with python 3.10
[packages/python-ratelimit.git] / python-ratelimit.spec
CommitLineData
d28336cb
AM
1# Conditional build:
2%bcond_without tests # unit tests
3%bcond_without python2 # CPython 2.x module
4%bcond_without python3 # CPython 3.x module
5
6%define module ratelimit
7%define egg_name ratelimit
8%define pypi_name ratelimit
9Summary: A function decorator preventing a function from being called more often than that allowed
10Name: python-%{module}
11Version: 2.2.1
79dcb03c 12Release: 2
d28336cb
AM
13License: MIT
14Group: Libraries/Python
15Source0: https://github.com/tomasbasham/ratelimit/archive/refs/tags/v%{version}.tar.gz
16# Source0-md5: ef2e15527c4514751527157b588bb25e
17URL: https://github.com/tomasbasham/ratelimit
18%if %{with python2}
19BuildRequires: python-modules >= 1:2.5
20BuildRequires: python-setuptools
21%if %{with tests}
22#BuildRequires: python-
23%endif
24%endif
25%if %{with python3}
26BuildRequires: python3-modules >= 1:3.2
27BuildRequires: python3-setuptools
28%if %{with tests}
29#BuildRequires: python3-
30%endif
31%endif
32BuildRequires: rpm-pythonprov
33BuildRequires: rpmbuild(macros) >= 1.714
34Requires: python-modules >= 1:2.5
35BuildArch: noarch
36BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
37
38%description
39A function decorator preventing a function from being called more
40often than that allowed.
41
42%package -n python3-%{module}
43Summary: A function decorator preventing a function from being called more often than that allowed
44Group: Libraries/Python
45Requires: python3-modules >= 1:3.2
46
47%description -n python3-%{module}
48A function decorator preventing a function from being called more
49often than that allowed.
50
51%prep
52%setup -q -n %{pypi_name}-%{version}
53
54%build
55%if %{with python2}
56%py_build
57
58%if %{with tests}
59%{__python} -m pytest tests
60%endif
61%endif
62
63%if %{with python3}
64%py3_build
65
66%if %{with tests}
67%{__python3} -m pytest tests
68%endif
69%endif
70
71%install
72rm -rf $RPM_BUILD_ROOT
73
74%if %{with python2}
75%py_install
76%py_postclean
77%endif
78
79%if %{with python3}
80%py3_install
81%endif
82
83%clean
84rm -rf $RPM_BUILD_ROOT
85
86%if %{with python2}
87%files
88%defattr(644,root,root,755)
89%doc README.rst
90%{py_sitescriptdir}/%{module}
91%{py_sitescriptdir}/%{egg_name}-%{version}-py*.egg-info
92%endif
93
94%if %{with python3}
95%files -n python3-%{module}
96%defattr(644,root,root,755)
97%doc README.rst
98%{py3_sitescriptdir}/%{module}
99%{py3_sitescriptdir}/%{egg_name}-%{version}-py*.egg-info
100%endif
This page took 0.225126 seconds and 4 git commands to generate.