From d35be4dda93ad4bdf06aab72139f727772021176416869780f22ef39e377767e Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Wed, 16 Feb 2022 19:00:35 +0000 Subject: [PATCH] - split tests in a multibuild variant to optimize rebuild time a bit OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-cryptography?expand=0&rev=143 --- _multibuild | 3 +++ python-cryptography.changes | 5 +++++ python-cryptography.spec | 29 ++++++++++++++++++++++------- 3 files changed, 30 insertions(+), 7 deletions(-) create mode 100644 _multibuild diff --git a/_multibuild b/_multibuild new file mode 100644 index 0000000..fcc7b97 --- /dev/null +++ b/_multibuild @@ -0,0 +1,3 @@ + + test + diff --git a/python-cryptography.changes b/python-cryptography.changes index d013d13..f2b62a6 100644 --- a/python-cryptography.changes +++ b/python-cryptography.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Wed Feb 16 19:00:16 UTC 2022 - Dirk Müller + +- split tests in a multibuild variant to optimize rebuild time a bit + ------------------------------------------------------------------- Mon Dec 20 22:52:53 UTC 2021 - Dirk Müller diff --git a/python-cryptography.spec b/python-cryptography.spec index c8a3366..4c9dd1b 100644 --- a/python-cryptography.spec +++ b/python-cryptography.spec @@ -1,7 +1,7 @@ # -# spec file for package python-cryptography +# spec file # -# Copyright (c) 2021 SUSE LLC +# Copyright (c) 2022 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -19,7 +19,15 @@ %{?!python_module:%define python_module() python3-%{**}} %define skip_python2 1 %global rustflags '-Clink-arg=-Wl,-z,relro,-z,now' -Name: python-cryptography +%global flavor @BUILD_FLAVOR@%{nil} +%if "%{flavor}" == "test" +%define psuffix -test +%bcond_without test +%else +%define psuffix %{nil} +%bcond_with test +%endif +Name: python-cryptography%{psuffix} Version: 36.0.1 Release: 0 Summary: Python library which exposes cryptographic recipes and primitives @@ -32,7 +40,7 @@ Source1: https://files.pythonhosted.org/packages/source/c/cryptography/cr Source2: vendor.tar.xz # use `osc service disabledrun` to regenerate Source3: cargo_config -Source4: %{name}.keyring +Source4: python-cryptography.keyring Patch2: skip_openssl_memleak_test.patch BuildRequires: %{python_module cffi >= 1.12} BuildRequires: %{python_module devel} @@ -45,10 +53,11 @@ BuildRequires: pkgconfig BuildRequires: python-rpm-macros BuildRequires: rust >= 1.41.0 BuildRequires: pkgconfig(libffi) -%requires_eq python-cffi # python-base is not enough, we need the _ssl module Requires: python -# SECTION Test requirements +%requires_eq python-cffi +%if %{with test} +BuildRequires: %{python_module cryptography >= %{version}} BuildRequires: %{python_module cryptography-vectors = %{version}} BuildRequires: %{python_module hypothesis >= 1.11.4} BuildRequires: %{python_module iso8601} @@ -57,7 +66,7 @@ BuildRequires: %{python_module pytest > 6.0} BuildRequires: %{python_module pytest-subtests} BuildRequires: %{python_module pytest-xdist} BuildRequires: %{python_module pytz} -# /SECTION +%endif %python_subpackages %description @@ -81,6 +90,7 @@ export RUSTFLAGS=%{rustflags} export CFLAGS="%{optflags} -fno-strict-aliasing" %python_build +%if !%{with test} %install export RUSTFLAGS=%{rustflags} # Actually other *.c and *.h are appropriate @@ -89,14 +99,19 @@ find . -name .keep -print -delete %python_install %python_expand %fdupes %{buildroot}%{$python_sitearch} +%endif +%if %{with test} %check %pytest_arch -n auto +%endif +%if !%{with test} %files %{python_files} %license LICENSE LICENSE.APACHE LICENSE.BSD %doc CONTRIBUTING.rst CHANGELOG.rst README.rst %{python_sitearch}/cryptography %{python_sitearch}/cryptography-%{version}*-info +%endif %changelog