Bcond for tests which allows to disable them

This commit is contained in:
Lumir Balhar 2019-11-18 14:16:21 +01:00
parent 004fe01826
commit c3f035031c

View File

@ -12,6 +12,8 @@
%bcond_without python2
%endif
%bcond_without tests
%{!?python3_pkgversion:%global python3_pkgversion 3}
%global srcname cryptography
@ -29,37 +31,41 @@ BuildRequires: openssl-devel
BuildRequires: gcc
%if 0%{?with_python2}
BuildRequires: python2-devel
BuildRequires: python2-pytest >= 3.2.1
BuildRequires: python2-setuptools
BuildRequires: python2-pretend
BuildRequires: python2-iso8601
BuildRequires: python2-cryptography-vectors = %{version}
BuildRequires: python2-asn1crypto >= 0.21
BuildRequires: python2-hypothesis >= 1.11.4
BuildRequires: python2-pytz
BuildRequires: python2-idna >= 2.1
BuildRequires: python2-six >= 1.4.1
BuildRequires: python2-cffi >= 1.7
BuildRequires: python2-cryptography-vectors = %{version}
BuildRequires: python2-devel
BuildRequires: python2-enum34
BuildRequires: python2-idna >= 2.1
BuildRequires: python2-ipaddress
BuildRequires: python2-setuptools
BuildRequires: python2-six >= 1.4.1
%if %{with tests}
BuildRequires: python2-hypothesis >= 1.11.4
BuildRequires: python2-iso8601
BuildRequires: python2-pretend
BuildRequires: python2-pytest >= 3.2.1
BuildRequires: python2-pytz
%endif
%endif
%if 0%{?with_python3}
BuildRequires: python%{python3_pkgversion}-devel
BuildRequires: python%{python3_pkgversion}-pytest >= 3.2.1
BuildRequires: python%{python3_pkgversion}-setuptools
BuildRequires: python%{python3_pkgversion}-pretend
BuildRequires: python%{python3_pkgversion}-iso8601
BuildRequires: python%{python3_pkgversion}-cryptography-vectors = %{version}
BuildRequires: python%{python3_pkgversion}-asn1crypto >= 0.21
BuildRequires: python%{python3_pkgversion}-hypothesis >= 1.11.4
BuildRequires: python%{python3_pkgversion}-pytz
BuildRequires: python%{python3_pkgversion}-idna >= 2.1
BuildRequires: python%{python3_pkgversion}-six >= 1.4.1
BuildRequires: python%{python3_pkgversion}-cffi >= 1.7
BuildRequires: python%{python3_pkgversion}-devel
BuildRequires: python%{python3_pkgversion}-idna >= 2.1
BuildRequires: python%{python3_pkgversion}-setuptools
BuildRequires: python%{python3_pkgversion}-six >= 1.4.1
%if %{with tests}
BuildRequires: python%{python3_pkgversion}-cryptography-vectors = %{version}
BuildRequires: python%{python3_pkgversion}-hypothesis >= 1.11.4
BuildRequires: python%{python3_pkgversion}-iso8601
BuildRequires: python%{python3_pkgversion}-pretend
BuildRequires: python%{python3_pkgversion}-pytest >= 3.2.1
BuildRequires: python%{python3_pkgversion}-pytz
%endif
%endif
%description
@ -129,6 +135,7 @@ find . -name .keep -print -delete
%endif
%check
%if %{with tests}
%if 0%{?with_python2}
# see https://github.com/pyca/cryptography/issues/4885 and
# see https://bugzilla.redhat.com/show_bug.cgi?id=1761194 for deselected tests
@ -138,6 +145,7 @@ PYTHONPATH=%{buildroot}%{python2_sitearch} %{__python2} -m pytest -k "not (test_
%if 0%{?with_python3}
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
%endif
%if 0%{?with_python2}