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

fix: installing wheel from trailing slash url #4619

Closed
Closed
Changes from 1 commit
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
22 changes: 14 additions & 8 deletions poetry/repositories/pypi_repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -432,14 +432,17 @@ def _get_info_from_urls(self, urls: Dict[str, List[str]]) -> "PackageInfo":
def _get_info_from_wheel(self, url: str) -> "PackageInfo":
from poetry.inspection.info import PackageInfo

pathsplits = urllib.parse.urlparse(url).path.rsplit("/")
neersighted marked this conversation as resolved.
Show resolved Hide resolved
wheelpath = pathsplits[-1]
if not wheelpath:
wheelpath = pathsplits[-2]

self._log(
"Downloading wheel: {}".format(
urllib.parse.urlparse(url).path.rsplit("/")[-1]
),
"Downloading wheel: {}".format(wheelpath),
level="debug",
)

filename = os.path.basename(urllib.parse.urlparse(url).path.rsplit("/")[-1])
filename = os.path.basename(wheelpath)
neersighted marked this conversation as resolved.
Show resolved Hide resolved

with temporary_directory() as temp_dir:
filepath = Path(temp_dir) / filename
neersighted marked this conversation as resolved.
Show resolved Hide resolved
Expand All @@ -450,14 +453,17 @@ def _get_info_from_wheel(self, url: str) -> "PackageInfo":
def _get_info_from_sdist(self, url: str) -> "PackageInfo":
from poetry.inspection.info import PackageInfo

pathsplits = urllib.parse.urlparse(url).path.rsplit("/")
wheelpath = pathsplits[-1]
if not wheelpath:
wheelpath = pathsplits[-2]

self._log(
"Downloading sdist: {}".format(
urllib.parse.urlparse(url).path.rsplit("/")[-1]
),
"Downloading sdist: {}".format(wheelpath),
level="debug",
)

filename = os.path.basename(urllib.parse.urlparse(url).path)
filename = os.path.basename(wheelpath)

with temporary_directory() as temp_dir:
filepath = Path(temp_dir) / filename
Expand Down