Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package python-numcodecs for 
openSUSE:Factory checked in at 2023-08-28 17:15:56
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-numcodecs (Old)
 and      /work/SRC/openSUSE:Factory/.python-numcodecs.new.1766 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-numcodecs"

Mon Aug 28 17:15:56 2023 rev:5 rq:1106198 version:0.11.0

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-numcodecs/python-numcodecs.changes        
2023-01-14 00:03:36.097845065 +0100
+++ 
/work/SRC/openSUSE:Factory/.python-numcodecs.new.1766/python-numcodecs.changes  
    2023-08-28 17:16:02.594434827 +0200
@@ -1,0 +2,6 @@
+Mon Aug 28 02:21:23 UTC 2023 - Steve Kowalik <steven.kowa...@suse.com>
+
+- Add patch move-from-entrypoints.patch:
+  * Drop requirements on entrypoints, use importlib.metadata.
+
+-------------------------------------------------------------------

New:
----
  move-from-entrypoints.patch

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

Other differences:
------------------
++++++ python-numcodecs.spec ++++++
--- /var/tmp/diff_new_pack.O5HHNv/_old  2023-08-28 17:16:03.910482086 +0200
+++ /var/tmp/diff_new_pack.O5HHNv/_new  2023-08-28 17:16:03.914482229 +0200
@@ -27,6 +27,8 @@
 Patch0:         unbundle-libs.patch
 # PATCH-FIX-UPSTREAM numcodecs-pr417-raggednumpy.patch 
gh#zarr-developers/numcodecs#417
 Patch1:         numcodecs-pr417-raggednumpy.patch
+# PATCH-FIX-UPSTREAM gh#zarr-developers/numcodecs#442
+Patch2:         move-from-entrypoints.patch
 BuildRequires:  %{python_module Cython}
 BuildRequires:  %{python_module base >= 3.8}
 BuildRequires:  %{python_module pip}
@@ -43,13 +45,11 @@
 BuildRequires:  pkgconfig(liblz4)
 BuildRequires:  pkgconfig(libzstd)
 BuildRequires:  pkgconfig(zlib)
-Requires:       python-entrypoints
 Requires:       python-numpy >= 1.7
 Suggests:       python-msgpack
 Suggests:       python-zfpy >= 1
 # SECTION test requirements
 BuildRequires:  %{python_module numpy >= 1.7}
-BuildRequires:  %{python_module entrypoints}
 BuildRequires:  %{python_module msgpack}
 BuildRequires:  %{python_module pytest}
 # /SECTION

++++++ move-from-entrypoints.patch ++++++
>From af20af8210384371f91f30251fc78a35ffd0c072 Mon Sep 17 00:00:00 2001
From: Steve Kowalik <ste...@wedontsleep.org>
Date: Wed, 9 Aug 2023 15:15:52 +1000
Subject: [PATCH] Remove use of entrypoints

Since Python 3.8, the standard library has included functionality to
query entry points directly using importlib.metadata. Since the API has
changed for the better with Python 3.10, we need to support both ways of
using it.
---
 numcodecs/registry.py               | 14 +++++++++-----
 numcodecs/tests/test_entrypoints.py |  2 --
 pyproject.toml                      |  7 ++++++-
 3 files changed, 15 insertions(+), 8 deletions(-)

diff --git a/numcodecs/registry.py b/numcodecs/registry.py
index 532e9967..a4dff6d7 100644
--- a/numcodecs/registry.py
+++ b/numcodecs/registry.py
@@ -1,7 +1,7 @@
 """The registry module provides some simple convenience functions to enable
 applications to dynamically register and look-up codec classes."""
+from importlib.metadata import entry_points
 import logging
-from contextlib import suppress
 
 logger = logging.getLogger("numcodecs")
 codec_registry = {}
@@ -9,13 +9,17 @@
 
 
 def run_entrypoints():
-    import entrypoints
     entries.clear()
-    entries.update(entrypoints.get_group_named("numcodecs.codecs"))
+    eps = entry_points()
+    if hasattr(eps, 'select'):
+        # If entry_points() has a select method, use that. Python 3.10+
+        entries.update(eps.select(group="numcodecs.codecs"))
+    else:
+        # Otherwise, fallback to using get
+        entries.update(eps.get("numcodecs.codecs", []))
 
 
-with suppress(ImportError):
-    run_entrypoints()
+run_entrypoints()
 
 
 def get_codec(config):
diff --git a/numcodecs/tests/test_entrypoints.py 
b/numcodecs/tests/test_entrypoints.py
index 81af635d..0d017f2d 100644
--- a/numcodecs/tests/test_entrypoints.py
+++ b/numcodecs/tests/test_entrypoints.py
@@ -7,7 +7,6 @@
 
 
 here = os.path.abspath(os.path.dirname(__file__))
-pytest.importorskip("entrypoints")
 
 
 @pytest.fixture()
@@ -20,7 +19,6 @@ def set_path():
     numcodecs.registry.codec_registry.pop("test")
 
 
-@pytest.mark.xfail(reason="FIXME: not working in wheels build")
 def test_entrypoint_codec(set_path):
     cls = numcodecs.registry.get_codec({"id": "test"})
     assert cls.codec_id == "test"
diff --git a/pyproject.toml b/pyproject.toml
index a2b50e32..147f9b54 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -15,7 +15,6 @@ in data storage and communication applications.
 """
 readme =  "README.rst"
 dependencies = [
-    "entrypoints",
     "numpy>=1.7",
 ]
 requires-python = ">=3.8"
@@ -71,6 +70,12 @@ package-dir = {"" = "."}
 packages = ["numcodecs", "numcodecs.tests"]
 zip-safe = false
 
+[tool.setuptools.package-data]
+numcodecs = [
+    "tests/package_with_entrypoint/__init__.py",
+    "tests/package_with_entrypoint-0.1.dist-info/entry_points.txt"
+]
+
 [tool.setuptools_scm]
 version_scheme = "guess-next-dev"
 local_scheme = "dirty-tag"

Reply via email to