-
Notifications
You must be signed in to change notification settings - Fork 46
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
Fix entry point discovery on Python < 3.10 #604
Conversation
Looks like a change in setuptools broke the unit tests (which is distinctly unsurprising). I'll follow up with a fix tomorrow. |
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.
These are all just questions, since I'm not really familiar with all of this:
- What does a 'distribution' mean in this context?
- What order are 'distribution's returned from
distribution()
? Alphabetical? Path-length? Something else?
In short: there is a 1-to-1 mapping of distributions and things that you can "pip install". Distributions can carry more than one top-level module, but you can think of distributions as a "python package" to some extent.
From what I can tell, the path discovery order is respected but I'm not sure the order within each path is consistent. If you have a distribution "A-1.0" on your system and it is shadowed by a distribution "A-1.1" by something on your Later versions of |
Unrelated fix for CI: #606 |
It seems that the behavior of the importlib.metadata.entry_points function changed in Python 3.10 to automatically de-duplicate distributions, but prior to that the "shadowed" distributions were also enumerated. This change specifically ignores "shadowed" distributions so that they aren't identified as extension point overwrites.
9057177
to
f8439ff
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #604 +/- ##
==========================================
- Coverage 83.32% 83.30% -0.02%
==========================================
Files 65 65
Lines 3760 3762 +2
Branches 725 727 +2
==========================================
+ Hits 3133 3134 +1
- Misses 551 552 +1
Partials 76 76 ☔ View full report in Codecov by Sentry. |
It seems that the behavior of the
importlib.metadata.entry_points
function changed in Python 3.10 to automatically de-duplicate distributions, but prior to that the "shadowed" distributions were also enumerated. This change specifically ignores "shadowed" distributions so that they aren't identified as extension point overwrites.Fixes #562
Closes #596
When released, will eventually close ros2/ci#737.