From 2d22d2c0e8fa88f7d6079ae314a2eb9bcee6cc60 Mon Sep 17 00:00:00 2001 From: Nathan Simpson Date: Thu, 18 Jul 2024 17:22:37 +0100 Subject: [PATCH] add setup entrypoint --- .ruff.toml | 1 - ocf_blosc2/ocf_blosc2.py | 4 ---- setup.py | 8 +++++++- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.ruff.toml b/.ruff.toml index 6eb4460..fb219fa 100644 --- a/.ruff.toml +++ b/.ruff.toml @@ -41,7 +41,6 @@ dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$" target-version = "py310" fix = false # Group violations by containing file. -format = "github" ignore-init-module-imports = true [mccabe] diff --git a/ocf_blosc2/ocf_blosc2.py b/ocf_blosc2/ocf_blosc2.py index db4dd7c..c42b887 100644 --- a/ocf_blosc2/ocf_blosc2.py +++ b/ocf_blosc2/ocf_blosc2.py @@ -1,7 +1,6 @@ import blosc2 from numcodecs.abc import Codec from numcodecs.compat import ensure_contiguous_ndarray -from numcodecs.registry import register_codec class Blosc2(Codec): @@ -46,6 +45,3 @@ def __repr__(self): self.clevel, ) return r - - -register_codec(Blosc2) diff --git a/setup.py b/setup.py index 8e377b7..b81f3e9 100644 --- a/setup.py +++ b/setup.py @@ -1,6 +1,7 @@ -""" +""" For more detailed information, please check the accompanying README.md. """ + from pathlib import Path from setuptools import find_packages, setup @@ -20,4 +21,9 @@ long_description=long_description, long_description_content_type="text/markdown", packages=find_packages(), + entry_points={ + "numcodecs.codecs": [ + "blosc2 = ocf_blosc2:Blosc2", + ], + }, )