@@ -29,34 +29,29 @@ runs:
2929 - name : Setup Python
3030 uses : actions/setup-python@v5
3131 with :
32- python-version : " 3.11 "
32+ python-version : " 3.10 "
3333
3434 - name : Setup Rust with cache
3535 uses : ./.github/actions/utils/setup-rust-with-cache
3636
37- - name : Cache pip
37+ - name : Install uv
38+ uses : astral-sh/setup-uv@v7
39+
40+ - name : Cache uv
3841 uses : actions/cache@v4
3942 with :
40- path : ~/.cache/pip
41- key : pip -${{ runner.os }}-${{ hashFiles('foreign/python/pyproject.toml ') }}
43+ path : ~/.cache/uv
44+ key : uv -${{ runner.os }}-${{ hashFiles('examples/python/uv.lock', ' foreign/python/uv.lock', 'bdd/python/uv.lock ') }}
4245
4346 - name : Install dependencies
47+ shell : bash
4448 run : |
45- python -m pip install --upgrade pip wheel setuptools
46-
47- # Install maturin for building
48- pip install 'maturin>=1.2,<2.0'
49-
50- # Install testing dependencies from pyproject.toml
5149 cd foreign/python
52- pip install -e ".[testing,dev]"
53- cd ../..
54-
55- # Install additional CI dependencies for Docker testing if needed
5650 if [ "${{ inputs.task }}" = "test" ]; then
57- pip install 'testcontainers[docker]>=3.7.0,<5.0' || true
51+ uv sync --frozen --extra dev --extra testing --extra testing-docker
52+ else
53+ uv sync --frozen --extra dev --extra testing
5854 fi
59- shell : bash
6055
6156 - name : Lint and format check
6257 if : inputs.task == 'lint'
@@ -71,19 +66,21 @@ runs:
7166 [ -d "$DIR_BDD" ] && DIRS_TO_CHECK="$DIRS_TO_CHECK $DIR_BDD"
7267 [ -d "$DIR_EXAMPLES" ] && DIRS_TO_CHECK="$DIRS_TO_CHECK $DIR_EXAMPLES"
7368
69+ cd foreign/python
70+
7471 echo "Directories to check: $DIRS_TO_CHECK"
75- echo "ruff version: $(ruff --version)"
72+ echo "ruff version: $(uv run ruff --version)"
7673
7774 echo "Running ruff check..."
78- ruff check $DIRS_TO_CHECK
75+ uv run ruff check $DIRS_TO_CHECK
7976
8077 echo "Running ruff format --check..."
81- ruff format --check $DIRS_TO_CHECK
78+ uv run ruff format --check $DIRS_TO_CHECK
8279
8380 # mypy only for the SDK (has type stubs)
8481 echo "Running mypy on SDK..."
85- mypy --explicit-package-bases "$DIR_SDK"
86- echo "mypy version: $(mypy --version)"
82+ uv run mypy --explicit-package-bases "$DIR_SDK"
83+ echo "mypy version: $(uv run mypy --version)"
8784 shell : bash
8885
8986 - name : Build Python wheel for testing
@@ -93,12 +90,12 @@ runs:
9390
9491 # Build the module
9592 echo "Building Python wheel..."
96- maturin build -o dist
93+ uv run maturin build -o dist
9794
9895 if [ "${{ inputs.task }}" = "test" ]; then
9996 # Install the built wheel for testing
10097 echo "Installing built wheel..."
101- pip install dist/*.whl --force-reinstall
98+ uv pip install dist/*.whl --force-reinstall
10299 fi
103100
104101 if [ "${{ inputs.task }}" = "build" ]; then
@@ -125,7 +122,7 @@ runs:
125122 # Run all tests with server connection
126123 IGGY_SERVER_HOST=127.0.0.1 \
127124 IGGY_SERVER_TCP_PORT=8090 \
128- pytest tests/ -v \
125+ uv run pytest tests/ -v \
129126 --junitxml=../../reports/python-junit.xml \
130127 --tb=short \
131128 --capture=no || TEST_EXIT_CODE=$?
@@ -142,7 +139,7 @@ runs:
142139 echo "⚠️ Server failed to start, running unit tests only..."
143140
144141 # Run unit tests only (exclude integration tests)
145- pytest tests/ -v \
142+ uv run pytest tests/ -v \
146143 -m "not integration" \
147144 --junitxml=../../reports/python-junit.xml \
148145 --tb=short || TEST_EXIT_CODE=$?
0 commit comments