Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix compatibility with click version 8 #4726

Merged
merged 2 commits into from
Jul 26, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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