Skip to content

Commit

Permalink
Merge pull request #2304 from pypa/tweak-resolver
Browse files Browse the repository at this point in the history
Resolver Tweaks
  • Loading branch information
techalchemy authored Jun 7, 2018
2 parents 2b37861 + 92286b5 commit a9461cc
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
2 changes: 1 addition & 1 deletion pipenv/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -1484,7 +1484,7 @@ def pip_install(
pre = '--pre' if pre else ''
quoted_pip = which_pip(allow_global=allow_global)
quoted_pip = escape_grouped_arguments(quoted_pip)
upgrade_strategy = '--upgrade --upgrade-strategy=to-satisfy-only' if selective_upgrade else ''
upgrade_strategy = '--upgrade --upgrade-strategy=only-if-needed' if selective_upgrade else ''
pip_command = '{0} install {4} {5} {6} {7} {3} {1} {2} --exists-action w'.format(
quoted_pip,
install_reqs,
Expand Down
18 changes: 12 additions & 6 deletions pipenv/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ class PipCommand(basecommand.Command):
pip_options, _ = pip_command.parse_args(pip_args)
session = pip_command._build_session(pip_options)
pypi = PyPIRepository(
pip_options=pip_options, use_json=True, session=session
pip_options=pip_options, use_json=False, session=session
)
if verbose:
logging.log.verbose = True
Expand Down Expand Up @@ -1131,7 +1131,8 @@ def install_or_update_vcs(vcs_obj, src_dir, name, rev=None):
target_rev = vcs_obj.make_rev_options(rev)
if not os.path.exists(target_dir):
vcs_obj.obtain(target_dir)
vcs_obj.update(target_dir, target_rev)
if not vcs_obj.is_commit_id_equal(target_dir, rev) and not vcs_obj.is_commit_id_equal(target_dir, target_rev):
vcs_obj.update(target_dir, target_rev)
return vcs_obj.get_revision(target_dir)


Expand All @@ -1146,6 +1147,7 @@ def get_vcs_deps(
dev=False,
):
from .patched.notpip._internal.vcs import VcsSupport
from ._compat import TemporaryDirectory

section = "vcs_dev_packages" if dev else "vcs_packages"
lines = []
Expand All @@ -1154,10 +1156,14 @@ def get_vcs_deps(
packages = getattr(project, section)
except AttributeError:
return [], []
src_dir = Path(
os.environ.get("PIP_SRC", os.path.join(project.virtualenv_location, "src"))
)
src_dir.mkdir(mode=0o775, exist_ok=True)
if not os.environ.get("PIP_SRC") and not project.virtualenv_location:
_src_dir = TemporaryDirectory(prefix='pipenv-', suffix='-src')
src_dir = Path(_src_dir.name)
else:
src_dir = Path(
os.environ.get("PIP_SRC", os.path.join(project.virtualenv_location, "src"))
)
src_dir.mkdir(mode=0o775, exist_ok=True)
vcs_registry = VcsSupport
vcs_uri_map = {
extract_uri_from_vcs_dep(v): {"name": k, "ref": v.get("ref")}
Expand Down

0 comments on commit a9461cc

Please sign in to comment.