From a819b181bb0010146ceb4b67028c495971f78cc5 Mon Sep 17 00:00:00 2001 From: mmwinther Date: Wed, 10 Jan 2024 09:37:43 +0100 Subject: [PATCH] Don't use deprecated pkg_resources --- datadoc/utils.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/datadoc/utils.py b/datadoc/utils.py index f56c8964..2ae56a56 100644 --- a/datadoc/utils.py +++ b/datadoc/utils.py @@ -1,6 +1,7 @@ """General utilities.""" import datetime +import importlib from datadoc_model import model from pydantic import AnyUrl @@ -61,6 +62,4 @@ def get_timestamp_now() -> datetime: def get_app_version() -> str: """Get the version of the Datadoc package.""" - import pkg_resources - - return pkg_resources.get_distribution("ssb-datadoc").version + return importlib.metadata.distribution("ssb-datadoc").version