Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
python-pyforge
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Debian
python-pyforge
Commits
3b12a553
Commit
3b12a553
authored
5 months ago
by
Stuart Prescott
Browse files
Options
Downloads
Patches
Plain Diff
Cherry-pick patch for pkg-resources
Closes: #1083690
parent
61d915e7
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
debian/patches/pkg-resources.patch
+22
-0
22 additions, 0 deletions
debian/patches/pkg-resources.patch
debian/patches/series
+1
-0
1 addition, 0 deletions
debian/patches/series
with
23 additions
and
0 deletions
debian/patches/pkg-resources.patch
0 → 100644
+
22
−
0
View file @
3b12a553
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
This diff is collapsed.
Click to expand it.
debian/patches/series
+
1
−
0
View file @
3b12a553
pyver.patch
tox-pytest.patch
python3.13.patch
pkg-resources.patch
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment