# Copyright © Advanced Micro Devices, Inc., or its affiliates. # SPDX-License-Identifier: MIT [tox] envlist = py35,py36,py27,lint labels = static = format, isort [testenv] # Some versions of Pytest versions have a bug: # https://github.com/pytest-dev/pytest/issues/5971 which causes the whole test # process to crash if a multiprocessing job has an exception. Fixed in 5.3.3. deps = cmake nanobind -r{toxinidir}/requirements.txt pytest>=5.4.1 pytest-xdist>=1.32.0 filelock invoke setenv = TENSILE_CLIENT_STATIC = {env:TENSILE_CLIENT_STATIC:} PYTHONPATH = {envdir}/build_tmp/tensilelite/rocisa/lib TENSILELITE_CLIENT_ARGS = {env:TENSILELITE_CLIENT_ARGS:} commands = pip install --upgrade pip pip install pytest-cov invoke build-client --build-dir {envdir}/build_tmp {env:TENSILELITE_CLIENT_ARGS} pytest -v --basetemp={envtmpdir} --junit-xml={toxinidir}/python_tests.xml --junit-prefix={envname} --color=yes -n 4 --prebuilt-client={envdir}/build_tmp/tensilelite/client/tensilelite-client {posargs} allowlist_externals = mkdir sh cmake [testenv:lint] basepython = python3 deps = -r{toxinidir}/requirements.txt joblib flake8 commands = flake8 {toxinidir}/Tensile [testenv:format] description = "Formats code so developers don't have to" skip_install = true deps = black==24.4 commands = black \ --line-length=100 \ {toxinidir}/Tensile/Common \ {toxinidir}/Tensile/TensileCreateLibrary \ {toxinidir}/Tensile/Utilities/Decorators \ {posargs} [testenv:isort] description = "Sorts import statements for less merge conflicts" skip_install = true deps = isort==5.13.2 commands = isort \ --profile=black \ {toxinidir}/Tensile/Common \ {toxinidir}/Tensile/TensileCreateLibrary \ {toxinidir}/Tensile/Utilities/Decorators \ {posargs} [testenv:pre_commit] basepython = python3 deps = -r{toxinidir}/requirements.txt joblib pytest>=5.4.1 flake8 commands = flake8 {toxinidir}/Tensile py.test -q --basetemp={envtmpdir} --color=yes {toxinidir}/Tensile -m unit {posargs} [flake8] exclude = .git,build*,dist,.cache,*~ max-line-length = 132 # E/W class violations are errors/warnings reported by pycodestyle, respectively # This mostly just leaves pyflake errors. ignore = E, W