From 2febc4ba61d08bf93b3da00c467ae9cca3062637777c7217bea4accce4f3ba19 Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Tue, 21 Mar 2023 20:41:06 +0000 Subject: [PATCH 1/2] Accepting request 1073470 from home:ojkastl_buildservice:Branch_devel_languages_python recreate spec file using py2pack, needs python-mock (see SR#1073469) OBS-URL: https://build.opensuse.org/request/show/1073470 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-bindep?expand=0&rev=9 --- python-bindep.changes | 9 +++++++-- python-bindep.spec | 40 ++++++++++++++++++++++++++-------------- 2 files changed, 33 insertions(+), 16 deletions(-) diff --git a/python-bindep.changes b/python-bindep.changes index 64b9062..7d1c85a 100644 --- a/python-bindep.changes +++ b/python-bindep.changes @@ -1,13 +1,18 @@ +------------------------------------------------------------------- +Tue Mar 21 07:08:38 UTC 2023 - Johannes Kastl + +- recreate spec file using py2pack + ------------------------------------------------------------------- Fri Sep 23 02:33:16 UTC 2022 - Yogalakshmi Arunachalam -- Update to 2.11.0 +- Update to 2.11.0 * Add support for Rocky Linux and Manjaro to Bindep. ------------------------------------------------------------------- Tue Jan 11 20:56:10 UTC 2022 - Dirk Müller -- add python-rpm-macros dependency +- add python-rpm-macros dependency ------------------------------------------------------------------- Tue Jan 4 09:01:17 UTC 2022 - Dirk Müller diff --git a/python-bindep.spec b/python-bindep.spec index 62642a6..2cbbec8 100644 --- a/python-bindep.spec +++ b/python-bindep.spec @@ -1,7 +1,7 @@ # # spec file for package python-bindep # -# Copyright (c) 2022 SUSE LLC +# Copyright (c) 2023 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,24 +17,35 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} -%global pythons python3 Name: python-bindep Version: 2.11.0 Release: 0 Summary: Binary dependency utility License: Apache-2.0 -Group: Development/Languages/Python -URL: https://docs.openstack.org/infra/bindep +URL: https://docs.opendev.org/opendev/bindep Source: https://files.pythonhosted.org/packages/source/b/bindep/bindep-%{version}.tar.gz -BuildRequires: %{python_module Parsley} -BuildRequires: %{python_module cliff} BuildRequires: %{python_module pbr} BuildRequires: %{python_module setuptools} BuildRequires: python-rpm-macros +# SECTION test requirements +BuildRequires: %{python_module distro >= 1.7.0} +BuildRequires: %{python_module Parsley} +BuildRequires: %{python_module coverage >= 3.6} +BuildRequires: %{python_module fixtures >= 0.3.12} +BuildRequires: %{python_module mock >= 2.0} +BuildRequires: %{python_module packaging} +BuildRequires: %{python_module pbr >= 2.0.0} +BuildRequires: %{python_module python-subunit} +BuildRequires: %{python_module testrepository >= 0.0.13} +BuildRequires: %{python_module testtools >= 0.9.27} +# /SECTION +BuildRequires: fdupes Requires: python-Parsley -Requires: python-distro +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 @@ -55,19 +66,20 @@ installed before `pip` can be used - such as `virtualenv` and `pip` itself. %install %python_install %python_clone -a %{buildroot}%{_bindir}/bindep - -%post -%{python_install_alternative bindep} - -%postun -%python_uninstall_alternative bindep +%python_expand %fdupes %{buildroot}%{$python_sitelib} # %check # %xpython_exec setup.py test +%post +%python_install_alternative bindep + +%postun +%python_uninstall_alternative bindep + %files %{python_files} +%doc AUTHORS ChangeLog NEWS.rst README.rst %license LICENSE -%doc README.rst ChangeLog AUTHORS NEWS.rst %python_alternative %{_bindir}/bindep %{python_sitelib}/* From 5aacca197a291457cfff6f71d697f22935381935378d772f45c8349a2aab72b8 Mon Sep 17 00:00:00 2001 From: Steve Kowalik Date: Mon, 27 Mar 2023 06:49:55 +0000 Subject: [PATCH 2/2] - Add patch remove-mock.patch: * Remove use of external mock module, try unittest.mock first. - Switch to pyproject macros. - Actually run the testsuite using pytest. - Stop using %python_sitelib/* OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-bindep?expand=0&rev=10 --- python-bindep.changes | 9 +++++++++ python-bindep.spec | 21 +++++++++++++-------- remove-mock.patch | 32 ++++++++++++++++++++++++++++++++ 3 files changed, 54 insertions(+), 8 deletions(-) create mode 100644 remove-mock.patch diff --git a/python-bindep.changes b/python-bindep.changes index 7d1c85a..8a691fe 100644 --- a/python-bindep.changes +++ b/python-bindep.changes @@ -1,3 +1,12 @@ +------------------------------------------------------------------- +Mon Mar 27 06:49:08 UTC 2023 - Steve Kowalik + +- Add patch remove-mock.patch: + * Remove use of external mock module, try unittest.mock first. +- Switch to pyproject macros. +- Actually run the testsuite using pytest. +- Stop using %python_sitelib/* + ------------------------------------------------------------------- Tue Mar 21 07:08:38 UTC 2023 - Johannes Kastl diff --git a/python-bindep.spec b/python-bindep.spec index 2cbbec8..d17938a 100644 --- a/python-bindep.spec +++ b/python-bindep.spec @@ -16,7 +16,6 @@ # -%{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-bindep Version: 2.11.0 Release: 0 @@ -24,6 +23,7 @@ Summary: Binary dependency utility License: Apache-2.0 URL: https://docs.opendev.org/opendev/bindep Source: https://files.pythonhosted.org/packages/source/b/bindep/bindep-%{version}.tar.gz +Patch0: remove-mock.patch BuildRequires: %{python_module pbr} BuildRequires: %{python_module setuptools} BuildRequires: python-rpm-macros @@ -32,14 +32,18 @@ BuildRequires: %{python_module distro >= 1.7.0} BuildRequires: %{python_module Parsley} BuildRequires: %{python_module coverage >= 3.6} BuildRequires: %{python_module fixtures >= 0.3.12} -BuildRequires: %{python_module mock >= 2.0} +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 BuildRequires: fdupes +BuildRequires: openSUSE-release Requires: python-Parsley Requires: python-distro >= 1.7.0 Requires: python-packaging @@ -58,18 +62,18 @@ not Python based, and particularly for testing, some dependencies have to be installed before `pip` can be used - such as `virtualenv` and `pip` itself. %prep -%setup -q -n bindep-%{version} +%autosetup -p1 -n bindep-%{version} %build -%python_build +%pyproject_wheel %install -%python_install +%pyproject_install %python_clone -a %{buildroot}%{_bindir}/bindep %python_expand %fdupes %{buildroot}%{$python_sitelib} -# %check -# %xpython_exec setup.py test +%check +%pytest -s -k 'not (test_arch_implies_pacman or test_manjaro_implies_pacman)' %post %python_install_alternative bindep @@ -81,6 +85,7 @@ installed before `pip` can be used - such as `virtualenv` and `pip` itself. %doc AUTHORS ChangeLog NEWS.rst README.rst %license LICENSE %python_alternative %{_bindir}/bindep -%{python_sitelib}/* +%{python_sitelib}/bindep +%{python_sitelib}/bindep-%{version}*info %changelog diff --git a/remove-mock.patch b/remove-mock.patch new file mode 100644 index 0000000..915ebab --- /dev/null +++ b/remove-mock.patch @@ -0,0 +1,32 @@ +Index: bindep-2.11.0/bindep/tests/test_main.py +=================================================================== +--- bindep-2.11.0.orig/bindep/tests/test_main.py ++++ bindep-2.11.0/bindep/tests/test_main.py +@@ -24,7 +24,10 @@ from fixtures import FakeLogger + from fixtures import Fixture + from fixtures import MonkeyPatch + from fixtures import TempDir +-import mock ++try: ++ from unittest import mock ++except ImportError: ++ import mock + from testtools import TestCase + + from bindep.__main__ import main +Index: bindep-2.11.0/bindep/tests/test_depends.py +=================================================================== +--- bindep-2.11.0.orig/bindep/tests/test_depends.py ++++ bindep-2.11.0/bindep/tests/test_depends.py +@@ -23,7 +23,10 @@ from textwrap import dedent + + import distro + import fixtures +-import mock ++try: ++ from unittest import mock ++except ImportError: ++ import mock + import ometa.runtime + from testtools import ExpectedException + from testtools.matchers import Contains