Skip to content

Commit

Permalink
enable bandit (#37693)
Browse files Browse the repository at this point in the history
* enable bandit

* fix the issue with bandit not honoring the prebuilt wheel directory. AdditionalTestarts is what CONTAINS the artifacts directory argument. Not providing it is the reason for this not resolving

* we don't need to install the package to run bandit against the files on disk

---------

Co-authored-by: Scott Beddall <[email protected]>
  • Loading branch information
xiangyan99 and scbedd authored Oct 10, 2024
1 parent 9ec655b commit 2024e6e
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 7 deletions.
2 changes: 2 additions & 0 deletions eng/pipelines/templates/steps/run_bandit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ parameters:
ServiceDirectory: ''
TestMarkArgument: ''
EnvVars: {}
AdditionalTestArgs: ''

# Please use `$(TargetingString)` to refer to the python packages glob string. This variable is set from resolve-package-targeting.yml.
steps:
Expand All @@ -21,5 +22,6 @@ steps:
--toxenv="bandit"
--disablecov
--filter-type="Omit_management"
${{ parameters.AdditionalTestArgs }}
env: ${{ parameters.EnvVars }}
condition: and(succeededOrFailed(), ne(variables['Skip.Bandit'],'true'))
5 changes: 0 additions & 5 deletions eng/tox/tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -471,11 +471,6 @@ setenv =
deps =
{[base]deps}
commands =
python {repository_root}/eng/tox/create_package_and_install.py \
-d {envtmpdir} \
-p {tox_root} \
-w {envtmpdir} \
--package-type sdist
python -m pip freeze
python {repository_root}/eng/tox/run_bandit.py -t {tox_root}

Expand Down
1 change: 0 additions & 1 deletion sdk/evaluation/azure-ai-evaluation/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ mypy = true
pyright = false
pylint = true
black = true
bandit = false
verifytypes = false

[tool.isort]
Expand Down
1 change: 0 additions & 1 deletion sdk/storage/azure-storage-extensions/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ verifysdist = false
verifywhl = false
sdist = false
breaking = false
bandit = false
# these can be any number of suppressions. note that * present means that ALL warnings will be suppressed for this package
suppressed_skip_warnings = ["*"]

Expand Down

0 comments on commit 2024e6e

Please sign in to comment.