From c536f6d2bc22658d179c82407379557fc9e0f6df0e1c22cd7f9405320bd1b8cc Mon Sep 17 00:00:00 2001 From: Daniel Garcia Date: Wed, 5 Feb 2025 13:20:35 +0000 Subject: [PATCH] - Use multibuild for tests OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-userpath?expand=0&rev=17 --- _multibuild | 3 +++ python-userpath.changes | 5 +++++ python-userpath.spec | 23 +++++++++++++++++++++-- 3 files changed, 29 insertions(+), 2 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-userpath.changes b/python-userpath.changes index a3dcddd..08524b0 100644 --- a/python-userpath.changes +++ b/python-userpath.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Wed Feb 5 12:20:58 UTC 2025 - Daniel Garcia + +- Use multibuild for tests + ------------------------------------------------------------------- Sat Mar 16 14:23:15 UTC 2024 - Dirk Müller diff --git a/python-userpath.spec b/python-userpath.spec index 16873d7..8006ee5 100644 --- a/python-userpath.spec +++ b/python-userpath.spec @@ -1,7 +1,7 @@ # # spec file for package python-userpath # -# Copyright (c) 2024 SUSE LLC +# Copyright (c) 2025 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -16,8 +16,16 @@ # +%global flavor @BUILD_FLAVOR@%{nil} +%if "%{flavor}" == "test" +%define psuffix -test +%bcond_without test +%else +%define psuffix %{nil} +%bcond_with test +%endif %{?sle15_python_module_pythons} -Name: python-userpath +Name: python-userpath%{psuffix} Version: 1.9.2 Release: 0 Summary: Tool for adding locations to the user PATH @@ -33,9 +41,12 @@ Requires: python-click Requires(post): update-alternatives Requires(postun): update-alternatives BuildArch: noarch +%if %{with test} # SECTION test requirements BuildRequires: %{python_module click} BuildRequires: %{python_module pytest} +BuildRequires: %{python_module userpath = %{version}} +%endif # /SECTION %python_subpackages @@ -47,17 +58,24 @@ with no elevated privileges required. %autosetup -p1 -n userpath-%{version} %build +%if !%{with test} %pyproject_wheel +%endif %install +%if !%{with test} %pyproject_install %python_clone -a %{buildroot}%{_bindir}/userpath %python_expand %fdupes %{buildroot}%{$python_sitelib} +%endif %check +%if %{with test} export LC_ALL=C.UTF-8 %pytest +%endif +%if !%{with test} %post %python_install_alternative userpath @@ -70,5 +88,6 @@ export LC_ALL=C.UTF-8 %python_alternative %{_bindir}/userpath %{python_sitelib}/userpath %{python_sitelib}/userpath-%{version}*-info +%endif %changelog