Accepting request 624090 from devel:languages:python

OBS-URL: https://build.opensuse.org/request/show/624090
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-requests?expand=0&rev=49
This commit is contained in:
Dominique Leuenberger 2018-07-21 08:09:13 +00:00 committed by Git OBS Bridge
commit c06fe04f27
4 changed files with 1357 additions and 22 deletions

3
_multibuild Normal file
View File

@ -0,0 +1,3 @@
<multibuild>
<package>test</package>
</multibuild>

1305
python-requests-test.changes Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,3 +1,13 @@
-------------------------------------------------------------------
Thu Jul 19 10:27:24 UTC 2018 - mimi.vx@gmail.com
- -test subpackage must be empty
-------------------------------------------------------------------
Mon Jul 16 00:09:54 UTC 2018 - mimi.vx@gmail.com
- make multibuild package to resolve circular deps on tests
-------------------------------------------------------------------
Mon Jul 2 00:43:03 UTC 2018 - stefan.bruens@rwth-aachen.de

View File

@ -16,49 +16,58 @@
#
%global flavor @BUILD_FLAVOR@%{nil}
%define test 0
%if "%{flavor}" == "test"
%define test 1
%endif
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
%if %{test}
Name: python-requests-%{flavor}
%else
Name: python-requests
%endif
Version: 2.19.1
Release: 0
Summary: Awesome Python HTTP Library That's Actually Usable
License: Apache-2.0
Group: Development/Languages/Python
Url: http://python-requests.org/
URL: http://python-requests.org/
Source: https://files.pythonhosted.org/packages/source/r/requests/requests-%{version}.tar.gz
BuildRequires: %{python_module certifi}
BuildRequires: %{python_module devel}
BuildRequires: %{python_module py}
BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module urllib3 >= 1.21.1}
BuildRequires: %{python_module urllib3 < 1.24}
BuildRequires: %{python_module urllib3 >= 1.21.1}
BuildRequires: ca-certificates
BuildRequires: fdupes
BuildRequires: python
BuildRequires: python-rpm-macros
# SECTION test requirements
Requires: ca-certificates
Requires: python
Requires: python-certifi >= 2017.4.17
Requires: python-chardet >= 3.0.2
Requires: python-idna < 2.8
Requires: python-idna >= 2.5
Requires: python-py
Requires: python-urllib3 < 1.24
Requires: python-urllib3 >= 1.21.1
Recommends: ca-certificates-mozilla
Recommends: python-PySocks >= 1.5.6
Recommends: python-cryptography >= 1.3.4
Recommends: python-pyOpenSSL >= 0.14
BuildArch: noarch
%if %{test}
BuildRequires: %{python_module PySocks >= 1.5.6}
BuildRequires: %{python_module chardet >= 3.0.2}
BuildRequires: %{python_module idna >= 2.5}
BuildRequires: %{python_module idna < 2.8}
BuildRequires: %{python_module idna >= 2.5}
BuildRequires: %{python_module pytest-httpbin}
BuildRequires: %{python_module pytest-mock}
BuildRequires: %{python_module pytest}
# /SECTION
Requires: ca-certificates
Requires: python
Recommends: ca-certificates-mozilla
Recommends: python-pyOpenSSL >= 0.14
Recommends: python-cryptography >= 1.3.4
Recommends: python-PySocks >= 1.5.6
Requires: python-certifi >= 2017.4.17
Requires: python-chardet >= 3.0.2
Requires: python-idna >= 2.5
Requires: python-idna < 2.8
Requires: python-py
Requires: python-urllib3 >= 1.21.1
Requires: python-urllib3 < 1.24
BuildArch: noarch
Requires: this-is-only-for-build-envs
%endif
%python_subpackages
%description
@ -97,21 +106,29 @@ sed -i "s#\(httpbin.*\), 'never'#\1#" tests/test_requests.py
# check that urllib3 is not installed
test ! -e %{buildroot}%{python3_sitelib}/requests/packages/urllib3
%python_expand %fdupes %{buildroot}%{$python_sitelib}/requests
%if %{test}
%python_expand rm -Rf %{buildroot}%{$python_sitelib}/requests
%python_expand rm -Rf %{buildroot}%{$python_sitelib}/requests-*
%endif
# 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
%if 0%{?suse_version}
%if 0%{?suse_version} && %{test}
%check
touch Pipfile
# exclude tests connecting to TARPIT
%python_exec -m pytest tests -k "not (TestTimeout and connect)"
%endif
%if %{test}
%files %{python_files}
%license LICENSE
%else
%files %{python_files}
%defattr(-,root,root)
%license LICENSE
%doc HISTORY.rst README.rst
%{python_sitelib}/requests/
%{python_sitelib}/requests-*
%endif
%changelog