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