From 94c3d4b5decbd11f3ecbbdd1a06b67e4383171dda5221734e5e46a927325489f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mark=C3=A9ta=20Machov=C3=A1?= Date: Tue, 17 Jun 2025 07:58:53 +0000 Subject: [PATCH 1/2] - Convert to libalternatives OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-bindep?expand=0&rev=18 --- python-bindep.changes | 5 +++++ python-bindep.spec | 32 +++++++++++++++----------------- 2 files changed, 20 insertions(+), 17 deletions(-) diff --git a/python-bindep.changes b/python-bindep.changes index 346adcb..e1a1b49 100644 --- a/python-bindep.changes +++ b/python-bindep.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Tue Jun 17 07:58:12 UTC 2025 - Markéta Machová + +- Convert to libalternatives + ------------------------------------------------------------------- Mon Apr 28 08:44:31 UTC 2025 - John Paul Adrian Glaubitz diff --git a/python-bindep.spec b/python-bindep.spec index 01ef72a..d8809db 100644 --- a/python-bindep.spec +++ b/python-bindep.spec @@ -16,6 +16,7 @@ # +%bcond_without libalternatives %{?sle15_python_module_pythons} Name: python-bindep Version: 2.13.0 @@ -26,11 +27,22 @@ URL: https://docs.opendev.org/opendev/bindep Source: https://files.pythonhosted.org/packages/source/b/bindep/bindep-%{version}.tar.gz BuildRequires: %{python_module pbr} BuildRequires: %{python_module setuptools} +BuildRequires: alts +BuildRequires: fdupes +BuildRequires: openSUSE-release BuildRequires: python-rpm-macros +Requires: alts +Requires: python-Parsley +Requires: python-distro >= 1.7.0 +Requires: python-packaging +Requires: python-pbr >= 2.0.0 +Suggests: python-distro < 1.7.0 +Suggests: python-packaging < 21.0 +BuildArch: noarch # SECTION test requirements -BuildRequires: %{python_module distro >= 1.7.0} BuildRequires: %{python_module Parsley} BuildRequires: %{python_module coverage >= 3.6} +BuildRequires: %{python_module distro >= 1.7.0} BuildRequires: %{python_module fixtures >= 0.3.12} BuildRequires: %{python_module hatchling} BuildRequires: %{python_module packaging} @@ -42,17 +54,6 @@ BuildRequires: %{python_module testrepository >= 0.0.13} BuildRequires: %{python_module testtools >= 0.9.27} BuildRequires: %{python_module wheel} # /SECTION -BuildRequires: fdupes -BuildRequires: openSUSE-release -Requires(post): update-alternatives -Requires(postun): update-alternatives -Requires: python-Parsley -Requires: python-distro >= 1.7.0 -Requires: python-packaging -Requires: python-pbr >= 2.0.0 -Suggests: python-distro < 1.7.0 -Suggests: python-packaging < 21.0 -BuildArch: noarch %python_subpackages %description @@ -77,11 +78,8 @@ installed before `pip` can be used - such as `virtualenv` and `pip` itself. %check %pytest -s -k 'not (test_arch_implies_pacman or test_manjaro_implies_pacman)' -%post -%python_install_alternative bindep - -%postun -%python_uninstall_alternative bindep +%pre +%python_libalternatives_reset_alternative bindep %files %{python_files} %doc AUTHORS ChangeLog NEWS.rst README.rst From c3fe7d198e1ebaec0587086f39c475cb0d9bf6609ac098e478e4cbd3bcaabf3a Mon Sep 17 00:00:00 2001 From: Daniel Garcia Date: Wed, 18 Jun 2025 07:48:09 +0000 Subject: [PATCH 2/2] - Use multibuild for running tests OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-bindep?expand=0&rev=19 --- _multibuild | 3 +++ python-bindep.changes | 5 +++++ python-bindep.spec | 26 +++++++++++++++++++++++--- 3 files changed, 31 insertions(+), 3 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-bindep.changes b/python-bindep.changes index e1a1b49..956c39a 100644 --- a/python-bindep.changes +++ b/python-bindep.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Wed Jun 18 07:47:52 UTC 2025 - Daniel Garcia + +- Use multibuild for running tests + ------------------------------------------------------------------- Tue Jun 17 07:58:12 UTC 2025 - Markéta Machová diff --git a/python-bindep.spec b/python-bindep.spec index d8809db..df2755c 100644 --- a/python-bindep.spec +++ b/python-bindep.spec @@ -16,9 +16,18 @@ # +%global flavor @BUILD_FLAVOR@%{nil} +%if "%{flavor}" == "test" +%define psuffix -test +%bcond_without test +%else +%define psuffix %{nil} +%bcond_with test +%endif + %bcond_without libalternatives %{?sle15_python_module_pythons} -Name: python-bindep +Name: python-bindep%{psuffix} Version: 2.13.0 Release: 0 Summary: Binary dependency utility @@ -26,7 +35,9 @@ License: Apache-2.0 URL: https://docs.opendev.org/opendev/bindep Source: https://files.pythonhosted.org/packages/source/b/bindep/bindep-%{version}.tar.gz BuildRequires: %{python_module pbr} +BuildRequires: %{python_module pip} BuildRequires: %{python_module setuptools} +BuildRequires: %{python_module wheel} BuildRequires: alts BuildRequires: fdupes BuildRequires: openSUSE-release @@ -39,6 +50,9 @@ Requires: python-pbr >= 2.0.0 Suggests: python-distro < 1.7.0 Suggests: python-packaging < 21.0 BuildArch: noarch + +%if %{with test} +BuildRequires: %{python_module bindep = %{version}} # SECTION test requirements BuildRequires: %{python_module Parsley} BuildRequires: %{python_module coverage >= 3.6} @@ -47,13 +61,13 @@ BuildRequires: %{python_module fixtures >= 0.3.12} BuildRequires: %{python_module hatchling} BuildRequires: %{python_module packaging} BuildRequires: %{python_module pbr >= 2.0.0} -BuildRequires: %{python_module pip} BuildRequires: %{python_module pytest} BuildRequires: %{python_module python-subunit} BuildRequires: %{python_module testrepository >= 0.0.13} BuildRequires: %{python_module testtools >= 0.9.27} -BuildRequires: %{python_module wheel} # /SECTION +%endif + %python_subpackages %description @@ -71,13 +85,18 @@ installed before `pip` can be used - such as `virtualenv` and `pip` itself. %pyproject_wheel %install +%if !%{with test} %pyproject_install %python_clone -a %{buildroot}%{_bindir}/bindep %python_expand %fdupes %{buildroot}%{$python_sitelib} +%endif %check +%if %{with test} %pytest -s -k 'not (test_arch_implies_pacman or test_manjaro_implies_pacman)' +%endif +%if !%{with test} %pre %python_libalternatives_reset_alternative bindep @@ -87,5 +106,6 @@ installed before `pip` can be used - such as `virtualenv` and `pip` itself. %python_alternative %{_bindir}/bindep %{python_sitelib}/bindep %{python_sitelib}/bindep-%{version}*info +%endif %changelog