Skip to content

Commit 0fc9b1d

Browse files
committed
fix: Resolve CI workflow issues for Python bindings
Fixed multiple issues in the GitHub Actions workflow that would cause CI failures: 1. Lint Job Fixes: - Removed unnecessary 'uv venv' creation - Changed from 'uv run' to direct command execution - Installed dependencies with --system flag - Reordered Python setup before uv installation 2. Test Job Fixes: - Removed working-directory from test dependency installation - This ensures dependencies are installed system-wide - Fixed coverage file path (removed leading ./) - Added fail_ci_if_error: false for codecov upload - Made codecov upload continue-on-error 3. Benchmark Job Fixes: - Added missing cache workspace configuration - Removed working-directory from benchmark dependency installation - Ensures consistent dependency installation across jobs 4. Wheel Building Fixes: - Changed from explicit interpreter list to --find-interpreter - This auto-detects available Python versions - More robust across different OS environments - Fixes compatibility issues with maturin-action Why These Changes: - uv venv creates virtual environments, but we need system install for CI - Working directory scoping caused pip to install in wrong locations - Codecov failures shouldn't fail the entire CI pipeline - Auto-detection of interpreters is more reliable than hardcoding These fixes ensure: ✅ Code quality checks run correctly ✅ Tests execute with proper package visibility ✅ Benchmarks can find the installed package ✅ Wheels build for all supported Python versions ✅ CI is resilient to non-critical failures
1 parent 6fe145c commit 0fc9b1d

1 file changed

Lines changed: 15 additions & 16 deletions

File tree

.github/workflows/python-bindings.yml

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -29,33 +29,30 @@ jobs:
2929
steps:
3030
- uses: actions/checkout@v4
3131

32-
- name: Install uv
33-
uses: astral-sh/setup-uv@v5
34-
with:
35-
enable-cache: true
36-
3732
- name: Set up Python
3833
uses: actions/setup-python@v5
3934
with:
4035
python-version: "3.12"
4136

37+
- name: Install uv
38+
uses: astral-sh/setup-uv@v5
39+
with:
40+
enable-cache: true
41+
4242
- name: Install dependencies
43-
working-directory: crates/terraphim_automata_py
44-
run: |
45-
uv venv
46-
uv pip install black ruff mypy
43+
run: uv pip install --system black ruff mypy
4744

4845
- name: Check formatting with Black
4946
working-directory: crates/terraphim_automata_py
50-
run: uv run black --check python/
47+
run: black --check python/
5148

5249
- name: Lint with Ruff
5350
working-directory: crates/terraphim_automata_py
54-
run: uv run ruff check python/
51+
run: ruff check python/
5552

5653
- name: Type check with mypy
5754
working-directory: crates/terraphim_automata_py
58-
run: uv run mypy python/terraphim_automata/ --ignore-missing-imports
55+
run: mypy python/terraphim_automata/ --ignore-missing-imports
5956
continue-on-error: true
6057

6158
test:
@@ -96,7 +93,6 @@ jobs:
9693
run: maturin develop
9794

9895
- name: Install test dependencies
99-
working-directory: crates/terraphim_automata_py
10096
run: uv pip install --system pytest pytest-cov
10197

10298
- name: Run tests
@@ -107,9 +103,11 @@ jobs:
107103
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.12'
108104
uses: codecov/codecov-action@v4
109105
with:
110-
files: ./crates/terraphim_automata_py/coverage.xml
106+
files: crates/terraphim_automata_py/coverage.xml
111107
flags: python-bindings
112108
name: python-${{ matrix.python-version }}
109+
fail_ci_if_error: false
110+
continue-on-error: true
113111

114112
benchmark:
115113
name: Benchmark Performance
@@ -122,6 +120,8 @@ jobs:
122120

123121
- name: Cache Rust dependencies
124122
uses: Swatinem/rust-cache@v2
123+
with:
124+
workspaces: "crates/terraphim_automata_py -> target"
125125

126126
- name: Install uv
127127
uses: astral-sh/setup-uv@v5
@@ -141,7 +141,6 @@ jobs:
141141
run: maturin develop --release
142142

143143
- name: Install benchmark dependencies
144-
working-directory: crates/terraphim_automata_py
145144
run: uv pip install --system pytest pytest-benchmark
146145

147146
- name: Run benchmarks
@@ -179,7 +178,7 @@ jobs:
179178
uses: PyO3/maturin-action@v1
180179
with:
181180
working-directory: crates/terraphim_automata_py
182-
args: --release --out dist --interpreter 3.9 3.10 3.11 3.12
181+
args: --release --out dist --find-interpreter
183182
sccache: "true"
184183
manylinux: auto
185184

0 commit comments

Comments
 (0)