mirror of
https://github.com/kennethreitz/pipenv.git
synced 2026-06-05 22:50:18 +00:00
Merge pull request #4726 from frenzymadness/click8
Fix compatibility with click version 8
This commit is contained in:
@@ -5,7 +5,7 @@ import os
|
||||
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__
|
||||
@@ -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(
|
||||
|
||||
@@ -235,9 +235,10 @@ def python_option(f):
|
||||
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):
|
||||
@@ -318,8 +319,9 @@ def requirementstxt_option(f):
|
||||
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):
|
||||
@@ -358,9 +360,9 @@ def code_option(f):
|
||||
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):
|
||||
|
||||
Reference in New Issue
Block a user