fix(ci): audit the package's dependencies, not the tool venv
The device-types pilot failed pip-audit on pip 25.0.1 of the venv that also held bandit and pip-audit. The package now goes into a venv of its own with a current pip; its frozen set (URL installs left out) is what pip-audit checks.
This commit is contained in:
1 parent
0b21f62553
commit
ba133d9de3
2 files changed
+20
-9
No files matched your search
@@ -137,18 +137,25 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
python-version: "3.12"
|
python-version: "3.12"
|
||||||
- name: Install
|
- name: Install
|
||||||
|
# Two venvs: the tools, and the package alone. Auditing the tools' venv
|
||||||
|
# reported the runner's own pip instead of anything the package brings.
|
||||||
run: |
|
run: |
|
||||||
python -m venv .venv
|
python -m venv .tools
|
||||||
echo "$PWD/.venv/bin" >> "$GITHUB_PATH"
|
.tools/bin/pip install -q --upgrade pip
|
||||||
.venv/bin/pip install -q "$STANDARD" bandit pip-audit
|
.tools/bin/pip install -q "$STANDARD" bandit pip-audit
|
||||||
if [ -n "${{ inputs.pre-install }}" ]; then .venv/bin/pip install -q ${{ inputs.pre-install }}; fi
|
python -m venv .audit
|
||||||
.venv/bin/pip install -q .
|
.audit/bin/pip install -q --upgrade pip
|
||||||
|
if [ -n "${{ inputs.pre-install }}" ]; then .audit/bin/pip install -q ${{ inputs.pre-install }}; fi
|
||||||
|
.audit/bin/pip install -q .
|
||||||
- name: bandit
|
- name: bandit
|
||||||
run: bandit -q -r "$(napalm-standard package)"
|
run: .tools/bin/bandit -q -r "$(.tools/bin/napalm-standard package)"
|
||||||
- name: pip-audit
|
- name: pip-audit
|
||||||
# The installed set: what a user gets today from the package's ranges.
|
# What a user gets today from the package's ranges. Packages installed from
|
||||||
# A package not on PyPI yet (the driver itself, a git pre-install) is skipped with a note.
|
# a URL (the package itself, a git pre-install) are not on PyPI's index yet.
|
||||||
run: pip-audit --skip-editable --progress-spinner off
|
run: |
|
||||||
|
.audit/bin/pip freeze --all | grep -vE ' @ |^-e ' > audit-requirements.txt
|
||||||
|
cat audit-requirements.txt
|
||||||
|
.tools/bin/pip-audit -r audit-requirements.txt --no-deps --disable-pip --progress-spinner off
|
||||||
|
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|||||||
@@ -12,6 +12,10 @@ The format follows [Keep a Changelog](https://keepachangelog.com/), versions fol
|
|||||||
- E501 is off under `tests/`: recorded device output keeps its lines (found in the
|
- E501 is off under `tests/`: recorded device output keeps its lines (found in the
|
||||||
device-types pilot).
|
device-types pilot).
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
- `security` audited the runner's own pip instead of the package: pip-audit now
|
||||||
|
checks a venv holding only the package and its dependencies.
|
||||||
|
|
||||||
## [0.1.0] - 2026-10-22
|
## [0.1.0] - 2026-10-22
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|||||||
Reference in new issue
Block a user