Skip to content

Commit

Permalink
Fix compatibility with click version 8
Browse files Browse the repository at this point in the history
In the new version of click, if an option has no type and
a default value is of type bool, the required value is also bool.
  • Loading branch information
frenzymadness committed Jun 25, 2021
1 parent 72835f1 commit 00d3030
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions pipenv/cli/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,7 @@ def run(state, command, args):
"--unused",
nargs=1,
default=False,
type=click.types.STRING,
help="Given a code path, show potentially unused dependencies.",
)
@option(
Expand Down
8 changes: 5 additions & 3 deletions pipenv/cli/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,8 @@ def callback(ctx, param, value):
return value
return option("--python", default=False, 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 @@ -319,7 +320,8 @@ def callback(ctx, param, 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)
help="Import a requirements.txt file.", callback=callback,
type=click.types.STRING)(f)


def emit_requirements_flag(f):
Expand Down Expand Up @@ -360,7 +362,7 @@ def callback(ctx, param, value):
return value
return option("--code", "-c", nargs=1, default=False, 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 00d3030

Please sign in to comment.