Accepting request 784258 from devel:languages:python

- Fix build without python2

OBS-URL: https://build.opensuse.org/request/show/784258
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-apache-libcloud?expand=0&rev=31
This commit is contained in:
Dominique Leuenberger 2020-04-19 19:39:42 +00:00 committed by Git OBS Bridge
commit cd9d9f9d92
2 changed files with 14 additions and 17 deletions

View File

@ -1,3 +1,8 @@
-------------------------------------------------------------------
Thu Mar 12 11:00:06 UTC 2020 - Tomáš Chvátal <tchvatal@suse.com>
- Fix build without python2
-------------------------------------------------------------------
Thu Mar 5 18:45:41 UTC 2020 - Niels Abspoel <aboe76@gmail.com>

View File

@ -16,16 +16,13 @@
#
# No longer build for python2
%define skip_python2 1
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
%bcond_without python2
Name: python-apache-libcloud
Version: 2.8.1
Release: 0
Summary: Abstraction over multiple cloud provider APIs
License: Apache-2.0
Group: System/Monitoring
URL: https://libcloud.apache.org
Source0: https://files.pythonhosted.org/packages/source/a/apache-libcloud/apache-libcloud-%{version}.tar.gz
Patch1: gce_image_projects.patch
@ -42,11 +39,7 @@ BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module typing}
BuildRequires: %{python_module xml}
BuildRequires: fdupes
BuildRequires: python-backports.ssl_match_hostname
BuildRequires: python-rpm-macros
%if ! 0%{?skip_python2}
BuildRequires: python2
%endif
Requires: python-lxml
Requires: python-requests
Requires: python-typing
@ -55,6 +48,13 @@ Suggests: python-lockfile
Suggests: python-paramiko
Suggests: python-pysphere
BuildArch: noarch
%if %{with python2}
BuildRequires: python-backports.ssl_match_hostname
BuildRequires: python2
%endif
%ifpython2
Requires: python-backports.ssl_match_hostname
%endif
%python_subpackages
%description
@ -83,16 +83,8 @@ find %{buildroot} -name '*.pem' -size 0 -delete
%check
# Skip ShellOutSSHClientTests tests which attempt to ssh to localhost
%if ! 0%{?skip_python2}
python2 -m pytest -k 'not ShellOutSSHClientTests and \
not ElasticContainerDriverTestCase'
%endif
# Note these two extra py3 failures are undesirable and should be fixed
python3 -m pytest -k \
'not test_consume_stderr_chunk_contains_part_of_multi_byte_utf8_character and \
not test_consume_stdout_chunk_contains_part_of_multi_byte_utf8_character and \
not ShellOutSSHClientTests and \
not ElasticContainerDriverTestCase'
%pytest -k '(not test_consume_stderr_chunk_contains_part_of_multi_byte_utf8_character and not test_consume_stdout_chunk_contains_part_of_multi_byte_utf8_character and not ShellOutSSHClientTests and not ElasticContainerDriverTestCase)'
%files %{python_files}
%license LICENSE