]> git.pld-linux.org Git - packages/python-requests-toolbelt.git/blame - python-requests-toolbelt.spec
rebuild with python 3.10
[packages/python-requests-toolbelt.git] / python-requests-toolbelt.spec
CommitLineData
0c903547
ER
1#
2# Conditional build:
cbd125fb
JB
3%bcond_without doc # Sphinx documentation
4%bcond_with tests # unit tests (some failing as of 0.9.1)
0c903547
ER
5%bcond_without python2 # CPython 2.x module
6%bcond_without python3 # CPython 3.x module
7
8%define module requests_toolbelt
9%define egg_name requests_toolbelt
10%define pypi_name requests-toolbelt
11Summary: Utility belt for advanced users of python-requests
cbd125fb 12Summary(pl.UTF-8): Pasek narzędzi dla zaawansowanych użytkowników python-requests
0c903547 13Name: python-%{pypi_name}
cbd125fb 14Version: 0.9.1
0d165cce 15Release: 2
0c903547
ER
16License: Apache v2.0
17Group: Libraries/Python
cbd125fb
JB
18#Source0Download: https://pypi.org/simple/requests-toolbelt/
19Source0: https://files.pythonhosted.org/packages/source/r/requests-toolbelt/%{pypi_name}-%{version}.tar.gz
20# Source0-md5: b1509735c4b4cf95df2619facbc3672e
21URL: https://toolbelt.readthedocs.io/
0c903547
ER
22BuildRequires: rpm-pythonprov
23BuildRequires: rpmbuild(macros) >= 1.714
cbd125fb 24BuildRequires: sed >= 4.0
0c903547 25%if %{with python2}
cbd125fb 26BuildRequires: python-modules >= 1:2.7
0c903547
ER
27BuildRequires: python-setuptools
28%if %{with tests}
29BuildRequires: python-betamax
30BuildRequires: python-mock
cbd125fb 31BuildRequires: python-pyOpenSSL
0c903547 32BuildRequires: python-pytest
cbd125fb
JB
33BuildRequires: python-requests >= 2.0.1
34BuildRequires: python-requests < 3
0c903547
ER
35%endif
36%endif
37%if %{with python3}
cbd125fb 38BuildRequires: python3-modules >= 1:3.3
0c903547
ER
39BuildRequires: python3-setuptools
40%if %{with tests}
41BuildRequires: python3-betamax
cbd125fb 42BuildRequires: python3-pyOpenSSL
0c903547 43BuildRequires: python3-pytest
cbd125fb
JB
44BuildRequires: python3-requests >= 2.0.1
45BuildRequires: python3-requests < 3
0c903547
ER
46%endif
47%endif
cbd125fb
JB
48%if %{with doc}
49BuildRequires: python3-sphinx_rtd_theme
50BuildRequires: sphinx-pdg-3
51%endif
0c903547
ER
52BuildArch: noarch
53BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
54
55%description
56This is just a collection of utilities for python-requests, but don't
57really belong in requests proper.
58
cbd125fb
JB
59%description -l pl.UTF-8
60Zbiór narzędzi dla python-requests, nie należących do samych requests.
61
0c903547 62%package -n python3-%{pypi_name}
cbd125fb
JB
63Summary: Utility belt for advanced users of python-requests
64Summary(pl.UTF-8): Pasek narzędzi dla zaawansowanych użytkowników python-requests
65Group: Libraries/Python
0c903547
ER
66
67%description -n python3-%{pypi_name}
68This is just a collection of utilities for python-requests, but don't
69really belong in requests proper.
70
cbd125fb
JB
71%description -n python3-%{pypi_name} -l pl.UTF-8
72Zbiór narzędzi dla python-requests, nie należących do samych requests.
73
74%package apidocs
75Summary: API documentation for Python requests_toolbelt module
76Summary(pl.UTF-8): Dokumentacja API modułu Pythona requests_toolbelt
77Group: Documentation
78
79%description apidocs
80API documentation for Python requests_toolbelt module.
81
82%description apidocs -l pl.UTF-8
83Dokumentacja API modułu Pythona requests_toolbelt.
84
0c903547 85%prep
cbd125fb 86%setup -q -n %{pypi_name}-%{version}
0c903547
ER
87
88%build
89%if %{with python2}
90%py_build
cbd125fb 91
0c903547 92%if %{with tests}
cbd125fb
JB
93PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
94PYTEST_PLUGINS="betamax.fixtures.pytest" \
95%{__python} -m pytest -v tests
0c903547
ER
96%endif
97%endif
98
99%if %{with python3}
100%py3_build
cbd125fb 101
0c903547 102%if %{with tests}
cbd125fb
JB
103%{__sed} -i -e 's/import mock/from unittest import mock/; s/from mock import/from unittest.mock import/' \
104 tests/*.py tests/threaded/*.py
105
106PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
107PYTEST_PLUGINS="betamax.fixtures.pytest" \
108%{__python3} -m pytest -v tests
0c903547
ER
109%endif
110%endif
111
cbd125fb
JB
112%if %{with doc}
113%{__make} -C docs html \
114 SPHINXBUILD=sphinx-build-3
115%endif
116
0c903547
ER
117%install
118rm -rf $RPM_BUILD_ROOT
cbd125fb
JB
119
120%if %{with python2}
0c903547 121%py_install
cbd125fb
JB
122%endif
123
124%if %{with python3}
0c903547 125%py3_install
cbd125fb 126%endif
0c903547
ER
127
128%clean
129rm -rf $RPM_BUILD_ROOT
130
131%if %{with python2}
132%files
133%defattr(644,root,root,755)
134%doc README.rst HISTORY.rst LICENSE
135%{py_sitescriptdir}/%{module}
136%{py_sitescriptdir}/%{egg_name}-%{version}-py*.egg-info
137%endif
138
139%if %{with python3}
140%files -n python3-%{pypi_name}
141%defattr(644,root,root,755)
142%doc README.rst HISTORY.rst LICENSE
143%{py3_sitescriptdir}/%{module}
144%{py3_sitescriptdir}/%{egg_name}-%{version}-py*.egg-info
145%endif
cbd125fb
JB
146
147%if %{with doc}
148%files apidocs
149%defattr(644,root,root,755)
150%doc docs/_build/html/{_static,*.html,*.js}
151%endif
This page took 0.110331 seconds and 4 git commands to generate.