diff --git a/src/flatten_dict/__init__.py b/src/flatten_dict/__init__.py index 55311b7..4484e50 100644 --- a/src/flatten_dict/__init__.py +++ b/src/flatten_dict/__init__.py @@ -1,7 +1,14 @@ -import pkg_resources - from .flatten_dict import flatten, unflatten # noqa: F401 -__all__ = ["flatten_dict", "reducer", "splitter"] -__version__ = pkg_resources.get_distribution("flatten-dict").version +__all__ = ["flatten", "unflatten", "splitter"] + +try: + from importlib.metadata import distribution +except ImportError: + try: + from importlib_metadata import distribution + except ImportError: + from pkg_resources import get_distribution as distribution + +__version__ = distribution("flatten-dict").version