Skip to content

Commit 680d020

Browse files
authored
Support Python 3.12 (#471)
* Support Python 3.12 * 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.
1 parent 515d097 commit 680d020

File tree

5 files changed

+6
-4
lines changed

5 files changed

+6
-4
lines changed

.github/workflows/ci-linux.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
strategy:
1313
fail-fast: false
1414
matrix:
15-
python-version: ["3.8", "3.9", "3.10", "3.11"]
15+
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
1616

1717
steps:
1818
- name: Checkout source

.github/workflows/ci-osx.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
strategy:
1313
fail-fast: false
1414
matrix:
15-
python-version: ["3.8", "3.9", "3.10", "3.11"]
15+
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
1616

1717
steps:
1818
- name: Checkout source

.github/workflows/ci-windows.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
strategy:
1313
fail-fast: false
1414
matrix:
15-
python-version: ["3.8", "3.9", "3.10", "3.11"]
15+
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
1616

1717
steps:
1818
- name: Checkout source

docs/release.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ Enhancements
1919
By :user:`Martin Durant <martindurant>`, :issue:`410`.
2020
* Add ``jenkins_lookup3`` checksum codec
2121
By :user:`Mark Kittisopkul <mkitti>`, :issue:`445`.
22+
* Support Python 3.12.
23+
By :user:`John Kirkham <jakirkham>`, :issue:`471`.
2224

2325
Fix
2426
~~~

numcodecs/registry.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ def run_entrypoints():
1313
eps = entry_points()
1414
if hasattr(eps, 'select'):
1515
# If entry_points() has a select method, use that. Python 3.10+
16-
entries.update(eps.select(group="numcodecs.codecs"))
16+
entries.update({e.name: e for e in eps.select(group="numcodecs.codecs")})
1717
else:
1818
# Otherwise, fallback to using get
1919
entries.update(eps.get("numcodecs.codecs", []))

0 commit comments

Comments
 (0)