-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PR: Remove dependency on pkg_resources
and use importlib-metadata
instead
#22244
Conversation
ec91cfa
to
449e847
Compare
i feel like i broke something quite serious and can't get it to work now. |
449e847
to
0d07f43
Compare
I had a typo so it now runs locally again, but i'm not sure why the CIs are failing so hard. |
3d2647d
to
c18257b
Compare
not sure why this is happening
|
55bf59d
to
35188e5
Compare
pkg_resources
Do you need a hand with that to finish and merge this PR? |
I'm at a loss with the OSX package, a hand would be very helpful. |
35188e5
to
b7868e2
Compare
I rebased on to 5.x into a single commit. Honestly, I have enough open source street cred, so I'm happy seeing this move forward even if you squash my commits onto yours. |
pkg_resources
pkg_resources
and use importlib-metadata
instead
b7868e2
to
bfa0172
Compare
It is deprecated and the note says to move away when Python 3.7 is dropped. Seems like now ;)
bfa0172
to
84af373
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @hmaarrfk!
What did you change???? |
I just fixed the |
hmm thanks! sorry i missed that one! |
No prob 👍🏽 I still have to release a new version of |
@@ -15,7 +15,7 @@ | |||
from pathlib import Path | |||
from subprocess import check_output | |||
|
|||
from importlib_metadata import PackageNotFoundError, distribution | |||
from importlib.metadata import PackageNotFoundError, distribution |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ccordoba12, do we need a Python version conditional here?
if sys.version_info < (3, 10):
from importlib_metadata import PackageNotFoundError, distribution
else:
from importlib.metadata import PackageNotFoundError, distribution
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand very well the difference between importlib_metadata
and importlib.metadata
, but both PackageNotFoundError
and distribution
are available in importlib.metadata
in Python 3.8 and 3.9.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
importlib_metadata
is a backport of importlib.metadata
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To include new features not available in Python 3.8/3.9 importlib.metadata
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes exactly.
But python has been breaking this interface left right and center and not really introducing any meaningful deprecation cycle.
This line of code https://github.com/cupy/cupy/blob/main/cupy/_environment.py#L490
broke my code with importlib_metadata, but i can't recreate in an isolated environment....
It is deprecated and the note says to move away when Python 3.7 is dropped.
Seems like now ;)
Description of Changes
Python 3.8
Maintenance
Issue(s) Resolved
Fixes #21545
Affirmation
By submitting this Pull Request or typing my (user)name below,
I affirm the Developer Certificate of Origin
with respect to all commits and content included in this PR,
and understand I am releasing the same under Spyder's MIT (Expat) license.
I certify the above statement is true and correct:
Mark Harfouche hmaarrfk