diff --git a/AGENTS.md b/AGENTS.md index 880ee0a78..61312b29e 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -39,6 +39,8 @@ If work is duplicate/trivial busywork, **do not proceed**. Return a short explan ## 2. Development Workflow +- **Never use system `python3` or bare `pip`/`pip install`.** All Python commands must go through `uv` and `.venv/bin/python`. + ### Environment setup ```bash @@ -58,33 +60,33 @@ pre-commit install ```bash # If you are only making Python changes: -VLLM_USE_PRECOMPILED=1 uv pip install -e . +VLLM_USE_PRECOMPILED=1 uv pip install -e . --torch-backend=auto # If you are also making C/C++ changes: -uv pip install -e . +uv pip install -e . --torch-backend=auto ``` ### Running tests -Tests require extra dependencies. -All versions for test dependencies should be read from `requirements/test.txt` +> Requires [Environment setup](#environment-setup) and [Installing dependencies](#installing-dependencies). ```bash -# Install bare minimum test dependencies: -uv pip install pytest pytest-asyncio tblib - -# Install additional test dependencies as needed, or install them all as follows: +# Install test dependencies. +# requirements/test.txt is pinned to x86_64; on other platforms, use the +# unpinned source file instead: +uv pip install -r requirements/test.in # resolves for current platform +# Or on x86_64: uv pip install -r requirements/test.txt -# Run specific test from specific test file -pytest tests/path/to/test.py -v -s -k test_name - -# Run all tests in directory -pytest tests/path/to/dir -v -s +# Run a specific test file (use .venv/bin/python directly; +# `source activate` does not persist in non-interactive shells): +.venv/bin/python -m pytest tests/path/to/test_file.py -v ``` ### Running linters +> Requires [Environment setup](#environment-setup). + ```bash # Run all pre-commit hooks on staged files: pre-commit run diff --git a/requirements/test.in b/requirements/test.in index be4c2e579..dc47976b1 100644 --- a/requirements/test.in +++ b/requirements/test.in @@ -61,7 +61,7 @@ runai-model-streamer[s3,gcs,azure]==0.15.7 fastsafetensors>=0.2.2 # 0.2.2 contains important fixes for multi-GPU mem usage instanttensor>=0.1.5 pydantic>=2.12 # 2.11 leads to error on python 3.13 -decord==0.6.0 +decord==0.6.0; platform_machine == "x86_64" terratorch >= 1.2.2 # Required for Prithvi tests imagehash # Required for Prithvi tests segmentation-models-pytorch > 0.4.0 # Required for Prithvi tests