Skip to content

Commit 773c401

Browse files
hallvictoriaVictoria Hall
and
Victoria Hall
authoredDec 4, 2024··
test: add vulnerability scan to official build (#267)
* add pip-audit step to official build * add pip-audit step to public build * ignore setuptools * virtual environment * pip audit outside of venv * ignore setuptools * Ignoring misc. packages * Ignoring double setuptools * Only audit dependencies * Only install required dependencies * Separate list of requirements * updated for pyproject * install importlib_metdata for 3.7 * skip vulnerability scan for 3.7 * syntax * syntax * remove req, pip-audit . --------- Co-authored-by: Victoria Hall <[email protected]>
1 parent c63d6ab commit 773c401

File tree

4 files changed

+29
-52
lines changed

4 files changed

+29
-52
lines changed
 

‎eng/templates/build.yml

-21
This file was deleted.

‎eng/templates/ci-tests.yml

-29
This file was deleted.

‎eng/templates/jobs/build.yml

+25-2
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,38 @@ jobs:
22
- job: "Build"
33
displayName: 'Build Python SDK'
44

5+
strategy:
6+
matrix:
7+
Python37:
8+
PYTHON_VERSION: '3.7'
9+
Python38:
10+
PYTHON_VERSION: '3.8'
11+
Python39:
12+
PYTHON_VERSION: '3.9'
13+
Python310:
14+
PYTHON_VERSION: '3.10'
15+
Python311:
16+
PYTHON_VERSION: '3.11'
17+
Python312:
18+
PYTHON_VERSION: '3.12'
19+
520
steps:
621
- task: UsePythonVersion@0
722
inputs:
8-
versionSpec: "3.11"
23+
versionSpec: $(PYTHON_VERSION)
924
- bash: |
1025
python --version
1126
displayName: 'Check python version'
1227
- bash: |
1328
python -m pip install -U pip
1429
python -m pip install build
30+
if [[ $(PYTHON_VERSION) == "3.7" ]]; then
31+
python -m pip install importlib_metadata
32+
fi
1533
python -m build
16-
displayName: 'Build Python SDK'
34+
displayName: 'Build Python SDK for $(PYTHON_VERSION)'
35+
- bash: |
36+
pip install pip-audit
37+
pip-audit .
38+
displayName: 'Run vulnerability scan'
39+
condition: ne(variables['PYTHON_VERSION'], '3.7')

‎eng/templates/official/jobs/build-artifacts.yml

+4
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,7 @@ jobs:
2626
python -m pip install build
2727
python -m build
2828
displayName: 'Build Python SDK'
29+
- bash: |
30+
pip install pip-audit
31+
pip-audit .
32+
displayName: 'Run vulnerability scan'

0 commit comments

Comments
 (0)
Please sign in to comment.