From 4ebbd3e82fa6eb1ea21307d62fb1402999f6dea0 Mon Sep 17 00:00:00 2001 From: Andrew Brown Date: Thu, 21 May 2026 10:54:06 -0700 Subject: [PATCH] ci: fix virtual environment setup Merging #85 revealed a problem with how the Python virtual environment is set up in our primary `ci.yml` file. This change reorders some steps and ensures that the primary `python` executable used is the one from our `.venv` directory. Hopefully this resolves the missing `pytest` dependency [error] on `main`. [error]: https://github.com/triton-lang/triton-ext/actions/runs/26238904449/job/77219652269#step:12:36 --- .github/workflows/ci.yml | 41 ++++++++++++++++++++++------------------ 1 file changed, 23 insertions(+), 18 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bb75636..67a90aa 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,9 +24,9 @@ jobs: with: python-version: '3.12' - name: Install dependencies - run: python3 -m pip install -r requirements.txt + run: python -m pip install -r requirements.txt - name: Check pre-commit - run: python3 -m pre_commit run --all-files --verbose + run: python -m pre_commit run --all-files --verbose - name: Print diff of changes if pre-commit failed if: failure() run: git diff @@ -49,6 +49,27 @@ jobs: - name: Checkout triton-ext uses: actions/checkout@v6.0.2 + - name: Setup Python + uses: actions/setup-python@v6 + with: + python-version: '3.11' + + - name: Setup virtual environment + run: | + python -m venv "$HOME/.venv" + echo "$HOME/.venv/bin" >> $GITHUB_PATH + + - name: Install dependencies + # These dependencies are installed in a separate step so that we can use + # the updated `$GITHUB_PATH`. + run: | + python -m pip install --upgrade pip + python -m pip install -r requirements.txt + echo "pip version: $(pip --version)" + echo "pip location: $(which pip)" + echo "python version: $(python --version)" + echo "python location: $(which python)" + - name: Collect commit hashes id: hashes # See `update-triton.yml` for where this commit hash is updated. @@ -61,22 +82,6 @@ jobs: echo "llvm_hash=$LLVM_HASH" >> $GITHUB_OUTPUT echo "LLVM hash: $LLVM_HASH" - - name: Setup Python - uses: actions/setup-python@v6 - with: - python-version: '3.11' - - - name: Setup virtual environment - run: | - python3 -m venv ~/.venv - source ~/.venv/bin/activate - echo "PATH=$PATH" >> $GITHUB_ENV - - python3 -m pip install --upgrade pip - python3 -m pip install -r requirements.txt - echo "pip version: $(pip --version)" - echo "python version: $(python --version)" - - name: Setup sccache uses: mozilla-actions/sccache-action@v0.0.9 # Both LLVM and Triton builds use sccache, so we set it up at the beginning of the workflow.