From 64627f3999759332dc22a6fb8eb7f3eef53c2395 Mon Sep 17 00:00:00 2001 From: Mirochill <200482516+Mirochill@users.noreply.github.com> Date: Sun, 24 May 2026 13:35:51 +0200 Subject: [PATCH] Avoid pkg_resources for package version --- hsclient/hydroshare.py | 4 ++-- setup.py | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/hsclient/hydroshare.py b/hsclient/hydroshare.py index 59ef710..8b6c787 100644 --- a/hsclient/hydroshare.py +++ b/hsclient/hydroshare.py @@ -11,6 +11,7 @@ from contextlib import closing from datetime import datetime from functools import wraps +from importlib.metadata import version from posixpath import basename, dirname, join as urljoin, splitext from pprint import pformat from typing import Callable, Dict, List, TYPE_CHECKING, Union @@ -53,8 +54,7 @@ from hsclient.oauth2_model import Token from hsclient.utils import attribute_filter, encode_resource_url, is_aggregation, main_file_type -import pkg_resources # part of setuptools -VERSION = pkg_resources.get_distribution(__package__).version +VERSION = version(__package__) CHECK_TASK_PING_INTERVAL = 10 diff --git a/setup.py b/setup.py index a3868da..ddf40df 100644 --- a/setup.py +++ b/setup.py @@ -15,7 +15,6 @@ 'hsmodels>=1.0.4', 'requests', 'requests_oauthlib', - 'setuptools', ], extras_require={ "pandas": ["pandas"],