Skip to content

Commit 190d6b0

Browse files
authored
replace pkg_resources with importlib (#50)
1 parent 66e31a0 commit 190d6b0

File tree

1 file changed

+28
-28
lines changed

1 file changed

+28
-28
lines changed

src/actinia/__init__.py

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,40 @@
11
#!/usr/bin/env python
2-
# -*- coding: utf-8 -*-
3-
#######
4-
# actinia-python-client is a python client for actinia - an open source REST
5-
# API for scalable, distributed, high performance processing of geographical
6-
# data that uses GRASS GIS for computational tasks.
7-
#
8-
# Copyright (c) 2022 mundialis GmbH & Co. KG
9-
#
10-
# This program is free software: you can redistribute it and/or modify
11-
# it under the terms of the GNU General Public License as published by
12-
# the Free Software Foundation, either version 3 of the License, or
13-
# (at your option) any later version.
14-
#
15-
# This program is distributed in the hope that it will be useful,
16-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
17-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18-
# GNU General Public License for more details.
19-
#
20-
# You should have received a copy of the GNU General Public License
21-
# along with this program. If not, see <https://www.gnu.org/licenses/>.
22-
#
23-
#######
2+
3+
"""Initialize the actinia-python-client package.
4+
5+
actinia-python-client is a python client for actinia - an open source REST
6+
API for scalable, distributed, high performance processing of geographical
7+
data that uses GRASS GIS for computational tasks.
8+
9+
Copyright (c) 2022-2025 mundialis GmbH & Co. KG
10+
11+
This program is free software: you can redistribute it and/or modify
12+
it under the terms of the GNU General Public License as published by
13+
the Free Software Foundation, either version 3 of the License, or
14+
(at your option) any later version.
15+
16+
This program is distributed in the hope that it will be useful,
17+
but WITHOUT ANY WARRANTY; without even the implied warranty of
18+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19+
GNU General Public License for more details.
20+
21+
You should have received a copy of the GNU General Public License
22+
along with this program. If not, see <https://www.gnu.org/licenses/>.
23+
"""
2424

2525
__license__ = "GPLv3"
2626
__author__ = "Anika Weinmann"
27-
__copyright__ = "Copyright 2022, mundialis GmbH & Co. KG"
27+
__copyright__ = "Copyright 2022-2025, mundialis GmbH & Co. KG"
2828
__maintainer__ = "Anika Weinmann"
2929

30-
from pkg_resources import get_distribution, DistributionNotFound
30+
from importlib.metadata import PackageNotFoundError, version
31+
3132
from actinia.actinia import Actinia as Actinia
3233

3334
try:
3435
# Change here if project is renamed and does not equal the package name
35-
dist_name = __name__
36-
__version__ = get_distribution(dist_name).version
37-
except DistributionNotFound:
36+
__version__ = version(__name__).version
37+
except PackageNotFoundError:
3838
__version__ = "unknown"
3939
finally:
40-
del get_distribution, DistributionNotFound
40+
del version, PackageNotFoundError

0 commit comments

Comments
 (0)