Skip to content

Commit

Permalink
Allow pre-releases when installing safety and using uv as a backend
Browse files Browse the repository at this point in the history
  • Loading branch information
davfsa committed May 7, 2024
1 parent 14e707d commit 7a60424
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
3 changes: 0 additions & 3 deletions dev-requirements/safety.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
safety~=3.2

# Temporary addition to avoid safety erroring due to https://github.com/pypa/pip/pull/9827
pip>=21.1
9 changes: 8 additions & 1 deletion pipelines/safety.nox.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,12 @@
@nox.session()
def safety(session: nox.Session) -> None:
"""Perform dependency scanning."""
session.install("-r", "requirements.txt", *nox.dev_requirements("safety"))
requirements = ("-r", "requirements.txt", *nox.dev_requirements("safety"))

# At the time of writing, safety 3.2.0 relies on dparse, which is only available as a pre-release package (0.6.4b0)
# so allow pre-releases for now
if session.venv_backend == "uv":
requirements += ("--prerelease=allow",)

session.install(*requirements)
session.run("safety", "check", "--full-report")

0 comments on commit 7a60424

Please sign in to comment.