Skip to content

Migrate to uv for Python dependency management #1079

Migrate to uv for Python dependency management

Migrate to uv for Python dependency management #1079

Workflow file for this run

name: CI
on:
push:
branches: [ test ]
pull_request:
branches: [ test ]
jobs:
test:
runs-on: ubuntu-latest
services:
qdrant:
image: qdrant/qdrant:latest
ports:
- 6333:6333
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v4
with:
version: "0.5.27"
- name: Set up Python
run: uv python install 3.11
- name: Cache uv dependencies
uses: actions/cache@v3
with:
path: ~/.cache/uv
key: ${{ runner.os }}-uv-${{ hashFiles('**/uv.lock') }}
restore-keys: |
${{ runner.os }}-uv-
- name: Cache embedding models
uses: actions/cache@v3
with:
path: ~/.cache/huggingface
key: ${{ runner.os }}-embeddings-bge-base-en-v1.5
restore-keys: |
${{ runner.os }}-embeddings-
- name: Install dependencies
run: uv sync --locked
- name: Wait for Qdrant to be ready
run: |
timeout 60 bash -c 'until curl -fsS http://localhost:6333/readyz; do sleep 2; done'
- name: Set environment variables
run: |
echo "QDRANT_URL=http://localhost:6333" >> $GITHUB_ENV
echo "PYTHONPATH=${{ github.workspace }}/scripts:$PYTHONPATH" >> $GITHUB_ENV
echo "CI=true" >> $GITHUB_ENV
echo "USE_TREE_SITTER=1" >> $GITHUB_ENV
- name: Pre-download embedding model
run: |
uv run python -c "from fastembed import TextEmbedding; m = TextEmbedding(model_name='BAAI/bge-base-en-v1.5'); list(m.embed(['test']))"
- name: Run tests
run: uv run python -m pytest -q --junitxml=test-results.xml
- name: Upload test results
uses: actions/upload-artifact@v4
if: always()
with:
name: test-results
path: test-results.xml
retention-days: 7
- name: Test Summary
uses: test-summary/action@v2
if: always()
with:
paths: test-results.xml