Skip to content
Snippets Groups Projects
Commit c3714bf4 authored by Yngve Levinsen's avatar Yngve Levinsen
Browse files

using newer solution to fetch package version

also fixed ess.__name__
see https://packaging.python.org/guides/single-sourcing-package-version/
parent fcd5872e
No related branches found
No related tags found
No related merge requests found
...@@ -3,7 +3,12 @@ from . import installed ...@@ -3,7 +3,12 @@ from . import installed
from . import lib_tw from . import lib_tw
from . import fieldmap from . import fieldmap
from .nextcloud import nextcloud from .nextcloud import nextcloud
from pkg_resources import get_distribution, DistributionNotFound
try:
from importlib import metadata
except ImportError:
# Running on pre-3.8 Python; use importlib-metadata package
import importlib_metadata as metadata # type: ignore
__all__ = [ __all__ = [
"fieldmap", "fieldmap",
...@@ -15,10 +20,10 @@ __all__ = [ ...@@ -15,10 +20,10 @@ __all__ = [
"nextcloud", "nextcloud",
] ]
__name__ = "ess" __name__ = "ess-python-tools"
try: try:
__version__ = get_distribution(__name__).version __version__ = metadata.version(__name__)
except DistributionNotFound: except metadata.PackageNotFoundError:
# package is not installed # package is not installed
pass pass
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