diff --git a/setup.cfg b/setup.cfg index 41f5a3b..1030bff 100644 --- a/setup.cfg +++ b/setup.cfg @@ -14,6 +14,7 @@ packages = find: python_requires = >=3.7 install_requires = parsimonious==0.9.0 + importlib-metadata>=6.0.0 ; python_version < "3.8" [options.packages.find] where = src @@ -63,4 +64,4 @@ extension-pkg-whitelist = [pydocstyle] convention = numpy -add_ignore = D2,D105,D101,D100,D104,D106 \ No newline at end of file +add_ignore = D2,D105,D101,D100,D104,D106 diff --git a/src/daidepp/__init__.py b/src/daidepp/__init__.py index 611756e..88a3337 100644 --- a/src/daidepp/__init__.py +++ b/src/daidepp/__init__.py @@ -1,7 +1,11 @@ -from importlib.metadata import version from daidepp.daide_visitor import daide_visitor from daidepp.grammar import create_daide_grammar from daidepp.keywords import * +try: + from importlib.metadata import version +except ImportError: + from importlib_metadata import version + __version__ = version("daidepp")