Skip to content

Commit

Permalink
Support Python 3.12 (#471)
Browse files Browse the repository at this point in the history
* 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.
  • Loading branch information
jakirkham committed Oct 6, 2023
1 parent 515d097 commit 680d020
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci-linux.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-osx.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-windows.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions docs/release.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ Enhancements
By :user:`Martin Durant <martindurant>`, :issue:`410`.
* Add ``jenkins_lookup3`` checksum codec
By :user:`Mark Kittisopkul <mkitti>`, :issue:`445`.
* Support Python 3.12.
By :user:`John Kirkham <jakirkham>`, :issue:`471`.

Fix
~~~
Expand Down
2 changes: 1 addition & 1 deletion numcodecs/registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -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", []))
Expand Down

0 comments on commit 680d020

Please sign in to comment.