Fix python 2.7 installations

Signed-off-by: Dan Ryan <dan@danryan.co>
This commit is contained in:
Dan Ryan
2018-11-11 19:03:55 -05:00
parent 650cc32fe6
commit 382be38bba
3 changed files with 14 additions and 10 deletions
+12 -8
View File
@@ -1847,7 +1847,7 @@ def do_install(
# Install all dependencies, if none was provided.
# This basically ensures that we have a pipfile and lockfile, then it locks and
# installs from the lockfile
if packages is False and editable_packages is False:
if not packages and not editable_packages:
# Update project settings with pre preference.
if pre:
project.update_settings({"allow_prereleases": pre})
@@ -1872,13 +1872,17 @@ def do_install(
# make a tuple of (display_name, entry)
pkg_list = packages + ["-e {0}".format(pkg) for pkg in editable_packages]
if not system and not project.virtualenv_exists:
with create_spinner("Creating virtualenv...") as sp:
try:
do_create_virtualenv(pypi_mirror=pypi_mirror)
except KeyboardInterrupt:
cleanup_virtualenv(bare=(not environments.is_verbose()))
sys.exit(1)
sp.write_err("Ok...")
do_init(
dev=dev,
system=system,
allow_global=system,
concurrent=concurrent,
keep_outdated=keep_outdated,
requirements_dir=requirements_directory,
deploy=deploy,
pypi_mirror=pypi_mirror,
skip_lock=skip_lock,
)
for pkg_line in pkg_list:
click.echo(
crayons.normal(
+1 -1
View File
@@ -25,7 +25,7 @@ class Environment(object):
super(Environment, self).__init__()
self._modules = {'pkg_resources': pkg_resources, 'pipenv': pipenv}
self.base_working_set = base_working_set if base_working_set else BASE_WORKING_SET
self.is_venv = not os.samefile(os.path.abspath(prefix), sys.prefix)
self.is_venv = not os.path.samefile(os.path.abspath(prefix), sys.prefix)
if not sources:
sources = []
self.sources = sources
+1 -1
View File
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import absolute_import, print_function
import errno
import os
import six