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