Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolver Tweaks #2304

Merged
merged 4 commits into from
Jun 7, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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