-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Description
Hello,
cli.py uses pkg_resources, however pkg_resources is deprecated as an API. The pkg_resources package is slated for removal as early as 2025-11-30.
A way to fix it is to use importlib.metadata instead. For instance, this patch should work:
--- a/colorpedia/cli.py 2025-06-07 15:55:27.409601030 +0200
+++ b/colorpedia/cli.py 2025-06-07 15:58:14.350500858 +0200
@@ -5,7 +5,7 @@
from typing import Any, Callable, Dict, Iterable, Optional
from fire import Fire
-from pkg_resources import get_distribution
+from importlib_metadata import version
from colorpedia.color import Color
from colorpedia.config import (
@@ -78,7 +78,7 @@
:param json: Display in JSON format.
"""
json = validate_boolean_flag(json)
- version = get_distribution("colorpedia").version
+ version = version("colorpedia")
print({"version": version} if json else version)
Metadata
Metadata
Assignees
Labels
No labels