mirror of
https://github.com/hanzoai/anomalib.git
synced 2026-10-30 18:48:11 +00:00
The previous commit was meant to remove .github/workflows and removed every tracked path instead — 892 files, the whole repo. This puts back the 874 that were never in scope; the eighteen workflow files stay gone, for the reasons that commit gives. Content is byte-identical to 9d2aec9 outside .github/workflows.
84 lines
2.0 KiB
INI
84 lines
2.0 KiB
INI
[tox]
|
|
isolated_build = True
|
|
skip_missing_interpreters = true
|
|
envlist =
|
|
pre-commit
|
|
pre-merge-py{38,39,310}
|
|
snyk-scan
|
|
|
|
[testenv]
|
|
passenv = ftp_proxy
|
|
HTTP_PROXY
|
|
HTTPS_PROXY
|
|
CUDA_VISIBLE_DEVICES
|
|
|
|
[testenv:pre-commit]
|
|
basepython = py310
|
|
deps =
|
|
pre-commit
|
|
commands =
|
|
pre-commit run --all-files
|
|
|
|
[testenv:pre-merge-py{38,39,310}]
|
|
passenv = {[testenv]deps}
|
|
ANOMALIB_DATASET_PATH
|
|
deps =
|
|
coverage[toml]
|
|
pytest
|
|
pytest-cov
|
|
pytest-mock
|
|
pytest-order
|
|
flaky
|
|
nbmake
|
|
|
|
commands =
|
|
; 0. Install Anomalib first.
|
|
pip install .[full]
|
|
|
|
; 1. Run Coverage.
|
|
pytest -v --tb=auto tests/integration tests/unit \
|
|
--cov=anomalib \
|
|
--cov-report=xml:{toxworkdir}/coverage.xml \
|
|
--cov-fail-under=75 \
|
|
{posargs}
|
|
|
|
; 2. Test Jupyter Notebooks.
|
|
pytest -v --tb=auto --nbmake examples/notebooks \
|
|
--ignore=examples/notebooks/400_openvino \
|
|
--ignore=examples/notebooks/500_use_cases/501_dobot
|
|
|
|
[testenv:trivy-scan]
|
|
basepython = py310
|
|
passenv = TRIVY_DOWNLOAD_URL
|
|
allowlist_externals =
|
|
bash
|
|
curl
|
|
tar
|
|
rm
|
|
*trivy*
|
|
cat
|
|
install_command = pip install --no-cache-dir {opts} {packages}
|
|
commands =
|
|
; 0. Install Anomalib first.
|
|
pip install .[full]
|
|
|
|
; 1. Run Trivy Scan.
|
|
bash -c "pip freeze > requirements.txt"
|
|
curl -L0 {env:TRIVY_DOWNLOAD_URL} -o {toxworkdir}/trivy.tar.gz
|
|
tar -xzf {toxworkdir}/trivy.tar.gz -C {toxworkdir}
|
|
{toxworkdir}/trivy fs -c .ci/trivy.yaml -o {toxworkdir}/trivy-scan-results.txt ./requirements.txt
|
|
{toxworkdir}/trivy fs -c .ci/trivy.yaml --format spdx-json -o {toxworkdir}/trivy-spdx-anomalib.json ./requirements.txt
|
|
cat {toxworkdir}/trivy-scan-results.txt
|
|
rm {toxworkdir}/trivy.tar.gz
|
|
rm {toxworkdir}/trivy
|
|
rm requirements.txt
|
|
|
|
[testenv:bandit-scan]
|
|
skip_install = true
|
|
deps =
|
|
bandit
|
|
allowlist_externals =
|
|
bandit
|
|
commands =
|
|
bandit -r -c {toxinidir}/.ci/ipas_default.config {toxinidir}/ -f txt -o {toxworkdir}/bandit-report.txt
|