]> git.pld-linux.org Git - packages/python3-requests.git/blame - python-requests.spec
rebuild with tests and docs
[packages/python3-requests.git] / python-requests.spec
CommitLineData
ef9212ce 1#
8d099eee 2# Conditional build:
23351644 3%bcond_with tests # pytest tests (one test fails with pytest-httpbin 1.0.0)
ef9212ce
JB
4%bcond_without python2 # CPython 2.x module
5%bcond_without python3 # CPython 3.x module
dd9a8c31 6
44a39070 7%define urllib3_ver 1.21.1
dd9a8c31
ER
8%define module requests
9%define egg_name requests
ef9212ce
JB
10Summary: HTTP library for Python 2
11Summary(pl.UTF-8): Biblioteka HTTP dla Pythona 2
8ba13116 12Name: python-%{module}
a5ef80ca 13Version: 2.26.0
8b0aae9d 14Release: 5
017795a9 15License: Apache v2.0
8ba13116 16Group: Development/Languages/Python
44a39070
JB
17#Source0Download: https://pypi.org/simple/requests/
18Source0: https://files.pythonhosted.org/packages/source/r/requests/%{module}-%{version}.tar.gz
a5ef80ca 19# Source0-md5: 8c745949ad3e9ae83d9927fed213db8a
0989c03f 20Patch0: system-cert.patch
23351644
JB
21Patch1: %{name}-reqs.patch
22Patch2: %{name}-disable-xdist.patch
23URL: https://docs.python-requests.org/
dd9a8c31
ER
24BuildRequires: rpm-pythonprov
25BuildRequires: rpmbuild(macros) >= 1.713
a8d01621 26%if %{with python2}
d04d981e 27BuildRequires: python-modules >= 1:2.7
dd9a8c31 28BuildRequires: python-setuptools
017795a9 29%if %{with tests}
d04d981e 30BuildRequires: python-PySocks >= 1.5.8
dd9a8c31 31BuildRequires: python-certifi >= 2017.4.17
0989c03f 32BuildRequires: python-chardet >= 3.0.2
fa360ea6 33BuildRequires: python-chardet < 5
a5ef80ca 34# idna 3 not supported for python2
0989c03f 35BuildRequires: python-idna >= 2.5
0ecc0c85
JB
36BuildRequires: python-idna < 3
37BuildRequires: python-pytest >= 3
017795a9
JB
38BuildRequires: python-pytest-cov
39BuildRequires: python-pytest-httpbin >= 0.0.7
fa360ea6 40BuildRequires: python-pytest-mock >= 2.0.0
d04d981e 41BuildRequires: python-pytest-xdist
44a39070 42BuildRequires: python-urllib3 >= %{urllib3_ver}
fa360ea6 43BuildRequires: python-urllib3 < 1.27
017795a9 44%endif
27c2bafe 45%endif
a8d01621 46%if %{with python3}
a5ef80ca 47BuildRequires: python3-modules >= 1:3.6
616851f8 48BuildRequires: python3-setuptools
017795a9 49%if %{with tests}
d04d981e 50BuildRequires: python3-PySocks >= 1.5.8
dd9a8c31 51BuildRequires: python3-certifi >= 2017.4.17
0989c03f 52BuildRequires: python3-chardet >= 3.0.2
fa360ea6 53BuildRequires: python3-chardet < 5
0989c03f 54BuildRequires: python3-idna >= 2.5
822dad3c 55BuildRequires: python3-idna < 4
0ecc0c85 56BuildRequires: python3-pytest >= 3
017795a9
JB
57BuildRequires: python3-pytest-cov
58BuildRequires: python3-pytest-httpbin >= 0.0.7
fa360ea6 59BuildRequires: python3-pytest-mock >= 2.0.0
d04d981e 60BuildRequires: python3-pytest-xdist
44a39070 61BuildRequires: python3-urllib3 >= %{urllib3_ver}
fa360ea6 62BuildRequires: python3-urllib3 < 1.27
017795a9 63%endif
27c2bafe 64%endif
dd9a8c31 65Suggests: ca-certificates
e7d50ac0 66# for python2 only to get SNI working. python3 doesn't need this
d04d981e 67Requires: python-cryptography >= 1.3.4
017795a9 68Requires: python-pyOpenSSL >= 0.14
ecc66759 69Requires: python-urllib3 >= 1.22-2
8ba13116
MM
70BuildArch: noarch
71BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
72
73%description
a8d01621 74Requests is a HTTP library, written in Python, for human beings.
8ba13116
MM
75
76Most existing Python modules for sending HTTP requests are extremely
77verbose and cumbersome. Python's builtin urllib2 module provides most
8d099eee 78of the HTTP capabilities you should need, but the API is thoroughly
8ba13116 79broken. It requires an enormous amount of work (even method overrides)
8d099eee
JB
80to perform the simplest of tasks. Things shouldn't be this way. Not in
81Python.
82
ef9212ce
JB
83This package contains Python 2.x module.
84
8d099eee 85%description -l pl.UTF-8
a8d01621 86Requests to napisana w Pythonie biblioteka HTTP dla ludzi.
8ba13116 87
8d099eee
JB
88Większość istniejących modułów Pythona do wysyłania żądań HTTP jest
89zbyt gadatliwa i nieporęczna. Wbudowany w Pythona moduł urllib2
90zapewnia większość wymaganych możliwości HTTP, ale API jest kiepskie -
91wymaga dużych nakładów pracy (nawet nadpisań metod) do wykonania
92najprostszych zadań. Nie powinno tak być. Nie w Pythonie.
8ba13116 93
ef9212ce
JB
94Ten pakiet zawiera moduł dla Pythona 2.x.
95
a0c91a8e 96%package -n python3-requests
ef9212ce
JB
97Summary: HTTP library for Python 3
98Summary(pl.UTF-8): Biblioteka HTTP dla Pythona 3
a0c91a8e 99Group: Development/Languages/Python
a5ef80ca 100Requires: python3-modules >= 1:3.6
24e1d820 101Requires: python3-charset_normalizer >= 2
d04d981e
JB
102# for https
103Requires: python3-cryptography >= 1.3.4
24e1d820 104Requires: python3-idna >= 2.5
d04d981e 105Requires: python3-pyOpenSSL >= 0.14
ecc66759 106Requires: python3-urllib3 >= 1.22-2
dd9a8c31 107Suggests: ca-certificates
a0c91a8e
KK
108
109%description -n python3-requests
a8d01621 110Requests is a HTTP library, written in Python, for human beings.
a0c91a8e
KK
111
112Most existing Python modules for sending HTTP requests are extremely
113verbose and cumbersome. Python's builtin urllib2 module provides most
114of the HTTP capabilities you should need, but the api is thoroughly
115broken. It requires an enormous amount of work (even method overrides)
8d099eee
JB
116to perform the simplest of tasks. Things shouldn't be this way. Not in
117Python.
118
ef9212ce
JB
119This package contains Python 3.x module.
120
8d099eee 121%description -n python3-requests -l pl.UTF-8
a8d01621 122Requests to napisana w Pythonie biblioteka HTTP dla ludzi.
a0c91a8e 123
a8d01621
ŁK
124Większość istniejących modułów Pythona do wysyłania żądań HTTP jest
125zbyt gadatliwa i nieporęczna. Wbudowany w Pythona moduł urllib2
126zapewnia większość wymaganych możliwości HTTP, ale API jest kiepskie -
127wymaga dużych nakładów pracy (nawet nadpisań metod) do wykonania
128najprostszych zadań. Nie powinno tak być. Nie w Pythonie.
a0c91a8e 129
ef9212ce
JB
130Ten pakiet zawiera moduł dla Pythona 3.x.
131
8ba13116 132%prep
a8d01621 133%setup -q -n %{module}-%{version}
0989c03f 134%patch0 -p1
23351644
JB
135%patch1 -p1
136%patch2 -p1
e16ab944 137
8ba13116 138%build
a8d01621 139%if %{with python2}
23351644
JB
140%py_build
141
9e2ed226 142%if %{with tests}
23351644
JB
143PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
144PYTEST_PLUGINS="pytest_httpbin.plugin,pytest_mock" \
145%{__python} -m pytest tests
a8d01621 146%endif
9e2ed226 147%endif
a0c91a8e 148
a8d01621 149%if %{with python3}
23351644
JB
150%py3_build
151
9e2ed226 152%if %{with tests}
23351644
JB
153PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
154PYTEST_PLUGINS="pytest_httpbin.plugin,pytest_mock" \
155%{__python3} -m pytest tests
8d099eee 156%endif
9e2ed226 157%endif
8ba13116
MM
158
159%install
160rm -rf $RPM_BUILD_ROOT
a8d01621
ŁK
161
162%if %{with python2}
b4dcbe07 163%py_install
fa360ea6 164
a8d01621
ŁK
165%py_postclean
166%endif
8ba13116 167
a8d01621 168%if %{with python3}
b4dcbe07 169%py3_install
a8d01621 170%endif
8ba13116
MM
171
172%clean
173rm -rf $RPM_BUILD_ROOT
174
a8d01621 175%if %{with python2}
8ba13116
MM
176%files
177%defattr(644,root,root,755)
283f39fa 178%doc HISTORY.md README.md
8ba13116 179%{py_sitescriptdir}/%{module}
dd9a8c31 180%{py_sitescriptdir}/%{egg_name}-%{version}-py*.egg-info
a8d01621 181%endif
a0c91a8e 182
a8d01621 183%if %{with python3}
a0c91a8e
KK
184%files -n python3-requests
185%defattr(644,root,root,755)
283f39fa 186%doc HISTORY.md README.md
a0c91a8e 187%{py3_sitescriptdir}/%{module}
dd9a8c31 188%{py3_sitescriptdir}/%{egg_name}-%{version}-py*.egg-info
a8d01621 189%endif
This page took 0.157289 seconds and 4 git commands to generate.