From 879bdac4cd96f15ce1b96a867bc5d434fd2d879d Mon Sep 17 00:00:00 2001 From: "Michael E. Rose" Date: Thu, 29 Aug 2024 21:55:19 +0200 Subject: [PATCH] Infer version via importlib --- pubmed_parser/__init__.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/pubmed_parser/__init__.py b/pubmed_parser/__init__.py index 8a91845..0bfe4fb 100644 --- a/pubmed_parser/__init__.py +++ b/pubmed_parser/__init__.py @@ -3,7 +3,15 @@ Author: Titipat Achakulvisut, Daniel E. Acuna """ -__version__ = "0.4.0" +import sys + +if sys.version_info >= (3, 8): + from importlib.metadata import version +else: + from importlib_metadata import version + +__version__ = version("pubmed_parser") + from .pubmed_oa_parser import ( list_xml_path, parse_pubmed_xml,