# Copyright Advanced Micro Devices, Inc., or its affiliates. # SPDX-License-Identifier: MIT [tox] envlist = py3, lint labels = static = format, isort [testenv] description = "Run the geko test suite" basepython = python3 deps = -r{toxinidir}/requirements.txt invoke # Integration tests need a hipBLASLt repo / configs; pass them through with, e.g.: # tox -- --hipblaslt-path ~/rocm-libraries/projects/hipblaslt # Quick local run (skip slow + bin/geko subprocess tests): # tox -- --skip-slow --skip-geko-bin commands = pytest -v --basetemp={envtmpdir} {posargs} [testenv:py3] basepython = python3 [testenv:integration] description = "Provision tensilelite deps (rocisa) from a hipBLASLt checkout, then run the geko suite inside that env." basepython = python3 # HIPBLASLT_PATH must point at the hipBLASLt checkout (the dir containing tensilelite/). # HIPBLASLT_PATH=~/rocm-libraries/projects/hipblaslt tox -e integration # HIPBLASLT_PATH=~/rocm-libraries/projects/hipblaslt tox -e integration -- --skip-slow passenv = HIPBLASLT_PATH ROCM_PATH LD_LIBRARY_PATH HIP_VISIBLE_DEVICES setenv = ROCM_PATH = {env:ROCM_PATH:/opt/rocm} # Put ROCm tools (rocm_agent_enumerator, amdclang, etc.) on PATH so the # tensilelite client build can detect the GPU arch and compile. Without this # the build silently no-ops and the slow/GPU e2e tests fail downstream. PATH = {env:ROCM_PATH:/opt/rocm}/bin{:}{env:PATH} deps = -r{toxinidir}/requirements.txt invoke # README step 3 ("Install tensilelite dependencies") provisions rocisa; geko itself # (README step 4) is installed automatically by tox as the env's package-under-test. # requirements-dev.txt's `./rocisa` is a CWD-relative path, so install rocisa by # absolute path here to avoid resolving it against the geko directory. commands_pre = pip install --upgrade pip pip install -r {env:HIPBLASLT_PATH}/tensilelite/requirements.txt pip install {env:HIPBLASLT_PATH}/tensilelite/rocisa/ # README step 5 ("Testing"): run against the provisioned checkout. # Pass the tests dir explicitly so pytest anchors rootdir at geko and loads # tests/conftest.py (which registers --hipblaslt-path) before parsing args. commands = pytest -v --basetemp={envtmpdir} {toxinidir}/tests --hipblaslt-path {env:HIPBLASLT_PATH} {posargs} [testenv:lint] description = "Static analysis with flake8" skip_install = true deps = flake8 commands = flake8 {toxinidir}/geko [testenv:format] description = "Format code with black" skip_install = true deps = black==24.4 commands = black --line-length=100 {toxinidir}/geko {toxinidir}/scripts {toxinidir}/tests {posargs} [testenv:isort] description = "Sort imports for fewer merge conflicts" skip_install = true deps = isort==5.13.2 commands = isort --profile=black {toxinidir}/geko {toxinidir}/scripts {toxinidir}/tests {posargs} [flake8] exclude = .git,build*,dist,.cache,*~,.tox,*.egg-info max-line-length = 132 # E/W are pycodestyle errors/warnings; ignore to mostly leave pyflakes findings. ignore = E, W