Skip to content

Commit f96c8f2

Browse files
committed
fix(ci): audit only package deps in isolated venv
1 parent 69f4533 commit f96c8f2

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ MANIFEST
1515

1616
# Virtual environments
1717
.venv/
18+
.venv-audit/
1819
venv/
1920
env/
2021
ENV/

Makefile

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,14 @@ lint: ## Lint with ruff.
6969
lint-fix: ## Lint with ruff --fix.
7070
$(PYTHON) -m ruff check --fix .
7171

72-
security: ## Run pip-audit on resolved dependencies.
72+
security: ## Run pip-audit on this package's dependencies only (isolated venv).
7373
@command -v pip-audit >/dev/null 2>&1 || (echo "install: pip install pip-audit" && exit 1)
74-
pip-audit
74+
@rm -rf .venv-audit
75+
$(PYTHON) -m venv .venv-audit
76+
.venv-audit/bin/pip install -q -U pip pip-audit setuptools wheel
77+
.venv-audit/bin/pip install -q -e .
78+
.venv-audit/bin/pip-audit --skip-editable
79+
@rm -rf .venv-audit
7580

7681
tidy: ## No-op for Python (lockfile management is via pyproject.toml).
7782
@echo "tidy: nothing to do for Python repos."

0 commit comments

Comments
 (0)