Skip to content
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

Add exception for old versions of importlib_metadata #4572

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions setuptools/_importlib.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,10 @@
import importlib_resources as resources # pragma: no cover
else:
import importlib.resources as resources # noqa: F401


if not hasattr(metadata, "EntryPoints"): # pragma: no cover
raise ImportError(
"`importlib-metadata` version is incompatible with `setuptools`. "
"Please install importlib-metadata>=4.6" # Equivalent to stdlib's in 3.10
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The choice of importlib-metadata>=4.6 is based on the fact that the if statement above accepts stdlib's version for Python 3.10 and according to importlib_metadata's docs that is equivalent to version 4.6.

So if the codebase works with importlib.metadata in Python 3.10 it should also work with importlib_metadata 4.6. I am not sure why pyproject.toml requires importlib_metadata>=6...

Copy link
Contributor

@Avasam Avasam Nov 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it was just pinned to whatever the vendored versions were when they got added as dependencies in pyproject.toml.

Here's when you bumped importlib_metadata from 4.11.1 to 6.0.0: #3832

The bump from 4.10.1 to 4.11.1 was made here: #3109 for #3107

4.10.1 was the initial pin of this vendored dependency

)
Loading