sgoel2be24-cyber commented on PR #74531:
URL: https://github.com/apache/airflow/pull/74531#issuecomment-6369131172
Thanks, that's a better place for it. I moved the fix into
`_get_grouped_entry_points()`: it now keeps only the first distribution per
normalized name, as `importlib.metadata.entry_points()` does, and the special
case in `plugins_manager` is gone. Plugin loading and provider discovery both
get it now. I used the PEP 503 normalization directly rather than
`canonicalize_name`, since `module_loading` doesn't depend on `packaging`.
- New test: the same distribution found at two paths in different versions,
with different entry-point values. Only the first one's entry point is returned.
- `test_entry_points_with_dist` asserted the old behavior ("Distributions
are not deduplicated"), so it now expects `dist2` once.
- Two different packages that declare the same plugin have different names,
so both are still returned and the duplicate still shows up as an import error.
- A distribution with no `Name` in its metadata isn't deduplicated. There's
a test for that too.
Rebased on `main`. `shared/module_loading` (37) and
`shared/providers_discovery` (14) tests pass, and the `prek` pre-commit and
manual stages pass. `test_entrypoint_plugin_errors_dont_raise_exceptions` in
`shared/plugins_manager` still fails when the whole file runs, same as on
`main`.
---
Drafted-by: Claude Code (Opus 5.5); reviewed by @sgoel2be24-cyber before
posting
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]