diff --git a/pyproject.toml b/pyproject.toml index ac87676..90b1ad3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -73,5 +73,5 @@ line-ending = "auto" [tool.setuptools.packages.find] include = ["soapnormalizer*"] -[tool.setuptools.package-data] -soapnormalizer = ["*/nomad_plugin.yaml"] +[project.entry-points.'nomad.plugin'] +soapnormalizer = "soapnormalizer:soap_normalizer_entry_point" diff --git a/soapnormalizer/__init__.py b/soapnormalizer/__init__.py index a5f0ec0..3c54cae 100644 --- a/soapnormalizer/__init__.py +++ b/soapnormalizer/__init__.py @@ -15,4 +15,20 @@ # See the License for the specific language governing permissions and # limitations under the License. # -from .normalizer import SoapNormalizer +from nomad.config.models.plugins import NormalizerEntryPoint + + +class SoapNormalizerEntryPoint(NormalizerEntryPoint): + def load(self): + import soapnormalizer + from .normalizer import SoapNormalizer + + soapnormalizer.SoapNormalizer = SoapNormalizer + + return SoapNormalizer(**self.dict()) + + +soap_normalizer_entry_point = SoapNormalizerEntryPoint( + name="SoapNormalizer", + description="Normalizer for the SOAP data.", +)