- Venv:
./.venv - Python:
.venv/bin/python(3.13) - ONNX source:
./onnx/
cd onnx
pip install -e . -v # Development install
ONNX_BUILD_TESTS=1 pip install -e . -v # With C++ testslintrunner is configured but may fail in this environment. Use ruff directly:
cd onnx
.venv/bin/python -m ruff format <file>
.venv/bin/python -m ruff check --fix <file>For C++ files, use clang-format.
cd onnx
.venv/bin/pytest onnx/test/<test_file>.py -k "<filter>" -vCommon test commands:
# Shape inference tests for FlexAttention
.venv/bin/pytest onnx/test/shape_inference_test.py -k "flex" -v
# Reference evaluator tests
.venv/bin/pytest onnx/test/reference_evaluator_test.py -k "flex" -v
# All tests
.venv/bin/pytestWhen changing operator schemas in onnx/defs/, regenerate docs:
python onnx/defs/gen_doc.py
python onnx/backend/test/stat_coverage.py