From 8fca38293ef825b23b59f02de7fed59e05cb38d6 Mon Sep 17 00:00:00 2001 From: ninsbl Date: Thu, 2 Jan 2025 14:39:40 +0100 Subject: [PATCH] replace pkg_resources with importlib --- src/actinia/__init__.py | 56 ++++++++++++++++++++--------------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/src/actinia/__init__.py b/src/actinia/__init__.py index 109acb3..2ae423f 100644 --- a/src/actinia/__init__.py +++ b/src/actinia/__init__.py @@ -1,40 +1,40 @@ #!/usr/bin/env python -# -*- coding: utf-8 -*- -####### -# actinia-python-client is a python client for actinia - an open source REST -# API for scalable, distributed, high performance processing of geographical -# data that uses GRASS GIS for computational tasks. -# -# Copyright (c) 2022 mundialis GmbH & Co. KG -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . -# -####### + +"""Initialize the actinia-python-client package. + +actinia-python-client is a python client for actinia - an open source REST +API for scalable, distributed, high performance processing of geographical +data that uses GRASS GIS for computational tasks. + +Copyright (c) 2022-2025 mundialis GmbH & Co. KG + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +""" __license__ = "GPLv3" __author__ = "Anika Weinmann" -__copyright__ = "Copyright 2022, mundialis GmbH & Co. KG" +__copyright__ = "Copyright 2022-2025, mundialis GmbH & Co. KG" __maintainer__ = "Anika Weinmann" -from pkg_resources import get_distribution, DistributionNotFound +from importlib.metadata import PackageNotFoundError, version + from actinia.actinia import Actinia as Actinia try: # Change here if project is renamed and does not equal the package name - dist_name = __name__ - __version__ = get_distribution(dist_name).version -except DistributionNotFound: + __version__ = version(__name__).version +except PackageNotFoundError: __version__ = "unknown" finally: - del get_distribution, DistributionNotFound + del version, PackageNotFoundError