Skip to content

Commit

Permalink
Clean up entrypoints code for Python 3.10+
Browse files Browse the repository at this point in the history
  • Loading branch information
dstansby committed Jun 19, 2024
1 parent bd3d0c0 commit fc65639
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions numcodecs/registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,7 @@
def run_entrypoints():
entries.clear()
eps = entry_points()
if hasattr(eps, 'select'):
# If entry_points() has a select method, use that. Python 3.10+
entries.update({e.name: e for e in eps.select(group="numcodecs.codecs")})
else:
# Otherwise, fallback to using get
entries.update({e.name: e for e in eps.get("numcodecs.codecs", [])})
entries.update({e.name: e for e in eps.select(group="numcodecs.codecs")})


run_entrypoints()
Expand Down

0 comments on commit fc65639

Please sign in to comment.