mirror of
https://github.com/kennethreitz/pipenv.git
synced 2026-06-05 22:50:18 +00:00
add click option for --safety-ignore instead of parsing it out of args
This commit is contained in:
+14
-2
@@ -694,6 +694,12 @@ def run(command, args, three=None, python=False):
|
||||
default=False,
|
||||
help="Given a code path, show potentially unused dependencies.",
|
||||
)
|
||||
@option(
|
||||
'--safety-ignore',
|
||||
is_flag=True,
|
||||
default=False,
|
||||
help="Ignore specified packages when doing the safety check"
|
||||
)
|
||||
@argument('args', nargs=-1)
|
||||
def check(
|
||||
three=None,
|
||||
@@ -701,12 +707,18 @@ def check(
|
||||
system=False,
|
||||
unused=False,
|
||||
style=False,
|
||||
safety_ignore=False,
|
||||
args=None,
|
||||
):
|
||||
from .core import do_check
|
||||
|
||||
print(safety_ignore)
|
||||
do_check(
|
||||
three=three, python=python, system=system, unused=unused, args=args
|
||||
three=three,
|
||||
python=python,
|
||||
system=system,
|
||||
unused=unused,
|
||||
safety_ignore=safety_ignore,
|
||||
args=args
|
||||
)
|
||||
|
||||
|
||||
|
||||
+4
-7
@@ -2338,7 +2338,7 @@ def do_run(command, args, three=None, python=False):
|
||||
do_run_posix(script, command=command)
|
||||
|
||||
|
||||
def do_check(three=None, python=False, system=False, unused=False, args=None):
|
||||
def do_check(three=None, python=False, system=False, unused=False, safety_ignore=False,args=None):
|
||||
if not system:
|
||||
# Ensure that virtualenv is available.
|
||||
ensure_project(three=three, python=python, validate=False, warn=False)
|
||||
@@ -2409,12 +2409,9 @@ def do_check(three=None, python=False, system=False, unused=False, args=None):
|
||||
python = which('python')
|
||||
else:
|
||||
python = system_which('python')
|
||||
try:
|
||||
if '--safety-ignore' in args[0]:
|
||||
ignore = '-i ' + ' -i'.join(args[1:])
|
||||
else:
|
||||
ignore = ''
|
||||
except IndexError:
|
||||
if safety_ignore:
|
||||
ignore = '-i ' + ' -i '.join(args)
|
||||
else:
|
||||
ignore = ''
|
||||
c = delegator.run(
|
||||
'"{0}" {1} check --json --key=1ab8d58f-5122e025-83674263-bc1e79e0 {2}'.format(
|
||||
|
||||
Reference in New Issue
Block a user