Skip unit tests that fail with OpenSSL 1.1.1.d

Fix and simplify Python 3 packaging

Resolves: rhbz#1761194
This commit is contained in:
Christian Heimes 2019-10-13 14:26:19 +02:00
parent 1ba330ec74
commit 16edebe9b7

View File

@ -18,7 +18,7 @@
Name: python-%{srcname}
Version: 2.7
Release: 2%{?dist}
Release: 3%{?dist}
Summary: PyCA's cryptography library
License: ASL 2.0 or BSD
@ -108,20 +108,12 @@ recipes to Python developers.
%prep
%autosetup -p1 -n %{srcname}-%{version}
%if 0%{?with_python3}
rm -rf %{py3dir}
cp -a . %{py3dir}
find %{py3dir} -name '*.py' | xargs sed -i '1s|^#!/usr/bin/python|#!%{__python3}|'
%endif
%build
%if 0%{?with_python2}
%py2_build
%endif
%if 0%{?with_python3}
pushd %{py3dir}
%py3_build
popd
%endif
%install
@ -133,20 +125,18 @@ find . -name .keep -print -delete
%py2_install
%endif
%if 0%{?with_python3}
pushd %{py3dir}
%py3_install
%endif
%check
%if 0%{?with_python2}
# see https://github.com/pyca/cryptography/issues/4885 for the deselected test
PYTHONPATH=%{buildroot}%{python2_sitearch} %{__python2} -m pytest -k "not test_buffer_protocol_alternate_modes[mode5]"
# see https://github.com/pyca/cryptography/issues/4885 and
# see https://bugzilla.redhat.com/show_bug.cgi?id=1761194 for deselected tests
PYTHONPATH=%{buildroot}%{python2_sitearch} %{__python2} -m pytest -k "not (test_buffer_protocol_alternate_modes or test_dh_parameters_supported or test_load_ecdsa_no_named_curve)"
%endif
%if 0%{?with_python3}
pushd %{py3dir}
PYTHONPATH=%{buildroot}%{python3_sitearch} %{__python3} -m pytest -k "not test_buffer_protocol_alternate_modes[mode5]"
popd
PYTHONPATH=%{buildroot}%{python3_sitearch} %{__python3} -m pytest -k "not (test_buffer_protocol_alternate_modes or test_dh_parameters_supported or test_load_ecdsa_no_named_curve)"
%endif
@ -162,12 +152,17 @@ popd
%files -n python%{python3_pkgversion}-%{srcname}
%doc README.rst docs
%license LICENSE LICENSE.APACHE LICENSE.BSD
%{python3_sitearch}/*
%{python3_sitearch}/%{srcname}
%{python3_sitearch}/%{srcname}-%{version}-py*.egg-info
%endif
%changelog
* Sun Oct 13 2019 Christian Heimes <cheimes@redhat.com> - 2.7-3
- Skip unit tests that fail with OpenSSL 1.1.1.d
- Resolves: rhbz#1761194
- Fix and simplify Python 3 packaging
* Sat Oct 12 2019 Christian Heimes <cheimes@redhat.com> - 2.7-2
- Drop Python 2 package
- Resolves: rhbz#1761081