From e8589085fc6eb9a92c3097e1559aa70e91454856cae9fde05027b34a50bb808f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mark=C3=A9ta=20Machov=C3=A1?= Date: Mon, 18 Mar 2024 15:53:16 +0000 Subject: [PATCH] Accepting request 1158625 from home:jaimeMF:branches:devel:languages:python - Add 0001-Fix-test_different_python-under-pyhon-3.12.patch OBS-URL: https://build.opensuse.org/request/show/1158625 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pip-licenses?expand=0&rev=32 --- ...st_different_python-under-pyhon-3.12.patch | 30 +++++++++++++++++++ python-pip-licenses.changes | 5 ++++ python-pip-licenses.spec | 4 ++- 3 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 0001-Fix-test_different_python-under-pyhon-3.12.patch diff --git a/0001-Fix-test_different_python-under-pyhon-3.12.patch b/0001-Fix-test_different_python-under-pyhon-3.12.patch new file mode 100644 index 0000000..2431393 --- /dev/null +++ b/0001-Fix-test_different_python-under-pyhon-3.12.patch @@ -0,0 +1,30 @@ +From 4c1906f3575b7893b1bd6ae6e77332c67991f1f4 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Jaime=20Marqui=CC=81nez=20Ferra=CC=81ndiz?= + +Date: Sat, 16 Mar 2024 22:06:29 +0100 +Subject: [PATCH] Fix test_different_python under pyhon 3.12 + +setuptools is no longer preinstalled by the venv module. +--- + test_piplicenses.py | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/test_piplicenses.py b/test_piplicenses.py +index 41d09cf..5a704b1 100644 +--- a/test_piplicenses.py ++++ b/test_piplicenses.py +@@ -867,7 +867,10 @@ def test_different_python() -> None: + package_names = sorted(set(p["name"] for p in pkgs)) + print(package_names) + +- assert package_names == ["pip", "setuptools"] ++ expected_packages = ["pip"] ++ if sys.version_info < (3, 12, 0): ++ expected_packages.append("setuptools") ++ assert package_names == expected_packages + + + def test_fail_on(monkeypatch) -> None: +-- +2.44.0 + diff --git a/python-pip-licenses.changes b/python-pip-licenses.changes index b8987f3..17f0bc0 100644 --- a/python-pip-licenses.changes +++ b/python-pip-licenses.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Sat Mar 16 21:15:36 UTC 2024 - Jaime Marquínez Ferrándiz + +- Add 0001-Fix-test_different_python-under-pyhon-3.12.patch + ------------------------------------------------------------------- Tue Jan 23 06:46:01 UTC 2024 - Daniel Garcia diff --git a/python-pip-licenses.spec b/python-pip-licenses.spec index b8f740b..d4c6eb5 100644 --- a/python-pip-licenses.spec +++ b/python-pip-licenses.spec @@ -24,6 +24,8 @@ Summary: Python packages license list License: MIT URL: https://github.com/raimon49/pip-licenses Source: https://files.pythonhosted.org/packages/source/p/pip-licenses/pip-licenses-%{version}.tar.gz +# FIX-UPSTREAM https://github.com/raimon49/pip-licenses/pull/184 +Patch1: 0001-Fix-test_different_python-under-pyhon-3.12.patch BuildRequires: %{python_module importlib_metadata} BuildRequires: %{python_module pip} BuildRequires: %{python_module setuptools} @@ -32,7 +34,7 @@ BuildRequires: python-rpm-macros Requires: python-PrettyTable Requires: python-pip Requires(post): update-alternatives -Requires(postun):update-alternatives +Requires(postun): update-alternatives BuildArch: noarch # SECTION test requirements BuildRequires: %{python_module build}