Commit cdd6e2bd by Arun Babu Neelicattu Committed by Bjorn Neergaard

pip installer: fix typing issues for http repos

parent 73a6dbe0
...@@ -12,6 +12,7 @@ from typing import Any ...@@ -12,6 +12,7 @@ from typing import Any
from poetry.core.pyproject.toml import PyProjectTOML from poetry.core.pyproject.toml import PyProjectTOML
from poetry.installation.base_installer import BaseInstaller from poetry.installation.base_installer import BaseInstaller
from poetry.repositories.http import HTTPRepository
from poetry.utils._compat import encode from poetry.utils._compat import encode
from poetry.utils.helpers import remove_directory from poetry.utils.helpers import remove_directory
from poetry.utils.pip import pip_install from poetry.utils.pip import pip_install
...@@ -57,23 +58,28 @@ class PipInstaller(BaseInstaller): ...@@ -57,23 +58,28 @@ class PipInstaller(BaseInstaller):
) )
args += ["--trusted-host", parsed.hostname] args += ["--trusted-host", parsed.hostname]
if repository.cert: if isinstance(repository, HTTPRepository):
args += ["--cert", str(repository.cert)] if repository.cert:
args += ["--cert", str(repository.cert)]
if repository.client_cert: if repository.client_cert:
args += ["--client-cert", str(repository.client_cert)] args += ["--client-cert", str(repository.client_cert)]
index_url = repository.authenticated_url index_url = repository.authenticated_url
args += ["--index-url", index_url]
args += ["--index-url", index_url]
if ( if (
self._pool.has_default() self._pool.has_default()
and repository.name != self._pool.repositories[0].name and repository.name != self._pool.repositories[0].name
): ):
args += [ first_repository = self._pool.repositories[0]
"--extra-index-url",
self._pool.repositories[0].authenticated_url, if isinstance(first_repository, HTTPRepository):
] args += [
"--extra-index-url",
first_repository.authenticated_url,
]
if update: if update:
args.append("-U") args.append("-U")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment