Skip to content
Snippets Groups Projects
Verified Commit 853c0dbb authored by Tamas Gal's avatar Tamas Gal :speech_balloon:
Browse files

Use importlib instead of pkg_resources

parent 62eb3626
No related branches found
No related tags found
No related merge requests found
Pipeline #44508 failed
......@@ -20,8 +20,13 @@ import sphinx_rtd_theme
from pkg_resources import get_distribution
# -- Project information -----------------------------------------------------
try:
from importlib.metadata import version as get_version
version = get_version(__name__)
except ImportError:
from pkg_resources import get_distribution
version = get_distribution(__name__).version
version = get_distribution("km3io").version
short_version = ".".join(version.split(".")[:2])
project = "km3io {}".format(short_version)
copyright = "{0}, Zineb Aly and Tamas Gal".format(date.today().year)
......
from pkg_resources import get_distribution, DistributionNotFound
try:
from importlib.metadata import version as get_version
version = get_version(__name__)
except ImportError:
from pkg_resources import get_distribution
version = get_distribution(__name__).version
version = get_distribution(__name__).version
import warnings
import os
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment