From f2f84f8ff47bad31f89e224d36204aa92e4271f2 Mon Sep 17 00:00:00 2001 From: Yaakov Selkowitz Date: Thu, 11 May 2023 12:00:00 -0400 Subject: [PATCH] Disable tests by default in RHEL builds Some of the test dependencies are unwanted in RHEL. --- micropipenv.spec | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/micropipenv.spec b/micropipenv.spec index f81ab5d..2fda80e 100644 --- a/micropipenv.spec +++ b/micropipenv.spec @@ -1,3 +1,10 @@ +# some test dependencies are unwanted in RHEL +%if 0%{?rhel} +%bcond_with tests +%else +%bcond_without tests +%endif + Name: micropipenv Version: 1.5.0 Release: %autorelease @@ -26,7 +33,7 @@ converting them to pip-tools compatible output. sed -i '1{\@^#!/usr/bin/env python@d}' %{name}.py %generate_buildrequires -%pyproject_buildrequires -r -t -x toml +%pyproject_buildrequires -r %{?with_tests:-t} -x toml %build %pyproject_wheel @@ -36,8 +43,12 @@ sed -i '1{\@^#!/usr/bin/env python@d}' %{name}.py %pyproject_save_files %{name} %check +%if %{with tests} # skipped tests requires internet or checks pip version %pytest -m "not online" -k "not test_check_pip_version and not test_install_invalid_toml_file" +%else +%pyproject_check_import +%endif %files -f %pyproject_files %doc README.rst