Skip to content

Commit

Permalink
Merge pull request #4726 from frenzymadness/click8
Browse files Browse the repository at this point in the history
Fix compatibility with click version 8
  • Loading branch information
frostming authored Jul 26, 2021
2 parents b44244e + 91d4914 commit d10502c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
5 changes: 3 additions & 2 deletions pipenv/cli/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import sys

from click import (
argument, echo, edit, group, option, pass_context, secho, version_option, Choice
argument, echo, edit, group, option, pass_context, secho, types, version_option, Choice
)

from ..__version__ import __version__
Expand Down Expand Up @@ -459,7 +459,8 @@ def run(state, command, args):
@option(
"--unused",
nargs=1,
default=False,
default="",
type=types.STRING,
help="Given a code path, show potentially unused dependencies.",
)
@option(
Expand Down
14 changes: 8 additions & 6 deletions pipenv/cli/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,9 +235,10 @@ def callback(ctx, param, value):
if value is not None:
state.python = validate_python_path(ctx, param, value)
return value
return option("--python", default=False, nargs=1, callback=callback,
return option("--python", default="", nargs=1, callback=callback,
help="Specify which version of Python virtualenv should use.",
expose_value=False, allow_from_autoenv=False)(f)
expose_value=False, allow_from_autoenv=False,
type=click.types.STRING)(f)


def pypi_mirror_option(f):
Expand Down Expand Up @@ -318,8 +319,9 @@ def callback(ctx, param, value):
if value:
state.installstate.requirementstxt = value
return value
return option("--requirements", "-r", nargs=1, default=False, expose_value=False,
help="Import a requirements.txt file.", callback=callback)(f)
return option("--requirements", "-r", nargs=1, default="", expose_value=False,
help="Import a requirements.txt file.", callback=callback,
type=click.types.STRING)(f)


def emit_requirements_flag(f):
Expand Down Expand Up @@ -358,9 +360,9 @@ def callback(ctx, param, value):
if value:
state.installstate.code = value
return value
return option("--code", "-c", nargs=1, default=False, help="Install packages "
return option("--code", "-c", nargs=1, default="", help="Install packages "
"automatically discovered from import statements.", callback=callback,
expose_value=False)(f)
expose_value=False, type=click.types.STRING)(f)


def deploy_option(f):
Expand Down

0 comments on commit d10502c

Please sign in to comment.