Skip to content

Replace safety with pip audit #645

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Nov 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/_e2e_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:
type: string
env:
python-version: 3.9.6
poetry-version: 1.1.13
poetry-version: 1.2.2
# required to get access to use a cached poetry venv in "/home/runner/.cache/pypoetry/virtualenvs"
POETRY_VIRTUALENVS_IN_PROJECT: false
working-directory: e2e
Expand Down
13 changes: 7 additions & 6 deletions .github/workflows/_quality-python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,14 @@ on:
working-directory:
required: true
type: string
safety-exceptions:
required: false
type: string
is-datasets-worker:
required: false
type: boolean
env:
# required to get access to use a cached poetry venv in "/home/runner/.cache/pypoetry/virtualenvs"
POETRY_VIRTUALENVS_IN_PROJECT: false
python-version: "3.9.6"
poetry-version: "1.1.13"
poetry-version: "1.2.2"
jobs:
code-quality:
defaults:
Expand Down Expand Up @@ -55,5 +52,9 @@ jobs:
run: poetry run mypy tests src
- name: Run bandit
run: poetry run bandit -r src
- name: Run safety
run: poetry run safety check ${{ inputs.safety-exceptions }}
- name: Run pip-audit (datasets worker)
if: ${{ inputs.is-datasets-worker == true }}
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')"
- name: Run pip-audit
if: ${{ inputs.is-datasets-worker == false }}
run: bash -c 'poetry run pip-audit -r <(poetry export -f requirements.txt --with dev)'
2 changes: 1 addition & 1 deletion .github/workflows/_unit-tests-python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ env:
POETRY_VIRTUALENVS_IN_PROJECT: false
mongo-port: "27017"
python-version: "3.9.6"
poetry-version: "1.1.13"
poetry-version: "1.2.2"
jobs:
unit-tests:
defaults:
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/w-first_rows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ jobs:
uses: ./.github/workflows/_quality-python.yml
with:
working-directory: workers/first_rows
safety-exceptions: ""
is-datasets-worker: true
unit-tests:
uses: ./.github/workflows/_unit-tests-python.yml
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/w-splits.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ jobs:
uses: ./.github/workflows/_quality-python.yml
with:
working-directory: workers/splits
safety-exceptions: ""
is-datasets-worker: true
unit-tests:
uses: ./.github/workflows/_unit-tests-python.yml
Expand Down
10 changes: 5 additions & 5 deletions chart/docker-images.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
"dockerImage": {
"reverseProxy": "docker.io/nginx:1.20",
"jobs": {
"mongodbMigration": "huggingface/datasets-server-jobs-mongodb_migration:sha-dfa89b1"
"mongodbMigration": "huggingface/datasets-server-jobs-mongodb_migration:sha-b6d4c8a"
},
"services": {
"admin": "huggingface/datasets-server-services-admin:sha-dfa89b1",
"api": "huggingface/datasets-server-services-api:sha-dfa89b1"
"admin": "huggingface/datasets-server-services-admin:sha-b6d4c8a",
"api": "huggingface/datasets-server-services-api:sha-b6d4c8a"
},
"workers": {
"splits": "huggingface/datasets-server-workers-splits:sha-a0d80a3",
"firstRows": "huggingface/datasets-server-workers-first_rows:sha-319bbb8"
"splits": "huggingface/datasets-server-workers-splits:sha-4a48536",
"firstRows": "huggingface/datasets-server-workers-first_rows:sha-4a48536"
}
}
}
1 change: 1 addition & 0 deletions e2e/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ DOCKER_COMPOSE := ../tools/docker-compose-datasets-server-from-remote-images.yml
DOCKER_IMAGES := ../chart/docker-images.yaml

include ../tools/Python.mk
include ../tools/PythonAudit.mk
include ../tools/PythonTest.mk
include ../tools/DockerRemoteImages.mk
include ../tools/Docker.mk
Expand Down
Loading