#8 Bcond for tests which allows to disable them
Merged 2 months ago by jcline. Opened 2 months ago by lbalhar.
rpms/ lbalhar/python-cryptography master  into  master

file modified
+27 -19

@@ -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:  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}-asn1crypto >= 0.21

+ BuildRequires:  python%{python3_pkgversion}-cffi >= 1.7

  BuildRequires:  python%{python3_pkgversion}-devel

- BuildRequires:  python%{python3_pkgversion}-pytest >= 3.2.1

+ BuildRequires:  python%{python3_pkgversion}-idna >= 2.1

  BuildRequires:  python%{python3_pkgversion}-setuptools

- BuildRequires:  python%{python3_pkgversion}-pretend

- BuildRequires:  python%{python3_pkgversion}-iso8601

+ BuildRequires:  python%{python3_pkgversion}-six >= 1.4.1

+ 

+ %if %{with tests}

  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}-iso8601

+ BuildRequires:  python%{python3_pkgversion}-pretend

+ BuildRequires:  python%{python3_pkgversion}-pytest >= 3.2.1

  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

+ %endif

  %endif

  

  %description

@@ -129,6 +135,7 @@ 

  %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 @@ 

  %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}

no initial comment

rebased onto c3f0350

2 months ago

One more small change because cryptography-vectors is also test-only dependency.

Pull-Request has been merged by jcline

2 months ago