Skip to content

Commit 18fbd97

Browse files
committed
ci: 🎡 try to fix pip-audit
see pypa/pip-audit#84 (comment) in particular
1 parent 4a48536 commit 18fbd97

File tree

12 files changed

+25
-2
lines changed

12 files changed

+25
-2
lines changed

.github/workflows/_quality-python.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,5 +52,9 @@ jobs:
5252
run: poetry run mypy tests src
5353
- name: Run bandit
5454
run: poetry run bandit -r src
55+
- name: Run pip-audit (datasets worker)
56+
if: ${{ inputs.is-datasets-worker == true }}
57+
run: bash -c "poetry run pip-audit -r <(poetry export -f requirements.txt --with dev | sed '/^requests==2.28.1 ;/,+2 d' | sed '/^kenlm @/d' | sed '/^trec-car-tools @/d')"
5558
- name: Run pip-audit
59+
if: ${{ inputs.is-datasets-worker == false }}
5660
run: bash -c 'poetry run pip-audit -r <(poetry export -f requirements.txt --with dev)'

e2e/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ DOCKER_COMPOSE := ../tools/docker-compose-datasets-server-from-remote-images.yml
1717
DOCKER_IMAGES := ../chart/docker-images.yaml
1818

1919
include ../tools/Python.mk
20+
include ../tools/PythonAudit.mk
2021
include ../tools/PythonTest.mk
2122
include ../tools/DockerRemoteImages.mk
2223
include ../tools/Docker.mk

jobs/mongodb_migration/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ export MONGODB_MIGRATION_MONGO_URL := mongodb://localhost:${MONGO_PORT}
88
DOCKER_COMPOSE := ../../tools/docker-compose-mongo.yml
99

1010
include ../../tools/Python.mk
11+
include ../../tools/PythonAudit.mk
1112
include ../../tools/PythonTest.mk
1213
include ../../tools/Docker.mk
1314

libs/libcache/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,6 @@ export COMPOSE_PROJECT_NAME := libcache
66
DOCKER_COMPOSE := ../../tools/docker-compose-mongo.yml
77

88
include ../../tools/Python.mk
9+
include ../../tools/PythonAudit.mk
910
include ../../tools/PythonTest.mk
1011
include ../../tools/Docker.mk

libs/libcommon/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,6 @@ export COMPOSE_PROJECT_NAME := libcommon
44
DOCKER_COMPOSE := ../../tools/docker-compose-empty.yml
55

66
include ../../tools/Python.mk
7+
include ../../tools/PythonAudit.mk
78
include ../../tools/PythonTest.mk
89
include ../../tools/Docker.mk

libs/libqueue/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,6 @@ export QUEUE_MONGO_URL := mongodb://localhost:${MONGO_PORT}
66
DOCKER_COMPOSE := ../../tools/docker-compose-mongo.yml
77

88
include ../../tools/Python.mk
9+
include ../../tools/PythonAudit.mk
910
include ../../tools/PythonTest.mk
1011
include ../../tools/Docker.mk

services/admin/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ export QUEUE_MONGO_URL := mongodb://localhost:${MONGO_PORT}
77
DOCKER_COMPOSE := ../../tools/docker-compose-mongo.yml
88

99
include ../../tools/Python.mk
10+
include ../../tools/PythonAudit.mk
1011
#include ../../tools/PythonTest.mk
1112
include ../../tools/Docker.mk
1213

services/api/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ export QUEUE_MONGO_URL := mongodb://localhost:${MONGO_PORT}
66
# makefile variables
77
DOCKER_COMPOSE := ../../tools/docker-compose-mongo.yml
88

9-
# Ensure to specify HF_TOKEN when calling make test, ie HF_TOKEN=hf_app_xxx make test
109
include ../../tools/Python.mk
10+
include ../../tools/PythonAudit.mk
1111
#include ../../tools/PythonTest.mk
1212
include ../../tools/Docker.mk
1313

tools/Python.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ quality:
2222
poetry run flake8 tests src
2323
poetry run mypy tests src
2424
poetry run bandit -r src
25-
bash -c 'poetry run pip-audit -r <(poetry export -f requirements.txt --with dev)'
25+
$(MAKE) pip-audit
2626

2727
# Format source code automatically
2828
.PHONY: style

tools/PythonAudit.mk

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.PHONY: pip-audit
2+
pip-audit:
3+
bash -c 'poetry run pip-audit -r <(poetry export -f requirements.txt --with dev)'

workers/first_rows/Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,8 @@ include ../../tools/Docker.mk
1313
.PHONY: run
1414
run:
1515
poetry run python src/first_rows/main.py
16+
17+
.PHONY: pip-audit
18+
pip-audit:
19+
bash -c "poetry run pip-audit -r <(poetry export -f requirements.txt --with dev | sed '/^requests==2.28.1 ;/,+2 d' | sed '/^kenlm @/d' | sed '/^trec-car-tools @/d' | sed '/^libcache @/,+1 d' | sed '/^libcommon @/,+1 d' | sed '/^libqueue @/,+1 d')"
20+
# ^ we remove problematic lines to have a working pip-audit. See https://github.com/pypa/pip-audit/issues/84#issuecomment-1326203111 for "requests"

workers/splits/Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,8 @@ include ../../tools/Docker.mk
1313
.PHONY: run
1414
run:
1515
poetry run python src/splits/main.py
16+
17+
.PHONY: pip-audit
18+
pip-audit:
19+
bash -c "poetry run pip-audit -r <(poetry export -f requirements.txt --with dev | sed '/^requests==2.28.1 ;/,+2 d' | sed '/^kenlm @/d' | sed '/^trec-car-tools @/d')"
20+
# ^ we remove problematic lines to have a working pip-audit. See https://github.com/pypa/pip-audit/issues/84#issuecomment-1326203111 for "requests"

0 commit comments

Comments
 (0)