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} Name: python-%{srcname}
Version: 2.7 Version: 2.7
Release: 2%{?dist} Release: 3%{?dist}
Summary: PyCA's cryptography library Summary: PyCA's cryptography library
License: ASL 2.0 or BSD License: ASL 2.0 or BSD
@ -108,20 +108,12 @@ recipes to Python developers.
%prep %prep
%autosetup -p1 -n %{srcname}-%{version} %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 %build
%if 0%{?with_python2} %if 0%{?with_python2}
%py2_build %py2_build
%endif %endif
%if 0%{?with_python3} %if 0%{?with_python3}
pushd %{py3dir}
%py3_build %py3_build
popd
%endif %endif
%install %install
@ -133,20 +125,18 @@ find . -name .keep -print -delete
%py2_install %py2_install
%endif %endif
%if 0%{?with_python3} %if 0%{?with_python3}
pushd %{py3dir}
%py3_install %py3_install
%endif %endif
%check %check
%if 0%{?with_python2} %if 0%{?with_python2}
# see https://github.com/pyca/cryptography/issues/4885 for the deselected test # see https://github.com/pyca/cryptography/issues/4885 and
PYTHONPATH=%{buildroot}%{python2_sitearch} %{__python2} -m pytest -k "not test_buffer_protocol_alternate_modes[mode5]" # 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 %endif
%if 0%{?with_python3} %if 0%{?with_python3}
pushd %{py3dir} 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)"
PYTHONPATH=%{buildroot}%{python3_sitearch} %{__python3} -m pytest -k "not test_buffer_protocol_alternate_modes[mode5]"
popd
%endif %endif
@ -162,12 +152,17 @@ popd
%files -n python%{python3_pkgversion}-%{srcname} %files -n python%{python3_pkgversion}-%{srcname}
%doc README.rst docs %doc README.rst docs
%license LICENSE LICENSE.APACHE LICENSE.BSD %license LICENSE LICENSE.APACHE LICENSE.BSD
%{python3_sitearch}/* %{python3_sitearch}/%{srcname}
%{python3_sitearch}/%{srcname}-%{version}-py*.egg-info %{python3_sitearch}/%{srcname}-%{version}-py*.egg-info
%endif %endif
%changelog %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 * Sat Oct 12 2019 Christian Heimes <cheimes@redhat.com> - 2.7-2
- Drop Python 2 package - Drop Python 2 package
- Resolves: rhbz#1761081 - Resolves: rhbz#1761081