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

Vendor new safety (#5217) #5218

Merged
merged 19 commits into from
Nov 23, 2022
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
1 change: 1 addition & 0 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ pytest-cov = "==3.*"
typing-extensions = "==4.*"
waitress = {version = "*", markers="sys_platform == 'win32'"}
gunicorn = {version = "*", markers="sys_platform == 'linux'"}
parse = "*"

[packages]

Expand Down
67 changes: 38 additions & 29 deletions Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

38 changes: 35 additions & 3 deletions pipenv/cli/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ def run(state, command, args):
"--db",
nargs=1,
default=lambda: os.environ.get("PIPENV_SAFETY_DB"),
help="Path to a local PyUp Safety vulnerabilities database."
help="Path or URL to a PyUp Safety vulnerabilities database."
" Default: ENV PIPENV_SAFETY_DB or None.",
)
@option(
Expand All @@ -451,7 +451,7 @@ def run(state, command, args):
)
@option(
"--output",
type=Choice(["default", "json", "full-report", "bare"]),
type=Choice(["default", "json", "full-report", "bare", "screen", "text", "minimal"]),
default="default",
help="Translates to --json, --full-report or --bare from PyUp Safety check",
)
Expand All @@ -464,6 +464,28 @@ def run(state, command, args):
@option(
"--quiet", is_flag=True, help="Quiet standard output, except vulnerability report."
)
@option("--policy-file", default="", help="Define the policy file to be used")
@option(
"--exit-code/--continue-on-error",
default=True,
help="Output standard exit codes. Default: --exit-code",
)
@option(
"--audit-and-monitor/--disable-audit-and-monitor",
default=True,
help="Send results back to pyup.io for viewing on your dashboard. Requires an API key.",
)
@option(
"--project",
default=None,
help="Project to associate this scan with on pyup.io. Defaults to a canonicalized github style name if available, otherwise unknown",
)
@option(
"--save-json",
default="",
help="Path to where output file will be placed, if the path is a directory, "
"Safety will use safety-report.json as filename. Default: empty",
)
@common_options
@system_option
@pass_state
Expand All @@ -472,9 +494,14 @@ def check(
db=None,
style=False,
ignore=None,
output="default",
output="screen",
key=None,
quiet=False,
exit_code=True,
policy_file="",
save_json="",
audit_and_monitor=True,
project=None,
**kwargs,
):
"""Checks for PyUp Safety security vulnerabilities and against PEP 508 markers provided in Pipfile."""
Expand All @@ -490,6 +517,11 @@ def check(
output=output,
key=key,
quiet=quiet,
exit_code=exit_code,
policy_file=policy_file,
save_json=save_json,
audit_and_monitor=audit_and_monitor,
safety_project=project,
pypi_mirror=state.pypi_mirror,
)

Expand Down
Loading