Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package python-pythonfinder for 
openSUSE:Factory checked in at 2023-02-06 14:15:35
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-pythonfinder (Old)
 and      /work/SRC/openSUSE:Factory/.python-pythonfinder.new.4462 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-pythonfinder"

Mon Feb  6 14:15:35 2023 rev:10 rq:1063357 version:1.3.1

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-pythonfinder/python-pythonfinder.changes  
2022-12-13 18:55:38.579259517 +0100
+++ 
/work/SRC/openSUSE:Factory/.python-pythonfinder.new.4462/python-pythonfinder.changes
        2023-02-06 14:15:37.224631500 +0100
@@ -1,0 +2,6 @@
+Mon Feb  6 06:22:28 UTC 2023 - Steve Kowalik <steven.kowa...@suse.com>
+
+- Add patch support-packaging-22.patch:
+  * Support packaging >= 22. 
+
+-------------------------------------------------------------------

New:
----
  support-packaging-22.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python-pythonfinder.spec ++++++
--- /var/tmp/diff_new_pack.34f7Qt/_old  2023-02-06 14:15:37.728634012 +0100
+++ /var/tmp/diff_new_pack.34f7Qt/_new  2023-02-06 14:15:37.736634052 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package python-pythonfinder
 #
-# 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
@@ -21,16 +21,17 @@
 Release:        0
 Summary:        A tool to locate Python on the system
 License:        MIT
-Group:          Development/Languages/Python
 URL:            https://github.com/sarugaku/pythonfinder
 Source:         
https://github.com/sarugaku/pythonfinder/archive/refs/tags/v%{version}.tar.gz#/pythonfinder-%{version}.tar.gz
+# PATCH-FIX-UPSTREAM gh#sarugaku/pythonfinder#127
+Patch0:         support-packaging-22.patch
 BuildRequires:  %{python_module setuptools >= 36.2.2}
 BuildRequires:  fdupes
 BuildRequires:  python-rpm-macros
 Requires:       python-attrs
 Requires:       python-cached-property
 Requires:       python-click
-Requires:       python-packaging
+Requires:       python-packaging >= 22.0
 Requires:       python-vistir >= 0.2.5
 Requires(post): update-alternatives
 Requires(postun):update-alternatives
@@ -40,7 +41,7 @@
 BuildRequires:  %{python_module cached-property}
 BuildRequires:  %{python_module click}
 BuildRequires:  %{python_module crayons}
-BuildRequires:  %{python_module packaging}
+BuildRequires:  %{python_module packaging >= 22.0}
 BuildRequires:  %{python_module pytest}
 BuildRequires:  %{python_module vistir >= 0.2.5}
 # /SECTION
@@ -50,7 +51,7 @@
 A Python discovery tool to locate Python on the system.
 
 %prep
-%setup -q -n pythonfinder-%{version}
+%autosetup -p1 -n pythonfinder-%{version}
 rm -r tasks
 
 sed -i '/addopts/d' setup.cfg

++++++ support-packaging-22.patch ++++++
>From a8a74b076c43c9fc5af7e52f7fc9cd2bd394bd0f Mon Sep 17 00:00:00 2001
From: finswimmer <finswimme...@gmail.com>
Date: Wed, 21 Dec 2022 12:04:47 +0100
Subject: [PATCH 1/2] fix: catch InvalidVersion instead of handling
 LegacyVersion

LegacyVersion was removed from packaging in version 22.0
---
 src/pythonfinder/utils.py | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/src/pythonfinder/utils.py b/src/pythonfinder/utils.py
index 4330e17..2b28c2f 100644
--- a/src/pythonfinder/utils.py
+++ b/src/pythonfinder/utils.py
@@ -9,7 +9,7 @@
 from threading import Timer
 
 import attr
-from packaging.version import LegacyVersion, Version
+from packaging.version import Version, InvalidVersion
 
 from .compat import Path, TimeoutError, lru_cache  # noqa
 from .environment import MYPY_RUNNING, PYENV_ROOT, SUBPROCESS_TIMEOUT
@@ -130,12 +130,15 @@ def parse_python_version(version_str):
     is_devrelease = True if version_dict.get("dev") else False
     if patch:
         patch = int(patch)
-    version = None  # type: Optional[Union[Version, LegacyVersion]]
+
+    version = None  # type: Optional[Version]
+
     try:
         version = parse_version(version_str)
-    except TypeError:
+    except (TypeError, InvalidVersion):
         version = None
-    if isinstance(version, LegacyVersion) or version is None:
+
+    if version is None:
         v_dict = version_dict.copy()
         pre = ""
         if v_dict.get("prerel") and v_dict.get("prerelversion"):

>From e9ff2792712615965b793b6b4cc26c28f88cdb2c Mon Sep 17 00:00:00 2001
From: finswimmer <finswimme...@gmail.com>
Date: Wed, 21 Dec 2022 12:12:28 +0100
Subject: [PATCH 2/2] chore: set minimum required packaging version to 22.0

---
 setup.cfg | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/setup.cfg b/setup.cfg
index 9d615bf..fb83de1 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -39,7 +39,7 @@ package_data =
 install_requires =
     attrs
     cached-property
-    packaging
+    packaging>=22.0
 
 [options.packages.find]
 where = src

Reply via email to