Skip to content

Commit

Permalink
receptorctl: Remove setuptools runtime dep
Browse files Browse the repository at this point in the history
Due to the pkg_resources import then setuptools is a runtime
dependency.
The pkg_resources module is deprecated and we should use importlib.metadata
instead which is a python builtin (since 3.8)

https://setuptools.pypa.io/en/latest/pkg_resources.html
https://docs.python.org/3.9/library/importlib.metadata.html

Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
  • Loading branch information
dsavineau authored and AaronH88 committed Dec 13, 2023
1 parent f91b94c commit ceb1012
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions receptorctl/receptorctl/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import json
from functools import partial
import dateutil.parser
import pkg_resources
import importlib.metadata
from .socket_interface import ReceptorControl


Expand Down Expand Up @@ -87,7 +87,7 @@ def print_error(message, nl=True):
def cli(ctx, socket, config, tlsclient, rootcas, key, cert, insecureskipverify):
ctx.obj = {
"rc": None,
"receptorctlVersion": pkg_resources.get_distribution("receptorctl").version,
"receptorctlVersion": importlib.metadata.version("receptorctl"),
"receptorVersion": "Unknown",
}
# If we got a socket parameter we can make a ReceptorControl object
Expand Down

0 comments on commit ceb1012

Please sign in to comment.