Skip to content

ci: swap safety check for pip-audit (PyPA, no API key)#3377

Merged
deacon-mp merged 1 commit into
masterfrom
ci/swap-safety-for-pip-audit
May 18, 2026
Merged

ci: swap safety check for pip-audit (PyPA, no API key)#3377
deacon-mp merged 1 commit into
masterfrom
ci/swap-safety-for-pip-audit

Conversation

@deacon-mp
Copy link
Copy Markdown
Contributor

Why

safety check was deprecated 2024-06 (see warning banner on every CI run since). safety scan is the replacement but requires a pyup.io API key + a new GitHub Actions secret to manage, in exchange for one more layer of supply-chain scanning on top of what Dependabot + GitGuardian + SonarCloud already cover.

pip-audit (PyPA's official tool) gives the same Python dependency coverage as a zero-auth drop-in.

What

  • [testenv:safety] now installs pip-audit and runs pip-audit -r requirements.txt / -r requirements-dev.txt.
  • .safety-policy.yml deleted (was only needed to work around the safety 3.x auto-lookup bug).
  • Legacy pyup ignore IDs removed: 39642 was a reportlab vuln long fixed by the current reportlab==4.0.4 pin; 39659 was an aiohttp <3.7.4 issue, and we're on aiohttp==3.13.4.
  • Env name safety kept intact so branch-protection contexts (build (3.13, safety)) don't need a coordinated update. A follow-up PR can rename to audit + update the required check at the same time.

Test

Local python3 -m tox -e safety (now pip-audit under the hood):

No known vulnerabilities found
  safety: OK (69.04s)

Both requirements files come back clean.

Followups (not in this PR)

  • Rename [testenv:safety][testenv:audit] + update branch protection to expect build (3.13, audit) (paired change).
  • Consider adding pip-audit --strict once we're confident in the noise level.

safety check was deprecated 2024-06; safety scan requires a pyup.io API
key and an additional CI secret to manage. Dependabot, GitGuardian, and
SonarCloud already cover supply-chain monitoring from multiple angles, so
the marginal value of integrating a new auth system is low.

pip-audit (PyPA's official tool) provides the same coverage as a
zero-auth drop-in. Both requirements.txt and requirements-dev.txt come
back clean: 'No known vulnerabilities found'.

Legacy pyup ignore IDs are no longer needed:
 - 39642 (reportlab) — superseded by reportlab==4.0.4
 - 39659 (aiohttp)   — superseded by aiohttp==3.13.4

[testenv:safety] env name kept intact so branch protection contexts
(`build (3.13, safety)`) don't need a coordinated update. Rename to
[testenv:audit] can be a small follow-up PR alongside an admin update
of the required check name.
@sonarqubecloud
Copy link
Copy Markdown

@deacon-mp deacon-mp merged commit 35563c6 into master May 18, 2026
12 checks passed
@deacon-mp deacon-mp deleted the ci/swap-safety-for-pip-audit branch May 18, 2026 23:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant