2011-05-20 21:15:11 +02:00
|
|
|
#
|
|
|
|
# spec file for package python-requests
|
|
|
|
#
|
2019-02-05 15:03:59 +01:00
|
|
|
# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
|
2011-05-20 21:15:11 +02:00
|
|
|
#
|
|
|
|
# All modifications and additions to the file contributed by third parties
|
|
|
|
# remain the property of their copyright owners, unless otherwise agreed
|
|
|
|
# upon. The license for this file, and modifications and additions to the
|
|
|
|
# file, is the same license as for the pristine package itself (unless the
|
|
|
|
# license for the pristine package is not an Open Source License, in which
|
|
|
|
# case the license is the MIT License). An "Open Source License" is a
|
|
|
|
# license that conforms to the Open Source Definition (Version 1.9)
|
|
|
|
# published by the Open Source Initiative.
|
2012-04-28 01:00:17 +02:00
|
|
|
|
2018-10-30 09:35:15 +01:00
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
2011-05-20 21:15:11 +02:00
|
|
|
#
|
|
|
|
|
|
|
|
|
2018-07-16 10:02:35 +02:00
|
|
|
%global flavor @BUILD_FLAVOR@%{nil}
|
|
|
|
%if "%{flavor}" == "test"
|
2019-02-15 12:41:38 +01:00
|
|
|
%define psuffix -test
|
2018-12-31 12:25:50 +01:00
|
|
|
%bcond_without test
|
|
|
|
%else
|
2019-02-15 12:41:38 +01:00
|
|
|
%define psuffix %{nil}
|
2018-12-31 12:25:50 +01:00
|
|
|
%bcond_with test
|
2018-07-16 10:02:35 +02:00
|
|
|
%endif
|
2017-04-06 16:56:39 +02:00
|
|
|
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
|
2019-02-15 12:41:38 +01:00
|
|
|
Name: python-requests%{psuffix}
|
2019-02-05 15:03:59 +01:00
|
|
|
Version: 2.21.0
|
2011-05-20 21:15:11 +02:00
|
|
|
Release: 0
|
2018-11-06 16:28:08 +01:00
|
|
|
Summary: Python HTTP Library
|
2014-12-02 21:02:19 +01:00
|
|
|
License: Apache-2.0
|
2011-05-20 21:15:11 +02:00
|
|
|
Group: Development/Languages/Python
|
2018-07-19 16:15:21 +02:00
|
|
|
URL: http://python-requests.org/
|
2017-06-10 11:03:49 +02:00
|
|
|
Source: https://files.pythonhosted.org/packages/source/r/requests/requests-%{version}.tar.gz
|
|
|
|
BuildRequires: %{python_module certifi}
|
2017-04-06 16:56:39 +02:00
|
|
|
BuildRequires: %{python_module setuptools}
|
2018-07-16 10:02:35 +02:00
|
|
|
BuildRequires: %{python_module urllib3 >= 1.21.1}
|
2017-04-06 16:56:39 +02:00
|
|
|
BuildRequires: ca-certificates
|
2018-07-03 09:07:45 +02:00
|
|
|
BuildRequires: fdupes
|
2011-11-27 10:11:09 +01:00
|
|
|
BuildRequires: python
|
2017-04-06 16:56:39 +02:00
|
|
|
BuildRequires: python-rpm-macros
|
|
|
|
Requires: ca-certificates
|
2011-11-27 10:11:09 +01:00
|
|
|
Requires: python
|
2017-06-10 11:03:49 +02:00
|
|
|
Requires: python-certifi >= 2017.4.17
|
|
|
|
Requires: python-chardet >= 3.0.2
|
2018-07-16 10:02:35 +02:00
|
|
|
Requires: python-idna >= 2.5
|
2017-04-06 16:56:39 +02:00
|
|
|
Requires: python-py
|
2018-07-16 10:02:35 +02:00
|
|
|
Requires: python-urllib3 >= 1.21.1
|
2019-02-15 12:41:38 +01:00
|
|
|
BuildArch: noarch
|
2019-01-12 16:42:15 +01:00
|
|
|
%if 0%{?_no_weakdeps}
|
|
|
|
Requires: ca-certificates-mozilla
|
|
|
|
Requires: python-PySocks >= 1.5.6
|
|
|
|
Requires: python-cryptography >= 1.3.4
|
|
|
|
Requires: python-pyOpenSSL >= 0.14
|
|
|
|
%else
|
2018-07-19 16:15:21 +02:00
|
|
|
Recommends: ca-certificates-mozilla
|
|
|
|
Recommends: python-PySocks >= 1.5.6
|
|
|
|
Recommends: python-cryptography >= 1.3.4
|
|
|
|
Recommends: python-pyOpenSSL >= 0.14
|
2019-01-12 16:42:15 +01:00
|
|
|
%endif
|
2018-12-31 12:25:50 +01:00
|
|
|
%if %{with test}
|
2018-07-19 16:15:21 +02:00
|
|
|
BuildRequires: %{python_module PySocks >= 1.5.6}
|
|
|
|
BuildRequires: %{python_module chardet >= 3.0.2}
|
|
|
|
BuildRequires: %{python_module idna >= 2.5}
|
2019-02-15 12:41:38 +01:00
|
|
|
BuildRequires: %{python_module pytest-httpbin >= 0.0.7}
|
2018-07-19 16:15:21 +02:00
|
|
|
BuildRequires: %{python_module pytest-mock}
|
|
|
|
BuildRequires: %{python_module pytest}
|
2019-02-15 12:41:38 +01:00
|
|
|
BuildRequires: %{python_module requests >= %{version}}
|
2018-07-19 16:15:21 +02:00
|
|
|
%endif
|
2017-04-06 16:56:39 +02:00
|
|
|
%python_subpackages
|
2011-05-20 21:15:11 +02:00
|
|
|
|
|
|
|
%description
|
2017-06-06 10:12:55 +02:00
|
|
|
Requests is an HTTP library, written in Python, as an alternative
|
2018-11-06 16:28:08 +01:00
|
|
|
to Python's builtin urllib2 which requires work (even
|
2017-06-06 10:12:55 +02:00
|
|
|
method overrides) to perform basic tasks.
|
2011-05-20 21:15:11 +02:00
|
|
|
|
2017-06-06 10:12:55 +02:00
|
|
|
Features of Requests:
|
|
|
|
- GET, HEAD, POST, PUT, DELETE Requests:
|
|
|
|
+ HTTP Header Request Attachment.
|
|
|
|
+ Data/Params Request Attachment.
|
|
|
|
+ Multipart File Uploads.
|
2015-10-10 01:04:58 +02:00
|
|
|
+ CookieJar Support.
|
|
|
|
+ Redirection History.
|
|
|
|
+ Redirection Recursion Urllib Fix.
|
2017-06-06 10:12:55 +02:00
|
|
|
+ Automatic Decompression of GZipped Content.
|
2015-10-10 01:04:58 +02:00
|
|
|
+ Unicode URL Support.
|
2017-06-06 10:12:55 +02:00
|
|
|
- Authentication:
|
|
|
|
+ URL + HTTP Auth Registry.
|
2011-05-20 21:15:11 +02:00
|
|
|
|
|
|
|
%prep
|
2011-09-23 14:10:26 +02:00
|
|
|
%setup -q -n requests-%{version}
|
2013-01-17 13:07:06 +01:00
|
|
|
|
2017-04-06 16:56:39 +02:00
|
|
|
# drop shebang from certs.py
|
|
|
|
sed -i '1s/^#!.*$//' requests/certs.py
|
|
|
|
|
2018-07-03 09:07:45 +02:00
|
|
|
# remove 'never' default parameter from digest-auth check
|
|
|
|
# requires httpbin 0.6.0
|
|
|
|
sed -i "s#\(httpbin.*\), 'never'#\1#" tests/test_requests.py
|
|
|
|
|
2011-05-20 21:15:11 +02:00
|
|
|
%build
|
2017-04-06 16:56:39 +02:00
|
|
|
%python_build
|
2011-05-20 21:15:11 +02:00
|
|
|
|
|
|
|
%install
|
2019-02-15 12:41:38 +01:00
|
|
|
%if !%{with test}
|
2017-04-06 16:56:39 +02:00
|
|
|
%python_install
|
|
|
|
# check that urllib3 is not installed
|
|
|
|
test ! -e %{buildroot}%{python3_sitelib}/requests/packages/urllib3
|
2019-02-15 12:41:38 +01:00
|
|
|
%python_expand %fdupes %{buildroot}%{$python_sitelib}
|
2018-07-19 16:15:21 +02:00
|
|
|
%endif
|
2017-04-06 16:56:39 +02:00
|
|
|
|
2018-02-27 22:50:44 +01:00
|
|
|
# NOTE(aplanas) If we do not have the certificates, we some of the
|
|
|
|
# tests will fail, so for now we only run the tests in openSUSE
|
2018-12-31 12:25:50 +01:00
|
|
|
%if 0%{?suse_version} && %{with test}
|
2017-04-06 16:56:39 +02:00
|
|
|
%check
|
2018-07-03 09:07:45 +02:00
|
|
|
touch Pipfile
|
2017-04-06 16:56:39 +02:00
|
|
|
# exclude tests connecting to TARPIT
|
2019-02-25 16:45:21 +01:00
|
|
|
# exclude test_https_warnings as is flaky
|
|
|
|
%python_exec -m pytest tests -k "not (TestTimeout or connect or test_https_warnings)"
|
2018-02-27 22:50:44 +01:00
|
|
|
%endif
|
2011-05-20 21:15:11 +02:00
|
|
|
|
2019-02-15 12:41:38 +01:00
|
|
|
%if !%{with test}
|
2017-04-06 16:56:39 +02:00
|
|
|
%files %{python_files}
|
2018-07-03 09:07:45 +02:00
|
|
|
%license LICENSE
|
2018-10-30 09:35:15 +01:00
|
|
|
%doc HISTORY.md README.md
|
2015-10-10 01:04:58 +02:00
|
|
|
%{python_sitelib}/requests/
|
|
|
|
%{python_sitelib}/requests-*
|
2018-07-19 16:15:21 +02:00
|
|
|
%endif
|
2011-05-20 21:15:11 +02:00
|
|
|
|
2011-09-23 14:10:26 +02:00
|
|
|
%changelog
|