-
-
Notifications
You must be signed in to change notification settings - Fork 940
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
Use importlib.metadata from the standard library on Python 3.8+ #1086
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1086 +/- ##
==========================================
+ Coverage 88.62% 88.62% +<.01%
==========================================
Files 64 64
Lines 6689 6692 +3
Branches 805 805
==========================================
+ Hits 5928 5931 +3
Misses 668 668
Partials 93 93
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #1086 +/- ##
==========================================
- Coverage 88.82% 88.62% -0.21%
==========================================
Files 65 64 -1
Lines 6785 6692 -93
Branches 815 805 -10
==========================================
- Hits 6027 5931 -96
- Misses 665 668 +3
Partials 93 93
Continue to review full report at Codecov.
|
import importlib_metadata | ||
|
||
try: | ||
from importlib import metadata as 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.
this import fails in python 3.7
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.
Correct.
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.
That's why it is in a try block.
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.
why not try import_metadata first?
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 prefer the standard library module if it is there, over the backport library.
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.
actually, kombu 4.6 ain't gonna get python 3.8 support. and 3.8 isn't stable yet.
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.
OK.
7913343
to
c750395
Compare
try: | ||
from importlib import metadata as importlib_metadata | ||
except ImportError: | ||
import 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.
This line is still going to cause an issue for eventlet and therefore open stack folks (because they use eventlet). Celery does support eventlet. Concurrent thread: #1082
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.
good catch Matt
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.
Actually though -- if we ensure eventlet users try the fix that @davidszotten mentioned "eventlet 0.25.1 has been released with a fix for the pathlib issue" maybe this code would be safer.
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.
can you rebase?
I can try tomorrow. |
Note that I've tried to run tox, but was getting some version conflicts in amqp, missing test deps and later this failure:
I don't think it is related, so I've decided not to investigate further.