diff --git a/eido/conversion.py b/eido/conversion.py index 6ce579b..58cc85a 100644 --- a/eido/conversion.py +++ b/eido/conversion.py @@ -1,12 +1,15 @@ -import inspect import sys -import os -from logging import getLogger -from pkg_resources import iter_entry_points +if sys.version_info < (3, 10): + from importlib_metadata import entry_points +else: + from importlib.metadata import entry_points +import inspect +from logging import getLogger +import os +from typing import NoReturn from .exceptions import * -from typing import NoReturn _LOGGER = getLogger(__name__) @@ -21,7 +24,7 @@ def pep_conversion_plugins(): :raise EidoFilterError: if any of the filters has an invalid signature. """ plugins = {} - for ep in iter_entry_points("pep.filters"): + for ep in entry_points(group="pep.filters"): plugin_fun = ep.load() if len(list(inspect.signature(plugin_fun).parameters)) != 2: raise EidoFilterError( diff --git a/eido/conversion_plugins.py b/eido/conversion_plugins.py index 309db5b..01dd550 100644 --- a/eido/conversion_plugins.py +++ b/eido/conversion_plugins.py @@ -1,4 +1,5 @@ """ built-in PEP filters """ + from typing import Dict from .output_formatters import MultilineOutputFormatter @@ -73,10 +74,12 @@ def processed_pep_filter(p, **kwargs) -> Dict[str, str]: return { "project": str(prj_repr), - "samples": str(p.samples) - if samples_as_objects - else str(p.sample_table.to_csv()), - "subsamples": str(p.subsamples) - if subsamples_as_objects - else str(p.subsample_table.to_csv()), + "samples": ( + str(p.samples) if samples_as_objects else str(p.sample_table.to_csv()) + ), + "subsamples": ( + str(p.subsamples) + if subsamples_as_objects + else str(p.subsample_table.to_csv()) + ), } diff --git a/requirements/requirements-all.txt b/requirements/requirements-all.txt index 5517bdc..52d4286 100644 --- a/requirements/requirements-all.txt +++ b/requirements/requirements-all.txt @@ -1,3 +1,4 @@ +importlib-metadata; python_version < '3.10' jsonschema>=3.0.1 logmuse>=0.2.5 pandas