|
10 | 10 |
|
11 | 11 | jobs: |
12 | 12 | build_wheels: |
13 | | - name: Build wheels on ${{ matrix.os }} |
| 13 | + name: Build wheels on ${{ matrix.os }} - Python ${{ matrix.python-version }} |
14 | 14 | runs-on: ${{ matrix.os }} |
15 | 15 | strategy: |
16 | 16 | matrix: |
17 | | - os: [ubuntu-latest, windows-latest, macos-latest] |
| 17 | + os: [ubuntu-latest, windows-latest, macos-latest] |
| 18 | + python-version: ['3.9', '3.10', '3.11', '3.12', '3.13'] |
18 | 19 |
|
19 | 20 | steps: |
20 | 21 | - uses: actions/checkout@v4 |
21 | 22 |
|
22 | 23 | - name: Set up Python |
| 24 | + id: setup-python |
23 | 25 | uses: actions/setup-python@v4 |
24 | 26 | with: |
25 | | - python-version: '3.11' |
| 27 | + python-version: ${{ matrix.python-version }} |
26 | 28 |
|
27 | | - - name: Install dependencies |
28 | | - run: | |
29 | | - python -m pip install --upgrade pip |
30 | | - pip install cibuildwheel |
| 29 | + - name: Install Poetry |
| 30 | + uses: snok/install-poetry@v1 |
| 31 | + with: |
| 32 | + virtualenvs-create: true |
| 33 | + virtualenvs-in-project: true |
| 34 | + |
| 35 | + - name: Load cached venv |
| 36 | + id: cached-pip-wheels |
| 37 | + uses: actions/cache@v3 |
| 38 | + with: |
| 39 | + path: ~/.cache |
| 40 | + key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }} |
31 | 41 |
|
32 | 42 | # Ubuntu: Install CGAL and dependencies |
33 | 43 | - name: Install CGAL on Ubuntu |
@@ -63,61 +73,26 @@ jobs: |
63 | 73 | vcpkg integrate install |
64 | 74 | vcpkg install cgal:x64-windows eigen3:x64-windows gmp:x64-windows mpfr:x64-windows |
65 | 75 |
|
| 76 | + - name: Install dependencies |
| 77 | + run: poetry install --no-interaction --no-root |
| 78 | + |
66 | 79 | - name: Set dynamic version |
67 | 80 | run: | |
68 | 81 | echo "DYNAMIC_VERSION=0.1.0+dev.$(git rev-parse --short HEAD)" >> $GITHUB_ENV |
69 | 82 | shell: bash |
70 | 83 |
|
71 | | - - name: Build wheels |
| 84 | + - name: Poetry build wheel |
72 | 85 | env: |
73 | | - # Configure cibuildwheel |
74 | | - CIBW_BUILD: "cp39-* cp310-* cp311-* cp312-* cp313-*" |
75 | | - CIBW_SKIP: "*-win32 *-manylinux_i686 *-musllinux*" |
76 | | - |
77 | | - # Set dynamic version for build |
78 | | - CIBW_ENVIRONMENT: "CGAL_ALPHA_WRAPPING_VERSION=${{ env.DYNAMIC_VERSION }}" |
79 | | - |
80 | | - # Linux environment |
81 | | - CIBW_BEFORE_BUILD_LINUX: | |
82 | | - yum install -y epel-release && |
83 | | - yum install -y cgal-devel eigen3-devel gmp-devel mpfr-devel gcc-c++ || |
84 | | - (apt-get update && apt-get install -y libcgal-dev libeigen3-dev libgmp-dev libmpfr-dev build-essential) |
85 | | - |
86 | | - # macOS environment |
87 | | - CIBW_BEFORE_BUILD_MACOS: | |
88 | | - brew install cgal eigen gmp mpfr || true |
89 | | - |
90 | | - # Windows environment |
91 | | - CIBW_BEFORE_BUILD_WINDOWS: | |
92 | | - if not exist "C:\vcpkg" ( |
93 | | - git clone https://github.com/Microsoft/vcpkg.git C:\vcpkg && |
94 | | - cd C:\vcpkg && |
95 | | - .\bootstrap-vcpkg.bat && |
96 | | - .\vcpkg integrate install && |
97 | | - .\vcpkg install cgal:x64-windows eigen3:x64-windows gmp:x64-windows mpfr:x64-windows |
98 | | - ) |
99 | | - |
100 | | - # Environment variables for Windows builds |
101 | | - CIBW_ENVIRONMENT_WINDOWS: > |
102 | | - VCPKG_ROOT="C:\vcpkg" |
103 | | - CMAKE_TOOLCHAIN_FILE="C:\vcpkg\scripts\buildsystems\vcpkg.cmake" |
104 | | - |
105 | | - # Repair wheels (especially important for Linux) |
106 | | - CIBW_REPAIR_WHEEL_COMMAND_LINUX: "auditwheel repair -w {dest_dir} {wheel}" |
107 | | - CIBW_REPAIR_WHEEL_COMMAND_MACOS: "delocate-wheel --require-archs {delocate_archs} -w {dest_dir} -v {wheel}" |
108 | | - |
109 | | - # Test command to verify wheels work |
110 | | - CIBW_TEST_COMMAND: "python -c 'import cgal_alpha_wrapping; print(cgal_alpha_wrapping.__name__)'" |
111 | | - |
112 | | - # Build settings |
113 | | - CIBW_BUILD_VERBOSITY: 1 |
114 | | - |
115 | | - run: python -m cibuildwheel --output-dir wheelhouse |
| 86 | + CGAL_ALPHA_WRAPPING_VERSION: ${{ env.DYNAMIC_VERSION }} |
| 87 | + run: | |
| 88 | + mkdir -p wheelhouse |
| 89 | + poetry build --format wheel |
| 90 | + cp dist/*.whl wheelhouse/ |
116 | 91 |
|
117 | 92 | - name: Upload wheels |
118 | 93 | uses: actions/upload-artifact@v4 |
119 | 94 | with: |
120 | | - name: wheels-${{ matrix.os }} |
| 95 | + name: wheels-${{ matrix.os }}-py${{ matrix.python-version }} |
121 | 96 | path: ./wheelhouse/*.whl |
122 | 97 |
|
123 | 98 | build_sdist: |
|
0 commit comments