Skip to content
Snippets Groups Projects
Commit 3b12a553 authored by Stuart Prescott's avatar Stuart Prescott
Browse files

Cherry-pick patch for pkg-resources

Closes: #1083690
parent 61d915e7
No related branches found
No related tags found
No related merge requests found
commit b4dc78ef31ff55392b0447fa88d6450f08f0a841
Author: Ayala Shachar <shachar.ayala@gmail.com>
Date: Fri Sep 27 17:50:34 2024 +0300
Remove deprecated package: pkg_resources
diff --git a/forge/__version__.py b/forge/__version__.py
index 2b9fae5..8996654 100644
--- a/forge/__version__.py
+++ b/forge/__version__.py
@@ -1,3 +1,9 @@
-import pkg_resources
+import sys
+if sys.version_info < (3, 8):
+ import pkg_resources
+ get_distribution = pkg_resources.get_distribution
+else:
+ from importlib.metadata import distribution
+ get_distribution = distribution
-__version__ = pkg_resources.get_distribution('pyforge').version
+__version__ = get_distribution('pyforge').version
pyver.patch
tox-pytest.patch
python3.13.patch
pkg-resources.patch
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment