From 94db69a0cb812fa41f082713356f44df9cc14933 Mon Sep 17 00:00:00 2001 From: Dan Ryan Date: Mon, 12 Mar 2018 23:16:35 -0400 Subject: [PATCH] Use --extra-index-url for resolution - Fixes #1539 - Currently writes the wrong index name to the lockfile - Currently fails one round before succeeding --- pipenv/patched/notpip/index.py | 7 +++++-- pipenv/utils.py | 10 ++++++++-- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/pipenv/patched/notpip/index.py b/pipenv/patched/notpip/index.py index 1315042844..fdf2cd5299 100644 --- a/pipenv/patched/notpip/index.py +++ b/pipenv/patched/notpip/index.py @@ -34,7 +34,7 @@ from pip9._vendor.packaging.version import parse as parse_version from pip9._vendor.packaging.utils import canonicalize_name from notpip._vendor.packaging import specifiers -from pip9._vendor.requests.exceptions import SSLError +from pip9._vendor.requests.exceptions import SSLError, HTTPError from pip9._vendor.distlib.compat import unescape @@ -602,7 +602,10 @@ def _get_pages(self, locations, project_name): continue seen.add(location) - page = self._get_page(location) + try: + page = self._get_page(location) + except HTTPError as e: + page = None if page is None: continue diff --git a/pipenv/utils.py b/pipenv/utils.py index 3e6c292606..322b327b8e 100644 --- a/pipenv/utils.py +++ b/pipenv/utils.py @@ -619,9 +619,15 @@ def convert_deps_to_pip(deps, project=None, r=True, include_index=False): specs = '' if include_index: + pip_src_args = [] if 'index' in deps[dep]: - pip_args = prepare_pip_source_args([project.get_source(deps[dep]['index'])]) - index = ' '.join(pip_args) + dep_src = [project.get_source(deps[dep]['index'])] + extra_indexes = [src for src in project.sources if src != dep_src] + pip_src_args = dep_src + extra_indexes + else: + pip_src_args = project.sources + pip_args = prepare_pip_source_args(pip_src_args) + index = ' '.join(pip_args) # Support for version control maybe_vcs = [vcs for vcs in VCS_LIST if vcs in deps[dep]]