Fix some typos

Signed-off-by: Dan Ryan <dan@danryan.co>
This commit is contained in:
Dan Ryan
2018-09-02 13:06:07 -04:00
committed by Tzu-ping Chung
parent f7db50e8fb
commit d3cf11d302
3 changed files with 13 additions and 15 deletions
+7 -10
View File
@@ -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(
+1 -1
View File
@@ -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)
+5 -4
View File
@@ -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: