Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package python-click-plugins for 
openSUSE:Factory checked in at 2026-10-08 11:57:21
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-click-plugins (Old)
 and      /work/SRC/openSUSE:Factory/.python-click-plugins.new.3698736 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-click-plugins"

Thu Oct  8 11:57:21 2026 rev:13 rq:1383141 version:1.1.1.2

Changes:
--------
--- 
/work/SRC/openSUSE:Factory/python-click-plugins/python-click-plugins.changes    
    2026-07-26 11:33:07.048310866 +0200
+++ 
/work/SRC/openSUSE:Factory/.python-click-plugins.new.3698736/python-click-plugins.changes
   2026-10-08 11:59:26.634121477 +0200
@@ -1,0 +2,6 @@
+Thu Oct  8 03:28:13 UTC 2026 - Steve Kowalik <[email protected]>
+
+- Add patch no-more-pkg-resources.patch:
+  * Use importlib.metadata for entry points as well.
+
+-------------------------------------------------------------------

New:
----
  no-more-pkg-resources.patch

----------(New B)----------
  New:
- Add patch no-more-pkg-resources.patch:
  * Use importlib.metadata for entry points as well.
----------(New E)----------

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

Other differences:
------------------
++++++ python-click-plugins.spec ++++++
--- /var/tmp/diff_new_pack.yTpsnO/_old  2026-10-08 11:59:27.343150605 +0200
+++ /var/tmp/diff_new_pack.yTpsnO/_new  2026-10-08 11:59:27.345150687 +0200
@@ -30,6 +30,8 @@
 Source0:        
https://github.com/click-contrib/click-plugins/archive/refs/tags/%{version}.tar.gz#/%{name}-%{version}.tar.gz
 # PATCH-FIX-OPENSUSE https://github.com/click-contrib/click-plugins/issues/38
 Patch0:         support-click-8.2.patch
+# PATCH-FIX-OPENSUSE Use importlib.metadata, not pkg_resouces
+Patch1:         no-more-pkg-resources.patch
 BuildRequires:  %{python_module click >= 3.0}
 BuildRequires:  %{python_module pip}
 BuildRequires:  %{python_module pytest}

++++++ no-more-pkg-resources.patch ++++++
Index: click-plugins-1.1.1.2/tests/test_plugins.py
===================================================================
--- click-plugins-1.1.1.2.orig/tests/test_plugins.py
+++ click-plugins-1.1.1.2/tests/test_plugins.py
@@ -1,9 +1,6 @@
 import importlib.metadata
 
 from packaging.version import Version
-from pkg_resources import EntryPoint
-from pkg_resources import iter_entry_points
-from pkg_resources import working_set
 
 import click
 from click_plugins import with_plugins
@@ -32,37 +29,48 @@ else:
 
 # Manually register plugins in an entry point and put broken plugins in a
 # different entry point.
+GROUP_TEST = '_test_click_plugins.test_plugins'
+GROUP_BROKEN = '_test_click_plugins.broken_plugins'
 
-# The `DistStub()` class gets around an exception that is raised when
-# `entry_point.load()` is called.  By default `load()` has `requires=True`
-# which calls `dist.requires()` and the `click.group()` decorator
-# doesn't allow us to change this.  Because we are manually registering these
-# plugins the `dist` attribute is `None` so we can just create a stub that
-# always returns an empty list since we don't have any requirements.  A full
-# `pkg_resources.Distribution()` instance is not needed because there isn't
-# a package installed anywhere.
-class DistStub(object):
-    def requires(self, *args):
-        return []
-
-working_set.by_key['click']._ep_map = {
-    '_test_click_plugins.test_plugins': {
-        'cmd1': EntryPoint.parse(
-            'cmd1=tests.test_plugins:cmd1', dist=DistStub()),
-        'cmd2': EntryPoint.parse(
-            'cmd2=tests.test_plugins:cmd2', dist=DistStub())
-    },
-    '_test_click_plugins.broken_plugins': {
-        'before': EntryPoint.parse(
-            'before=tests.broken_plugins:before', dist=DistStub()),
-        'after': EntryPoint.parse(
-            'after=tests.broken_plugins:after', dist=DistStub()),
-        'do_not_exist': EntryPoint.parse(
-            'do_not_exist=tests.broken_plugins:do_not_exist', dist=DistStub())
-    }
+
+mock_entry_points_dict = {
+    GROUP_TEST: [
+        importlib.metadata.EntryPoint(
+            name='cmd1',
+            value='tests.test_plugins:cmd1',
+            group=GROUP_TEST
+        ),
+        importlib.metadata.EntryPoint(
+            name='cmd2',
+            value='tests.test_plugins:cmd2',
+            group=GROUP_TEST
+        ),
+    ],
+    GROUP_BROKEN: [
+        importlib.metadata.EntryPoint(
+            name='before',
+            value='tests.broken_plugins:before',
+            group=GROUP_BROKEN
+        ),
+        importlib.metadata.EntryPoint(
+            name='after',
+            value='tests.broken_plugins:after',
+            group=GROUP_BROKEN
+        ),
+        importlib.metadata.EntryPoint(
+            name='do_not_exist',
+            value='tests.broken_plugins:do_not_exist',
+            group=GROUP_BROKEN
+        ),
+    ]
 }
 
 
+# Re-use function name to make the patch smaller
+def iter_entry_points(group):
+    return iter(mock_entry_points_dict[group])
+
+
 # Main CLI groups - one with good plugins attached and the other broken
 @with_plugins(iter_entry_points('_test_click_plugins.test_plugins'))
 @click.group()

Reply via email to