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,6 +58,7 @@ class PipInstaller(BaseInstaller): ...@@ -57,6 +58,7 @@ class PipInstaller(BaseInstaller):
) )
args += ["--trusted-host", parsed.hostname] args += ["--trusted-host", parsed.hostname]
if isinstance(repository, HTTPRepository):
if repository.cert: if repository.cert:
args += ["--cert", str(repository.cert)] args += ["--cert", str(repository.cert)]
...@@ -66,13 +68,17 @@ class PipInstaller(BaseInstaller): ...@@ -66,13 +68,17 @@ class PipInstaller(BaseInstaller):
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
): ):
first_repository = self._pool.repositories[0]
if isinstance(first_repository, HTTPRepository):
args += [ args += [
"--extra-index-url", "--extra-index-url",
self._pool.repositories[0].authenticated_url, first_repository.authenticated_url,
] ]
if update: if update:
......
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