From ce9197eff2700dd92546da779fc30c74b978d579 Mon Sep 17 00:00:00 2001 From: jakirkham Date: Wed, 4 Oct 2023 12:06:49 -0700 Subject: [PATCH 1/2] Support Python 3.12 --- .github/workflows/ci-linux.yaml | 2 +- .github/workflows/ci-osx.yaml | 2 +- .github/workflows/ci-windows.yaml | 2 +- docs/release.rst | 2 ++ 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci-linux.yaml b/.github/workflows/ci-linux.yaml index a46ad395..665f6233 100644 --- a/.github/workflows/ci-linux.yaml +++ b/.github/workflows/ci-linux.yaml @@ -12,7 +12,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ["3.8", "3.9", "3.10", "3.11"] + python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] steps: - name: Checkout source diff --git a/.github/workflows/ci-osx.yaml b/.github/workflows/ci-osx.yaml index 1f340bc0..e76fe050 100644 --- a/.github/workflows/ci-osx.yaml +++ b/.github/workflows/ci-osx.yaml @@ -12,7 +12,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ["3.8", "3.9", "3.10", "3.11"] + python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] steps: - name: Checkout source diff --git a/.github/workflows/ci-windows.yaml b/.github/workflows/ci-windows.yaml index 154ed20b..c2847b5c 100644 --- a/.github/workflows/ci-windows.yaml +++ b/.github/workflows/ci-windows.yaml @@ -12,7 +12,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ["3.8", "3.9", "3.10", "3.11"] + python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] steps: - name: Checkout source diff --git a/docs/release.rst b/docs/release.rst index 1c64cee1..5b9d493d 100644 --- a/docs/release.rst +++ b/docs/release.rst @@ -19,6 +19,8 @@ Enhancements By :user:`Martin Durant `, :issue:`410`. * Add ``jenkins_lookup3`` checksum codec By :user:`Mark Kittisopkul `, :issue:`445`. +* Support Python 3.12. + By :user:`John Kirkham `, :issue:`471`. Fix ~~~ From 49abafee58f9883e6a192e6862978aa9f8d7bc03 Mon Sep 17 00:00:00 2001 From: jakirkham Date: Wed, 4 Oct 2023 12:46:11 -0700 Subject: [PATCH 2/2] Ensure `entries.update(...)` recieves a `dict` On Python 3.12, the existing code did not produce a `dict` that could be used to update `entries` whereas previous Python versions had. To workaround this issue, manually create a `dict` that can be used to update `entries` with a format consistent to what had been seen in Python versions before 3.12. --- numcodecs/registry.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/numcodecs/registry.py b/numcodecs/registry.py index a4dff6d7..24186fa5 100644 --- a/numcodecs/registry.py +++ b/numcodecs/registry.py @@ -13,7 +13,7 @@ def run_entrypoints(): 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")) + entries.update({e.name: e for e in eps.select(group="numcodecs.codecs")}) else: # Otherwise, fallback to using get entries.update(eps.get("numcodecs.codecs", []))