mirror of
https://github.com/kennethreitz/pipenv.git
synced 2026-06-05 22:50:18 +00:00
@@ -4,7 +4,7 @@ flake8 = ">=3.3.0,<4"
|
||||
pytest = "*"
|
||||
mock = "*"
|
||||
"delegator.py" = ">=0.0.13"
|
||||
sphinx = "<=1.5.5"
|
||||
Sphinx = "<=1.5.5"
|
||||
"-e ." = "*"
|
||||
toml = "*"
|
||||
|
||||
|
||||
+32
-2
@@ -462,8 +462,6 @@ def ensure_python(three=None, python=None):
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
|
||||
return path_to_python
|
||||
|
||||
|
||||
@@ -1836,6 +1834,37 @@ def check(three=None, python=False):
|
||||
else:
|
||||
click.echo(crayons.green('Passed!'))
|
||||
|
||||
click.echo(
|
||||
crayons.white(u'Checking installed package saftey…', bold=True)
|
||||
)
|
||||
|
||||
path = pep508checker.__file__.rstrip('cdo')
|
||||
path = os.sep.join(__file__.split(os.sep)[:-1] + ['vendor', 'safety.zip'])
|
||||
|
||||
c = delegator.run('"{0}" {1} check --json'.format(which('python'), shellquote(path)))
|
||||
results = json.loads(c.out)
|
||||
for (package, affected, installed, description, vuln) in results:
|
||||
click.echo(
|
||||
'{0}: {1} {2} affected ({3} installed)!'.format(
|
||||
crayons.white(vuln, bold=True),
|
||||
crayons.green(package),
|
||||
crayons.red(affected, bold=False),
|
||||
crayons.red(installed, bold=True)
|
||||
)
|
||||
)
|
||||
|
||||
click.echo('{0}'.format(description))
|
||||
click.echo()
|
||||
|
||||
if not results:
|
||||
click.echo(crayons.green('All good!'))
|
||||
|
||||
return c.return_code
|
||||
|
||||
# print(c.out or c.err)
|
||||
# results = json.loads(c.out)
|
||||
|
||||
|
||||
|
||||
@click.command(help=u"Displays currently–installed dependency graph information.")
|
||||
@click.option('--bare', is_flag=True, default=False, help="Minimal output.")
|
||||
@@ -1960,6 +1989,7 @@ def update(dev=False, three=None, python=None, dry_run=False, bare=False, dont_u
|
||||
)
|
||||
|
||||
|
||||
|
||||
# Install click commands.
|
||||
cli.add_command(graph)
|
||||
cli.add_command(install)
|
||||
|
||||
Vendored
BIN
Binary file not shown.
Reference in New Issue
Block a user