Skip to content

Commit 0edb4ed

Browse files
ElektrikAkarclaude
andcommitted
Separate Python tests from wheel builds
- python-tests.yml: runs on every push/PR, all 3 platforms, Python 3.10+3.12 - python-wheels.yml: only on main + tags, no test inside cibuildwheel, wheels uploaded as artifacts for offline download - Removed CIBW_TEST_* from wheel builds (tested separately) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent ab66835 commit 0edb4ed

2 files changed

Lines changed: 32 additions & 26 deletions

File tree

.github/workflows/python-tests.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Python tests
2+
3+
on:
4+
push:
5+
branches: ['**']
6+
pull_request:
7+
branches: ['**']
8+
9+
jobs:
10+
test:
11+
name: Python ${{ matrix.python }} on ${{ matrix.os }}
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
os: [ubuntu-latest, macos-latest, windows-latest]
16+
python: ['3.10', '3.12']
17+
runs-on: ${{ matrix.os }}
18+
steps:
19+
- uses: actions/checkout@v4
20+
21+
- uses: actions/setup-python@v5
22+
with:
23+
python-version: ${{ matrix.python }}
24+
25+
- name: Install
26+
run: pip install ".[test]" -v
27+
28+
- name: Test
29+
run: pytest tests/python/ -v --tb=short

.github/workflows/python-wheels.yml

Lines changed: 3 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,8 @@ name: Python wheels
22

33
on:
44
push:
5-
branches: [main, Claude]
5+
branches: [main]
66
tags: ['v*']
7-
pull_request:
8-
branches: ['**']
97

108
jobs:
119
build_wheels:
@@ -26,7 +24,7 @@ jobs:
2624
CIBW_SKIP: "*-musllinux_* *-win32 *-manylinux_i686"
2725
CIBW_ARCHS_MACOS: "x86_64 arm64"
2826

29-
# Release build, no tests/benchmarks, max optimization
27+
# Release build, no tests/benchmarks, no heavy solvers
3028
CIBW_CONFIG_SETTINGS: >-
3129
cmake.args=-DDTWC_BUILD_PYTHON=ON
3230
cmake.args=-DDTWC_ENABLE_GUROBI=OFF
@@ -39,10 +37,6 @@ jobs:
3937
CIBW_ENVIRONMENT_MACOS: >-
4038
MACOSX_DEPLOYMENT_TARGET=10.15
4139
CIBW_BEFORE_BUILD_MACOS: "brew install libomp || true"
42-
43-
# Test the built wheel
44-
CIBW_TEST_REQUIRES: "pytest numpy"
45-
CIBW_TEST_COMMAND: "pytest {project}/tests/python -v --tb=short"
4640
CIBW_BUILD_VERBOSITY: 1
4741

4842
- uses: actions/upload-artifact@v4
@@ -61,27 +55,10 @@ jobs:
6155
name: sdist
6256
path: dist/*.tar.gz
6357

64-
test_python:
65-
name: Test Python ${{ matrix.python }} on ${{ matrix.os }}
66-
strategy:
67-
matrix:
68-
os: [ubuntu-latest, macos-latest, windows-latest]
69-
python: ['3.10', '3.12']
70-
runs-on: ${{ matrix.os }}
71-
steps:
72-
- uses: actions/checkout@v4
73-
- uses: actions/setup-python@v5
74-
with:
75-
python-version: ${{ matrix.python }}
76-
- name: Install and test
77-
run: |
78-
pip install ".[test]" -v
79-
pytest tests/python/ -v --tb=short
80-
8158
# publish:
8259
# name: Publish to PyPI
8360
# if: startsWith(github.ref, 'refs/tags/v')
84-
# needs: [build_wheels, build_sdist, test_python]
61+
# needs: [build_wheels, build_sdist]
8562
# runs-on: ubuntu-latest
8663
# permissions:
8764
# id-token: write

0 commit comments

Comments
 (0)