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