From eb01aeacf932404488a1019a3584a606804f0f27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Wed, 14 Jun 2023 18:08:37 +0200 Subject: [PATCH] Add a tests bcond --- python-tox-current-env.spec | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/python-tox-current-env.spec b/python-tox-current-env.spec index a8167bf..c6c67b2 100644 --- a/python-tox-current-env.spec +++ b/python-tox-current-env.spec @@ -11,6 +11,8 @@ BuildArch: noarch BuildRequires: python%{python3_pkgversion}-devel BuildRequires: pyproject-rpm-macros +%bcond tests 1 + %description The tox-current-env plugin allows to run tests in current Python environment. @@ -29,7 +31,7 @@ The tox-current-env plugin allows to run tests in current Python environment. %generate_buildrequires # Don't use %%pyproject_buildrequires -t/-e to avoid a build dependency loop -%pyproject_buildrequires -x tests +%pyproject_buildrequires %{?with_tests:-x tests} %build @@ -45,8 +47,10 @@ The tox-current-env plugin allows to run tests in current Python environment. # hooks[34].py are imported in hooks.py based on tox version so we have to # exclude them here. %pyproject_check_import -e '*.hooks?' +%if %{with tests} # deselected tests run tox without the options for this plugin and hence they need internet %pytest -k "not regular and not noquiet_installed_packages[None]" +%endif %files -n python%{python3_pkgversion}-tox-current-env -f %{pyproject_files}