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: Don't try to parse Links as Paths #4532

Closed
Closed
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions poetry/installation/executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ def verbose(self, verbose: bool = True) -> "Executor":
return self

def pip_install(
self, req: Union[Path, str], upgrade: bool = False, editable: bool = False
self, req: Union[Path, Link], upgrade: bool = False, editable: bool = False
) -> int:
func = pip_install
if editable:
Expand Down Expand Up @@ -504,7 +504,7 @@ def _install(self, operation: Union[Install, Update]) -> int:
)
)
self._write(operation, message)
return self.pip_install(str(archive), upgrade=operation.job_type == "update")
return self.pip_install(archive, upgrade=operation.job_type == "update")

def _update(self, operation: Union[Install, Update]) -> int:
return self._install(operation)
Expand Down
6 changes: 4 additions & 2 deletions poetry/utils/pip.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,18 @@
from poetry.utils.env import Env
from poetry.utils.env import EnvCommandError
from poetry.utils.env import ephemeral_environment
from poetry.core.packages.utils.link import Link
from poetry.core.packages.utils.utils import url_to_path


def pip_install(
path: Union[Path, str],
path: Union[Path, Link],
environment: Env,
editable: bool = False,
deps: bool = False,
upgrade: bool = False,
) -> Union[int, str]:
path = Path(path) if isinstance(path, str) else path
path = url_to_path(path.url) if isinstance(path, Link) else path
is_wheel = path.suffix == ".whl"

# We disable version check here as we are already pinning to version available in either the
Expand Down