julien.blanchon
add app
c8c12e9
[tox]
isolated_build = True
skip_missing_interpreters = true
envlist =
black
isort
flake8
pylint
mypy
pydocstyle
pre_merge
nightly
[testenv:black]
basepython = python3
deps = black==22.3.0
commands = black --check --diff anomalib -l 120
[testenv:isort]
basepython = python3
deps = isort==5.10.1
commands = isort --check-only --df anomalib --profile=black
[testenv:flake8]
skip_install = true
basepython = python3
deps =
flake8
mccabe
commands = flake8 anomalib --exclude=anomalib/models/components/freia
[testenv:pylint]
skip_install = true
basepython = python3
deps =
pylint
-r{toxinidir}/requirements/base.txt
commands = pylint anomalib --rcfile=tox.ini --ignore=anomalib/models/components/freia/
[testenv:mypy]
basepython = python3
passenv = ftp_proxy
HTTP_PROXY
HTTPS_PROXY
deps =
mypy
-r{toxinidir}/requirements/base.txt
commands =
python -m mypy --install-types --non-interactive anomalib --config-file tox.ini
python -m mypy --install-types --non-interactive tools/train.py --config-file tox.ini
python -m mypy --install-types --non-interactive tools/test.py --config-file tox.ini
[testenv:pydocstyle]
basepython = python3
deps =
pydocstyle
commands = pydocstyle anomalib --config=tox.ini
[testenv:pre_merge]
basepython = python3
passenv = ftp_proxy
HTTP_PROXY
HTTPS_PROXY
CUDA_VISIBLE_DEVICES
ANOMALIB_DATASET_PATH
deps =
coverage
pytest
flaky
-r{toxinidir}/requirements/base.txt
-r{toxinidir}/requirements/openvino.txt
commands =
coverage erase
coverage run --include=anomalib/* -m pytest tests/pre_merge/ -ra --showlocals
; https://github.com/openvinotoolkit/anomalib/issues/94
coverage report -m --fail-under=85
coverage xml -o {toxworkdir}/coverage.xml
[testenv:nightly]
basepython = python3
passenv = ftp_proxy
HTTP_PROXY
HTTPS_PROXY
CUDA_VISIBLE_DEVICES
ANOMALIB_DATASET_PATH
deps =
coverage
pytest
flaky
-r{toxinidir}/requirements/base.txt
-r{toxinidir}/requirements/openvino.txt
commands =
coverage erase
coverage run --include=anomalib/* -m pytest tests/nightly/ -ra --showlocals
; https://github.com/openvinotoolkit/anomalib/issues/94
coverage report -m --fail-under=64
coverage xml -o {toxworkdir}/coverage.xml
[flake8]
max-line-length = 120
ignore = E203,W503
[pylint]
extension-pkg-whitelist = cv2
ignored-modules = cv2
disable = duplicate-code,
arguments-differ,
fixme,
import-error,
no-self-use,
too-many-arguments,
too-many-branches,
too-many-instance-attributes,
too-many-locals,
too-few-public-methods,
generated-members = numpy.*, torch.*
good-names = e, i, id
ignore = tests,docs,anomalib/models/components/freia
max-line-length = 120
max-parents = 15
min-similarity-lines = 5
[mypy]
ignore_missing_imports = True
show_error_codes = True
exclude = anomalib/models/components/freia/
[mypy-anomalib.models.components.freia.*]
follow_imports = skip
[mypy-torch.*]
follow_imports = skip
follow_imports_for_stubs = True
[coverage:report]
exclude_lines =
except ImportError
raise ImportError
except ApiException
raise ApiException
raise ValueError
[pydocstyle]
inherit = false
ignore = D107, ; Missing docstring in __init__
D202, ; No blank lines allowed after function docstring
D203, ; 1 blank line required before class docstring
D213, ; Multi-line docstring summary should start at the second line
D401, ; First line should be in imperative mood; try rephrasing
D404, ; First word of the docstring should not be This
D406, ; Section name should end with a newline
D407, ; Missing dashed underline after section
D413 ; Missing blank line after last section