From cd88d53523d1594c8231fd59e18c9587cd905a5d Mon Sep 17 00:00:00 2001 From: Igor Dejanovic Date: Fri, 9 Feb 2024 18:45:16 +0100 Subject: [PATCH] fix: get version from importlib --- parglare/__init__.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/parglare/__init__.py b/parglare/__init__.py index dc3d22b..b23a6ab 100644 --- a/parglare/__init__.py +++ b/parglare/__init__.py @@ -10,4 +10,9 @@ from parglare.exceptions import ParserInitError, ParseError, GrammarError, \ DisambiguationError, LoopError -from .version import __version__ +try: + from importlib.metadata import version +except ModuleNotFoundError: + from importlib_metadata import version + +__version__ = version("parglare")