From d3cf11d30275c56fb837da0d17d5743bb0cade0f Mon Sep 17 00:00:00 2001 From: Dan Ryan Date: Sun, 2 Sep 2018 13:06:07 -0400 Subject: [PATCH] Fix some typos Signed-off-by: Dan Ryan --- pipenv/cli/command.py | 17 +++++++---------- pipenv/cli/options.py | 2 +- pipenv/core.py | 9 +++++---- 3 files changed, 13 insertions(+), 15 deletions(-) diff --git a/pipenv/cli/command.py b/pipenv/cli/command.py index e9848e95..b82c9519 100644 --- a/pipenv/cli/command.py +++ b/pipenv/cli/command.py @@ -193,7 +193,7 @@ def cli( ) ctx.abort() # --two / --three was passed… - if (python or three is not None) or site_packages: + if (state.python or state.three is not None) or site_packages: ensure_project( three=state.three, python=state.python, @@ -319,7 +319,7 @@ def lock( pypi_mirror=state.pypi_mirror) do_lock( clear=state.clear, - pre=state.pre, + pre=state.installstate.pre, keep_outdated=state.installstate.keep_outdated, pypi_mirror=state.pypi_mirror, ) @@ -348,12 +348,9 @@ def lock( @pass_state def shell( state, - three=None, - python=False, fancy=False, shell_args=None, anyway=False, - pypi_mirror=None, ): """Spawns a shell within the virtualenv.""" from ..core import load_dot_env, do_shell @@ -378,11 +375,11 @@ def shell( if os.name == "nt": fancy = True do_shell( - three=three, - python=python, + three=state.three, + python=state.python, fancy=fancy, shell_args=shell_args, - pypi_mirror=pypi_mirror, + pypi_mirror=state.pypi_mirror, ) @@ -481,8 +478,8 @@ def update( outdated = bool(dry_run) if outdated: do_outdated(pypi_mirror=state.pypi_mirror) - packages = [p for p in state.packages if p] - editable = [p for p in state.editable if p] + packages = [p for p in state.installstate.packages if p] + editable = [p for p in state.installstate.editables if p] if not packages: echo( "{0} {1} {2} {3}{4}".format( diff --git a/pipenv/cli/options.py b/pipenv/cli/options.py index 8320bc0e..3b1d3d02 100644 --- a/pipenv/cli/options.py +++ b/pipenv/cli/options.py @@ -85,7 +85,7 @@ def index_option(f): state = ctx.ensure_object(State) state.index = value return value - return option('-i', '--index', expose_value=False, multiple=True, envvar="PIP_INDEX_URL", + return option('-i', '--index', expose_value=False, envvar="PIP_INDEX_URL", help='Target PyPI-compatible package index url.', nargs=1, callback=callback)(f) diff --git a/pipenv/core.py b/pipenv/core.py index 3ccd8bc0..421aac55 100644 --- a/pipenv/core.py +++ b/pipenv/core.py @@ -1634,7 +1634,7 @@ def do_install( ) if selective_upgrade: keep_outdated = True - packages = packages if packages else [] + packages = packages if packages else[] editable_packages = editable_packages if editable_packages else [] package_args = [p for p in packages if p] + [p for p in editable_packages if p] skip_requirements = False @@ -1814,11 +1814,12 @@ def do_install( 'packages': [(pkg, pkg) for pkg in packages], 'editables': [("-e {0}".format(pkg), pkg) for pkg in editable_packages] } + pkg_tuples = [pkg_tuple for pkg_list in pkg_dict.values() for pkg_tuple in pkg_list] - for pkg_type, pkg_tuple in pkg_dict.items(): + for pkg_tuple in pkg_tuples: if not pkg_tuple: continue - pkg_line, pkg_val = pkg_tuple.pop() + pkg_line, pkg_val = pkg_tuple click.echo( crayons.normal( u"Installing {0}…".format(crayons.green(pkg_line, bold=True)), @@ -1965,7 +1966,7 @@ def do_uninstall( ) ) package_names = project.dev_packages.keys() - if packages is False and editable_packages is False and not all_dev: + if not packages and not editable_packages and not all_dev: click.echo(crayons.red("No package provided!"), err=True) return 1 for package_name in package_names: