Commit 13dfae49 by Sébastien Eustace

Fix package installation for custom repositories

parent ea353ae8
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
- Fixed handling of root incompatibilities. - Fixed handling of root incompatibilities.
- Fixed an error where packages from custom repositories would not be found. - Fixed an error where packages from custom repositories would not be found.
- Fixed wildcard Python requirement being wrongly set in distributions metadata. - Fixed wildcard Python requirement being wrongly set in distributions metadata.
- Fixed installation of packages from a custom repository.
## [0.10.3] - 2018-06-04 ## [0.10.3] - 2018-06-04
......
...@@ -3,6 +3,11 @@ import tempfile ...@@ -3,6 +3,11 @@ import tempfile
from subprocess import CalledProcessError from subprocess import CalledProcessError
try:
import urllib.parse as urlparse
except ImportError:
import urlparse
from poetry.utils._compat import encode from poetry.utils._compat import encode
from poetry.utils.venv import Venv from poetry.utils.venv import Venv
...@@ -18,6 +23,15 @@ class PipInstaller(BaseInstaller): ...@@ -18,6 +23,15 @@ class PipInstaller(BaseInstaller):
args = ["install", "--no-deps"] args = ["install", "--no-deps"]
if package.source_type == "legacy" and package.source_url: if package.source_type == "legacy" and package.source_url:
parsed = urlparse.urlparse(package.source_url)
if parsed.scheme == "http":
self._io.write_error(
" <warning>Installing from unsecure host: {}</warning>".format(
parsed.netloc
)
)
args += ["--trusted-host", parsed.netloc]
args += ["--index-url", package.source_url] args += ["--index-url", package.source_url]
if update: if update:
......
...@@ -318,6 +318,9 @@ class Package(object): ...@@ -318,6 +318,9 @@ class Package(object):
clone.python_versions = self.python_versions clone.python_versions = self.python_versions
clone.platform = self.platform clone.platform = self.platform
clone.extras = self.extras clone.extras = self.extras
clone.source_type = self.source_type
clone.source_url = self.source_url
clone.source_reference = self.source_reference
for dep in self.requires: for dep in self.requires:
clone.requires.append(dep) clone.requires.append(dep)
......
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