Skip to content

Fix entry point discovery on Windows. #572

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

Merged
merged 4 commits into from
Dec 29, 2021
Merged
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
9 changes: 6 additions & 3 deletions python/pip_install/extract_wheels/lib/wheel.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,12 @@ def entry_points(self) -> Dict[str, str]:
# Calculate the location of the entry_points.txt file
metadata = self.metadata
name = "{}-{}".format(metadata.name.replace("-", "_"), metadata.version)
entry_points_path = os.path.join(
"{}.dist-info".format(name), "entry_points.txt"
)
# Note that the zipfile module always uses the forward slash as
# directory separator, even on Windows, so don't use os.path.join
# here. Reference for Python 3.10:
# https://github.com/python/cpython/blob/3.10/Lib/zipfile.py#L355.
# TODO: use zipfile.Path once 3.8 is our minimum supported version
entry_points_path = "{}.dist-info/entry_points.txt".format(name)

# If this file does not exist in the wheel, there are no entry points
if entry_points_path not in whl.namelist():
Expand Down