From 4777c3bb267a3a325b7cc999adbb06f948cde4f6 Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Thu, 7 Sep 2017 14:28:34 -0400 Subject: [PATCH 01/16] comment Signed-off-by: Kenneth Reitz --- pipenv/cli.py | 1 + 1 file changed, 1 insertion(+) diff --git a/pipenv/cli.py b/pipenv/cli.py index 772d1082..28299089 100644 --- a/pipenv/cli.py +++ b/pipenv/cli.py @@ -259,6 +259,7 @@ def do_install_dependencies(dev=False, only=False, bare=False, requirements=Fals with open(project.lockfile_location) as f: lockfile = split_vcs(json.load(f)) + # Allow pip to resolve dependencies when in skip-lock mode. no_deps = (not skip_lock) # Install default dependencies, always. From f8f7dfa131f43f8ac81275a6efa73fb4d43b8ec5 Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Thu, 7 Sep 2017 15:09:38 -0400 Subject: [PATCH 02/16] auto-updating! Signed-off-by: Kenneth Reitz --- pipenv/cli.py | 35 +++++++++++++++++++++++++++++++---- 1 file changed, 31 insertions(+), 4 deletions(-) diff --git a/pipenv/cli.py b/pipenv/cli.py index 28299089..8ca713d9 100644 --- a/pipenv/cli.py +++ b/pipenv/cli.py @@ -73,13 +73,35 @@ def check_for_updates(): current = semver.parse_version_info(__version__) if latest > current: - click.echo('{0}: {1} is now available. You get bonus points for upgrading!'.format( + click.echo('{0}: {1} is now available. You get bonus points for upgrading ($ {})!'.format( crayons.green('Courtesy Notice'), - crayons.yellow('Pipenv v{v.major}.{v.minor}.{v.patch}'.format(v=latest)), + crayons.yellow('Pipenv {v.major}.{v.minor}.{v.patch}'.format(v=latest)), + crayons.red('pipenv update [--user]') ), err=True) except Exception: pass +def enhance(user=False): + r = requests.get('https://pypi.python.org/pypi/pipenv/json', timeout=0.5) + latest = sorted([semver.parse_version_info(v) for v in list(r.json()['releases'].keys())])[-1] + current = semver.parse_version_info(__version__) + + click.echo('{0}: {1} is now available. Automatically upgrading!'.format( + crayons.green('Courtesy Notice'), + crayons.yellow('Pipenv {v.major}.{v.minor}.{v.patch}'.format(v=latest)), + ), err=True) + + if not user: + sys.argv = ['pip', 'install', '--upgrade', 'pipenv'] + else: + sys.argv = ['pip', 'install', '--user', '--upgrade', 'pipenv'] + + sys.modules['pip'].main() + + click.echo('{0} to {1}!'.format( + crayons.green('Pipenv updated'), + crayons.yellow('{v.major}.{v.minor}.{v.patch}'.format(v=latest)) + )) def cleanup_virtualenv(bare=True): """Removes the virtualenv directory from the system.""" @@ -1183,18 +1205,20 @@ def check(three=None, python=False): @click.command(help="Updates pip to latest version, uninstalls all packages, and re-installs package(s) in [packages] to latest compatible versions.") +@click.option('--dont-upgrade-self', '-d', is_flag=True, default=False, help="Upgrade Pipenv to latest version.") +@click.option('--user', '-U', is_flag=True, default=False, help="When upgrading Pipenv, use pip --user") @click.option('--dev', '-d', is_flag=True, default=False, help="Additionally install package(s) in [dev-packages].") @click.option('--three/--two', is_flag=True, default=None, help="Use Python 3/2 when creating virtualenv.") @click.option('--python', default=False, nargs=1, help="Specify which version of Python virtualenv should use.") @click.option('--dry-run', is_flag=True, default=False, help="Just output outdated packages.") @click.option('--bare', is_flag=True, default=False, help="Minimal output.") -def update(dev=False, three=None, python=None, dry_run=False, bare=False): +def update(dev=False, three=None, python=None, dry_run=False, bare=False, dont_upgrade_self=False, user=False): # Ensure that virtualenv is available. ensure_project(three=three, python=python, validate=False) - # --dry-run if dry_run: + dont_upgrade_self = True updates = False # Dev packages @@ -1237,6 +1261,9 @@ def update(dev=False, three=None, python=None, dry_run=False, bare=False): # Update pip to latest version. ensure_latest_pip() + if not dont_upgrade_self: + enhance(user=user) + click.echo(crayons.yellow('Updating all dependencies from Pipfile...')) do_purge() From 82399931aff60793f917b93afdfda9ae8ec79c48 Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Thu, 7 Sep 2017 15:11:23 -0400 Subject: [PATCH 03/16] further notes Signed-off-by: Kenneth Reitz --- pipenv/cli.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pipenv/cli.py b/pipenv/cli.py index 8ca713d9..d465b442 100644 --- a/pipenv/cli.py +++ b/pipenv/cli.py @@ -1204,7 +1204,7 @@ def check(three=None, python=False): click.echo(crayons.green('Passed!')) -@click.command(help="Updates pip to latest version, uninstalls all packages, and re-installs package(s) in [packages] to latest compatible versions.") +@click.command(help="Updates Pipenv & pip to latest, uninstalls all packages, and re-installs package(s) in [packages] to latest compatible versions.") @click.option('--dont-upgrade-self', '-d', is_flag=True, default=False, help="Upgrade Pipenv to latest version.") @click.option('--user', '-U', is_flag=True, default=False, help="When upgrading Pipenv, use pip --user") @click.option('--dev', '-d', is_flag=True, default=False, help="Additionally install package(s) in [dev-packages].") From c4b22df30bf71c028e2b2d206a5f8a5300937aa4 Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Thu, 7 Sep 2017 15:12:35 -0400 Subject: [PATCH 04/16] improvements Signed-off-by: Kenneth Reitz --- pipenv/cli.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/pipenv/cli.py b/pipenv/cli.py index d465b442..ac47321a 100644 --- a/pipenv/cli.py +++ b/pipenv/cli.py @@ -1205,20 +1205,20 @@ def check(three=None, python=False): @click.command(help="Updates Pipenv & pip to latest, uninstalls all packages, and re-installs package(s) in [packages] to latest compatible versions.") -@click.option('--dont-upgrade-self', '-d', is_flag=True, default=False, help="Upgrade Pipenv to latest version.") +@click.option('--dont-upgrade', '-d', is_flag=True, default=False, help="Don't upgrade Pipenv & pip.") @click.option('--user', '-U', is_flag=True, default=False, help="When upgrading Pipenv, use pip --user") @click.option('--dev', '-d', is_flag=True, default=False, help="Additionally install package(s) in [dev-packages].") @click.option('--three/--two', is_flag=True, default=None, help="Use Python 3/2 when creating virtualenv.") @click.option('--python', default=False, nargs=1, help="Specify which version of Python virtualenv should use.") @click.option('--dry-run', is_flag=True, default=False, help="Just output outdated packages.") @click.option('--bare', is_flag=True, default=False, help="Minimal output.") -def update(dev=False, three=None, python=None, dry_run=False, bare=False, dont_upgrade_self=False, user=False): +def update(dev=False, three=None, python=None, dry_run=False, bare=False, dont_upgrade=False, user=False): # Ensure that virtualenv is available. ensure_project(three=three, python=python, validate=False) # --dry-run if dry_run: - dont_upgrade_self = True + dont_upgrade = True updates = False # Dev packages @@ -1259,9 +1259,11 @@ def update(dev=False, three=None, python=None, dry_run=False, bare=False, dont_u sys.exit(int(updates)) # Update pip to latest version. - ensure_latest_pip() + if not dont_upgrade: + ensure_latest_pip() - if not dont_upgrade_self: + # Upgrade self to latest version. + if not dont_upgrade: enhance(user=user) click.echo(crayons.yellow('Updating all dependencies from Pipfile...')) From cc33d98613dc0217a6ddccba4d5aa5d52acff7ed Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Thu, 7 Sep 2017 15:24:41 -0400 Subject: [PATCH 05/16] verbose mode Signed-off-by: Kenneth Reitz --- pipenv/cli.py | 48 +++++++++++++++++++++++++++++------------------- 1 file changed, 29 insertions(+), 19 deletions(-) diff --git a/pipenv/cli.py b/pipenv/cli.py index ac47321a..1cf7601c 100644 --- a/pipenv/cli.py +++ b/pipenv/cli.py @@ -264,7 +264,7 @@ def do_where(virtualenv=False, bare=True): click.echo(location) -def do_install_dependencies(dev=False, only=False, bare=False, requirements=False, allow_global=False, ignore_hashes=False, skip_lock=False): +def do_install_dependencies(dev=False, only=False, bare=False, requirements=False, allow_global=False, ignore_hashes=False, skip_lock=False, verbose=False): """"Executes the install functionality.""" if requirements: @@ -312,7 +312,7 @@ def do_install_dependencies(dev=False, only=False, bare=False, requirements=Fals # pip install: for dep, ignore_hash in progress.bar(deps_list): - c = pip_install(dep, ignore_hashes=ignore_hash, allow_global=allow_global, no_deps=no_deps) + c = pip_install(dep, ignore_hashes=ignore_hash, allow_global=allow_global, no_deps=no_deps, verbose=verbose) if c.return_code != 0: click.echo(crayons.red('An error occured while installing!')) @@ -643,7 +643,7 @@ def do_purge(bare=False, downloads=False, allow_global=False): click.echo(crayons.yellow('Environment now purged and fresh!')) -def do_init(dev=False, requirements=False, allow_global=False, ignore_hashes=False, no_hashes=True, ignore_pipfile=False, skip_lock=False): +def do_init(dev=False, requirements=False, allow_global=False, ignore_hashes=False, no_hashes=True, ignore_pipfile=False, skip_lock=False, verbose=False): """Executes the init functionality.""" ensure_pipfile() @@ -686,14 +686,14 @@ def do_init(dev=False, requirements=False, allow_global=False, ignore_hashes=Fal ignore_hashes = False do_install_dependencies(dev=dev, requirements=requirements, allow_global=allow_global, - ignore_hashes=ignore_hashes, skip_lock=skip_lock) + ignore_hashes=ignore_hashes, skip_lock=skip_lock, verbose=verbose) # Activate virtualenv instructions. if not allow_global: do_activate_virtualenv() -def pip_install(package_name=None, r=None, allow_global=False, ignore_hashes=False, no_deps=True): +def pip_install(package_name=None, r=None, allow_global=False, ignore_hashes=False, no_deps=True, verbose=False): # Create files for hash mode. if (not ignore_hashes) and (r is None): @@ -725,6 +725,10 @@ def pip_install(package_name=None, r=None, allow_global=False, ignore_hashes=Fal no_deps = '--no-deps' if no_deps else '' pip_command = '"{0}" install {3} {1} -i {2}'.format(which_pip(allow_global=allow_global), install_reqs, source['url'], no_deps) + + if verbose: + click.echo('$ {0}'.format(pip_command), err=True) + c = delegator.run(pip_command) if c.return_code == 0: @@ -892,9 +896,10 @@ def cli(ctx, where=False, venv=False, rm=False, bare=False, three=False, python= @click.option('--three/--two', is_flag=True, default=None, help="Use Python 3/2 when creating virtualenv.") @click.option('--python', default=False, nargs=1, help="Specify which version of Python virtualenv should use.") @click.option('--system', is_flag=True, default=False, help="System pip management.") +@click.option('--verbose', is_flag=True, default=False, help="Verbose mode.") @click.option('--ignore-pipfile', is_flag=True, default=False, help="Ignore Pipfile when installing, using the Pipfile.lock.") @click.option('--skip-lock', is_flag=True, default=False, help=u"Ignore locking mechanisms when installing—use the Pipfile, instead.") -def install(package_name=False, more_packages=False, dev=False, three=False, python=False, system=False, lock=True, hashes=True, ignore_pipfile=False, skip_lock=False): +def install(package_name=False, more_packages=False, dev=False, three=False, python=False, system=False, lock=True, hashes=True, ignore_pipfile=False, skip_lock=False, verbose=False): # Automatically use an activated virtualenv. if PIPENV_USE_SYSTEM: @@ -918,7 +923,7 @@ def install(package_name=False, more_packages=False, dev=False, three=False, pyt if package_name is False: click.echo(crayons.yellow('No package provided, installing all dependencies.'), err=True) - do_init(dev=dev, allow_global=system, ignore_hashes=not hashes, ignore_pipfile=ignore_pipfile, skip_lock=skip_lock) + do_init(dev=dev, allow_global=system, ignore_hashes=not hashes, ignore_pipfile=ignore_pipfile, skip_lock=skip_lock, verbose=verbose) sys.exit(0) for package_name in package_names: @@ -926,7 +931,7 @@ def install(package_name=False, more_packages=False, dev=False, three=False, pyt # pip install: with spinner(): - c = pip_install(package_name, ignore_hashes=True, allow_global=system, no_deps=False) + c = pip_install(package_name, ignore_hashes=True, allow_global=system, no_deps=False, verbose=verbose) click.echo(crayons.blue(format_pip_output(c.out))) @@ -1207,12 +1212,13 @@ def check(three=None, python=False): @click.command(help="Updates Pipenv & pip to latest, uninstalls all packages, and re-installs package(s) in [packages] to latest compatible versions.") @click.option('--dont-upgrade', '-d', is_flag=True, default=False, help="Don't upgrade Pipenv & pip.") @click.option('--user', '-U', is_flag=True, default=False, help="When upgrading Pipenv, use pip --user") +@click.option('--verbose', '-v', is_flag=True, default=False, help="Verbose mode.") @click.option('--dev', '-d', is_flag=True, default=False, help="Additionally install package(s) in [dev-packages].") @click.option('--three/--two', is_flag=True, default=None, help="Use Python 3/2 when creating virtualenv.") @click.option('--python', default=False, nargs=1, help="Specify which version of Python virtualenv should use.") @click.option('--dry-run', is_flag=True, default=False, help="Just output outdated packages.") @click.option('--bare', is_flag=True, default=False, help="Minimal output.") -def update(dev=False, three=None, python=None, dry_run=False, bare=False, dont_upgrade=False, user=False): +def update(dev=False, three=None, python=None, dry_run=False, bare=False, dont_upgrade=False, user=False, verbose=False): # Ensure that virtualenv is available. ensure_project(three=three, python=python, validate=False) @@ -1225,8 +1231,9 @@ def update(dev=False, three=None, python=None, dry_run=False, bare=False, dont_u if not bare: click.echo(crayons.yellow('Checking dependencies...'), err=True) - packages = project.dev_packages - packages.update(project.packages) + packages = project.packages + if dev: + packages.update(project.dev_packages) installed_packages = {} deps = convert_deps_to_pip(packages, r=False) @@ -1245,13 +1252,16 @@ def update(dev=False, three=None, python=None, dry_run=False, bare=False, dont_u name = result['name'] installed = result['version'] - latest = installed_packages[name] - if installed != latest: - if not bare: - click.echo('{0}=={1} is availble ({2} installed)!'.format(name, latest, installed)) - else: - click.echo('{0}=={1}'.format(name, latest)) - updates = True + try: + latest = installed_packages[name] + if installed != latest: + if not bare: + click.echo('{0}=={1} is availble ({2} installed)!'.format(name, latest, installed)) + else: + click.echo('{0}=={1}'.format(name, latest)) + updates = True + except KeyError: + pass if not updates and not bare: click.echo(crayons.green('All good!')) @@ -1269,7 +1279,7 @@ def update(dev=False, three=None, python=None, dry_run=False, bare=False, dont_u click.echo(crayons.yellow('Updating all dependencies from Pipfile...')) do_purge() - do_init(dev=dev) + do_init(dev=dev, verbose=verbose) click.echo(crayons.yellow('All dependencies are now up-to-date!')) From f7c704963def21036031638d21e3c86a66a8b922 Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Thu, 7 Sep 2017 15:52:20 -0400 Subject: [PATCH 06/16] enhance Signed-off-by: Kenneth Reitz --- pipenv/cli.py | 43 ++++++++++++++++++++++++++++++------------- 1 file changed, 30 insertions(+), 13 deletions(-) diff --git a/pipenv/cli.py b/pipenv/cli.py index 1cf7601c..088d9c6c 100644 --- a/pipenv/cli.py +++ b/pipenv/cli.py @@ -81,27 +81,44 @@ def check_for_updates(): except Exception: pass + def enhance(user=False): r = requests.get('https://pypi.python.org/pypi/pipenv/json', timeout=0.5) latest = sorted([semver.parse_version_info(v) for v in list(r.json()['releases'].keys())])[-1] current = semver.parse_version_info(__version__) - click.echo('{0}: {1} is now available. Automatically upgrading!'.format( - crayons.green('Courtesy Notice'), - crayons.yellow('Pipenv {v.major}.{v.minor}.{v.patch}'.format(v=latest)), - ), err=True) + if current < latest: - if not user: - sys.argv = ['pip', 'install', '--upgrade', 'pipenv'] - else: - sys.argv = ['pip', 'install', '--user', '--upgrade', 'pipenv'] + # Resolve user site, enable user mode automatically. + c = delegator.run('{0} -m site'.format(sys.executable)) - sys.modules['pip'].main() + for line in c.out.split('\n'): + if line.strip().startswith('ENABLE_USER_SITE'): + can_user = eval(line[len('ENABLE_USER_SITE: '):]) + if line.strip().startswith('USER_SITE'): + user_site = eval(''.join(line[len('USER_SITE: '):].split()[:-1])) + + if can_user: + if user_site in sys.modules['pipenv'].__file__: + user = True + + click.echo('{0}: {1} is now available. Automatically upgrading!'.format( + crayons.green('Courtesy Notice'), + crayons.yellow('Pipenv {v.major}.{v.minor}.{v.patch}'.format(v=latest)), + ), err=True) + + if not user: + sys.argv = ['pip', 'install', '--upgrade', 'pipenv'] + else: + sys.argv = ['pip', 'install', '--user', '--upgrade', 'pipenv'] + + sys.modules['pip'].main() + + click.echo('{0} to {1}!'.format( + crayons.green('Pipenv updated'), + crayons.yellow('{v.major}.{v.minor}.{v.patch}'.format(v=latest)) + )) - click.echo('{0} to {1}!'.format( - crayons.green('Pipenv updated'), - crayons.yellow('{v.major}.{v.minor}.{v.patch}'.format(v=latest)) - )) def cleanup_virtualenv(bare=True): """Removes the virtualenv directory from the system.""" From 8e58890c00acb0dd403ec180470d3b4b694e8404 Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Thu, 7 Sep 2017 15:52:29 -0400 Subject: [PATCH 07/16] history Signed-off-by: Kenneth Reitz --- HISTORY.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/HISTORY.txt b/HISTORY.txt index 07603beb..f13df2e4 100644 --- a/HISTORY.txt +++ b/HISTORY.txt @@ -1,3 +1,6 @@ +6.1.0: + - Self–updating! Very fancy. $ pipenv update. + - Verbose mode for update, install. 6.0.3: - Major bug fix. - Fix for Daniel Ryan's weird corner case. From 9e0fe3d3b8e30b636b9131bf2c1636814245503d Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Thu, 7 Sep 2017 16:25:25 -0400 Subject: [PATCH 08/16] shell escaping more often Signed-off-by: Kenneth Reitz --- pipenv/cli.py | 6 +++--- pipenv/project.py | 4 ++-- pipenv/utils.py | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/pipenv/cli.py b/pipenv/cli.py index 088d9c6c..65a4bad6 100644 --- a/pipenv/cli.py +++ b/pipenv/cli.py @@ -768,15 +768,15 @@ def which(command): if command.endswith('.py'): return os.sep.join([project.virtualenv_location] + ['Scripts\{0}'.format(command)]) return os.sep.join([project.virtualenv_location] + ['Scripts\{0}.exe'.format(command)]) - return os.sep.join([project.virtualenv_location] + ['bin/{0}'.format(command)]) + return shellquote(os.sep.join([project.virtualenv_location] + ['bin/{0}'.format(command)])) def which_pip(allow_global=False): """Returns the location of virtualenv-installed pip.""" if allow_global: - return distutils.spawn.find_executable('pip') + return shellquote(distutils.spawn.find_executable('pip')) - return which('pip') + return shellquote(which('pip')) def format_help(help): diff --git a/pipenv/project.py b/pipenv/project.py index 9654a217..985ee138 100644 --- a/pipenv/project.py +++ b/pipenv/project.py @@ -12,7 +12,7 @@ import delegator from requests.compat import OrderedDict from .utils import (format_toml, mkdir_p, convert_deps_from_pip, - pep423_name, recase_file, find_requirements) + pep423_name, recase_file, find_requirements, shellquote) from .environments import PIPENV_MAX_DEPTH, PIPENV_VENV_IN_PROJECT from .environments import PIPENV_USE_SYSTEM @@ -90,7 +90,7 @@ class Project(object): loc = c.out.strip() # Default mode. else: - loc = os.sep.join(self.pipfile_location.split(os.sep)[:-1] + ['.venv']) + loc = shellquote(os.sep.join(self.pipfile_location.split(os.sep)[:-1] + ['.venv'])) self._virtualenv_location = loc return loc diff --git a/pipenv/utils.py b/pipenv/utils.py index 1d77adad..6de8c034 100644 --- a/pipenv/utils.py +++ b/pipenv/utils.py @@ -23,7 +23,7 @@ class PipCommand(pip.basecommand.Command): def shellquote(s): - return "'" + s.replace("'", "'\\''") + "'" + return "'" + s.replace("'", "'\\''").replace(' ', '\\ ') + "'" def resolve_deps(deps, sources=None, verbose=False, hashes=False): From 9175ed068501a804be7f5eed6eafb39ac2cc99d1 Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Thu, 7 Sep 2017 16:26:27 -0400 Subject: [PATCH 09/16] 6.1.0 Signed-off-by: Kenneth Reitz --- pipenv/__version__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pipenv/__version__.py b/pipenv/__version__.py index e7b7493f..166faf77 100644 --- a/pipenv/__version__.py +++ b/pipenv/__version__.py @@ -3,4 +3,4 @@ # //___/ / / / //___/ / // // / / || / / # // / / // ((____ // / / ||/ / -__version__ = '6.0.3' +__version__ = '6.1.0' From 75049408a2b4130df962ce79b1a9d3e6cca8d863 Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Thu, 7 Sep 2017 16:31:16 -0400 Subject: [PATCH 10/16] oops Signed-off-by: Kenneth Reitz --- pipenv/cli.py | 6 +++--- pipenv/project.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pipenv/cli.py b/pipenv/cli.py index 65a4bad6..088d9c6c 100644 --- a/pipenv/cli.py +++ b/pipenv/cli.py @@ -768,15 +768,15 @@ def which(command): if command.endswith('.py'): return os.sep.join([project.virtualenv_location] + ['Scripts\{0}'.format(command)]) return os.sep.join([project.virtualenv_location] + ['Scripts\{0}.exe'.format(command)]) - return shellquote(os.sep.join([project.virtualenv_location] + ['bin/{0}'.format(command)])) + return os.sep.join([project.virtualenv_location] + ['bin/{0}'.format(command)]) def which_pip(allow_global=False): """Returns the location of virtualenv-installed pip.""" if allow_global: - return shellquote(distutils.spawn.find_executable('pip')) + return distutils.spawn.find_executable('pip') - return shellquote(which('pip')) + return which('pip') def format_help(help): diff --git a/pipenv/project.py b/pipenv/project.py index 985ee138..3fdefffa 100644 --- a/pipenv/project.py +++ b/pipenv/project.py @@ -90,7 +90,7 @@ class Project(object): loc = c.out.strip() # Default mode. else: - loc = shellquote(os.sep.join(self.pipfile_location.split(os.sep)[:-1] + ['.venv'])) + loc = os.sep.join(self.pipfile_location.split(os.sep)[:-1] + ['.venv']) self._virtualenv_location = loc return loc From f9f79fa937e266b2f8b0952b9b627884d4456782 Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Thu, 7 Sep 2017 16:31:27 -0400 Subject: [PATCH 11/16] fix Signed-off-by: Kenneth Reitz --- pipenv/__version__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pipenv/__version__.py b/pipenv/__version__.py index 166faf77..4297c1c6 100644 --- a/pipenv/__version__.py +++ b/pipenv/__version__.py @@ -3,4 +3,4 @@ # //___/ / / / //___/ / // // / / || / / # // / / // ((____ // / / ||/ / -__version__ = '6.1.0' +__version__ = '6.1.1' From 34b5a5736b5fe23bf380890f73bfcf906d997b5b Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Thu, 7 Sep 2017 16:32:07 -0400 Subject: [PATCH 12/16] fix bug Signed-off-by: Kenneth Reitz --- HISTORY.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/HISTORY.txt b/HISTORY.txt index f13df2e4..a1096edf 100644 --- a/HISTORY.txt +++ b/HISTORY.txt @@ -1,3 +1,5 @@ +6.1.1: + - Bug fix. 6.1.0: - Self–updating! Very fancy. $ pipenv update. - Verbose mode for update, install. From 437d4e37364fb790a52eb77c3204cdd136e478b0 Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Thu, 7 Sep 2017 16:38:06 -0400 Subject: [PATCH 13/16] remove more shell escaping Signed-off-by: Kenneth Reitz --- pipenv/project.py | 2 +- pipenv/utils.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pipenv/project.py b/pipenv/project.py index 3fdefffa..9654a217 100644 --- a/pipenv/project.py +++ b/pipenv/project.py @@ -12,7 +12,7 @@ import delegator from requests.compat import OrderedDict from .utils import (format_toml, mkdir_p, convert_deps_from_pip, - pep423_name, recase_file, find_requirements, shellquote) + pep423_name, recase_file, find_requirements) from .environments import PIPENV_MAX_DEPTH, PIPENV_VENV_IN_PROJECT from .environments import PIPENV_USE_SYSTEM diff --git a/pipenv/utils.py b/pipenv/utils.py index 6de8c034..62a2984a 100644 --- a/pipenv/utils.py +++ b/pipenv/utils.py @@ -23,7 +23,7 @@ class PipCommand(pip.basecommand.Command): def shellquote(s): - return "'" + s.replace("'", "'\\''").replace(' ', '\\ ') + "'" + return "'" + s.replace("'", "'\\''") + "'" def resolve_deps(deps, sources=None, verbose=False, hashes=False): From 92af904ad060aebc1f4800df1983d987088dcfef Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Thu, 7 Sep 2017 16:38:16 -0400 Subject: [PATCH 14/16] see if that fixes it Signed-off-by: Kenneth Reitz --- pipenv/__version__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pipenv/__version__.py b/pipenv/__version__.py index 4297c1c6..e8d08e9c 100644 --- a/pipenv/__version__.py +++ b/pipenv/__version__.py @@ -3,4 +3,4 @@ # //___/ / / / //___/ / // // / / || / / # // / / // ((____ // / / ||/ / -__version__ = '6.1.1' +__version__ = '6.1.2' From 09fbd15e71462b2af3f82e2366563a8ea8b56b81 Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Thu, 7 Sep 2017 16:51:06 -0400 Subject: [PATCH 15/16] skip validation Signed-off-by: Kenneth Reitz --- docs/advanced.rst | 1 - pipenv/cli.py | 1 + pipenv/environments.py | 2 +- 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/advanced.rst b/docs/advanced.rst index 3c180b0b..b9b57778 100644 --- a/docs/advanced.rst +++ b/docs/advanced.rst @@ -253,7 +253,6 @@ $ pipenv lock variables. To activate them, simply create the variable in your shell and pipenv will detect it. - - ``PIPENV_SKIP_VALIDATION`` — Tells Pipenv to skip ``Pipfile`` validation (case-checking) — useful for slow internet connections. - ``PIPENV_SHELL_COMPAT`` — Toggle from our default ``pipenv shell`` mode to classic. (Suggested for use with pyenv). diff --git a/pipenv/cli.py b/pipenv/cli.py index 088d9c6c..60d9a8c7 100644 --- a/pipenv/cli.py +++ b/pipenv/cli.py @@ -1197,6 +1197,7 @@ def run(command, args, three=None, python=False): @click.option('--three/--two', is_flag=True, default=None, help="Use Python 3/2 when creating virtualenv.") @click.option('--python', default=False, nargs=1, help="Specify which version of Python virtualenv should use.") def check(three=None, python=False): + # Ensure that virtualenv is available. ensure_project(three=three, python=python, validate=False) diff --git a/pipenv/environments.py b/pipenv/environments.py index e86f48ac..bf0baddc 100644 --- a/pipenv/environments.py +++ b/pipenv/environments.py @@ -29,7 +29,7 @@ PIPENV_USE_SYSTEM = os.environ.get('VIRTUAL_ENV') if 'PIPENV_IGNORE_VIRTUALENVS' PIPENV_USE_HASHES = True # Tells pipenv to skip case-checking (slow internet connections). -PIPENV_SKIP_VALIDATION = os.environ.get('PIPENV_SKIP_VALIDATION') +PIPENV_SKIP_VALIDATION = True # Use shell compatibility mode when using venv in project mode. if PIPENV_VENV_IN_PROJECT: From 0433fd23641245681c8b2b762eb77b15f7b9a11e Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Thu, 7 Sep 2017 16:51:32 -0400 Subject: [PATCH 16/16] history Signed-off-by: Kenneth Reitz --- HISTORY.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/HISTORY.txt b/HISTORY.txt index a1096edf..24ee32a2 100644 --- a/HISTORY.txt +++ b/HISTORY.txt @@ -1,3 +1,5 @@ +6.1.2: + - Skip validation of Pipfiles, massive speedup for far-away users. 6.1.1: - Bug fix. 6.1.0: