forked from tequilahub/pauliengine
-
Notifications
You must be signed in to change notification settings - Fork 0
160 lines (149 loc) · 5.6 KB
/
Copy pathdeploy.yml
File metadata and controls
160 lines (149 loc) · 5.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
name: Publish PauliEngine Python sdist and wheels to PyPI
on:
workflow_dispatch:
inputs:
force-upload:
description: 'Upload artifacts without a corresponding release'
required: false
default: false
type: boolean
release:
types:
- published
pull_request:
# PRs trigger for the "opened", "reopened", "synchronize" events (default) and
# "ready_for_review"
paths:
- .github/workflows/deploy.yml
types:
- opened
- reopened
- synchronize # when new commits are pushed to the PR
- ready_for_review # when the PR is un-drafted
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
COLUMNS: 120
FORCE_COLOR: 3
jobs:
build-sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0 # such that setuptools_scm can do its job correctly
- name: Build SDist
run: |
pipx install uv
pipx run build --verbose --sdist --installer=uv
- uses: actions/upload-artifact@v6
with:
name: cibw-sdist
path: dist/*.tar.gz
build-wheels:
# in combination with the PR types selection, this top-level if statement
# skips running the workflow for Draft PRs
if: ${{ github.event_name == 'push' || !github.event.pull_request.draft }}
name: Build Python wheels for ${{ matrix.os }}
runs-on: ${{ matrix.runs-on }}
strategy:
matrix:
os: [ linux-intel, linux-arm, macos-arm, windows-intel, windows-arm]
include:
- archs: native
platform: auto
- os: linux-intel
runs-on: ubuntu-latest
- os: linux-arm
runs-on: ubuntu-24.04-arm
- os: macos-arm
runs-on: macos-latest
- os: windows-intel
runs-on: windows-latest
- os: windows-arm
runs-on: windows-latest
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- uses: pypa/cibuildwheel@v3.3.1
with:
extras: "uv"
env:
# target platform
CIBW_PLATFORM: ${{ matrix.platform }}
# architectures to build
CIBW_ARCHS: ${{ matrix.archs }}
# use uv and build
CIBW_BUILD_FRONTEND: "build[uv]"
# increase pip debugging output
CIBW_BUILD_VERBOSITY: 1
CIBW_DEBUG_TRACEBACK: TRUE
CIBW_BEFORE_ALL_LINUX: |
dnf install -y ninja-build
# install conan and C++ dependencies for the project
pip install conan
conan profile detect --force
# install symengine
conan install . --output-folder=build --build=missing -pr ./conan_profile
CIBW_BEFORE_ALL_MACOS: |
# install conan and C++ dependencies for the project
pip install conan
conan profile detect --force
# install symengine
conan install . --output-folder=build --build=missing -pr ./conan_profile
CIBW_BEFORE_ALL_WINDOWS: |
pip install delvewheel conan && conan profile detect --force && conan install . --output-folder=build --build=missing -pr conan_profile
# do not activate architecture-dependent compiler flags
# 4 jobs in parallel, but do not start new ones if load average exceeds 5
CIBW_ENVIRONMENT_LINUX:
CMAKE_TOOLCHAIN_FILE=build/conan_toolchain.cmake
CIBW="true"
SKBUILD_BUILD_TOOL_ARGS="-j4;-l5"
# set deployment target for C++20 compatibility
# do not activate architecture-dependent compiler flags
# 4 jobs in parallel, but do not start new ones if load average exceeds 5
CIBW_ENVIRONMENT_MACOS: >
CIBW="true"
MACOSX_DEPLOYMENT_TARGET=15.0
SKBUILD_BUILD_TOOL_ARGS="-j4;-l5"
CIBW_ENVIRONMENT_WINDOWS: >
CIBW="true"
SKBUILD_BUILD_TOOL_ARGS="/m:4"
CMAKE_TOOLCHAIN_FILE=build\conan_toolchain.cmake
# build 3.10, 3.11, 3.12, 3.13 (with GIL), and 3.14 (with GIL)
CIBW_BUILD: "cp310-* cp311-* cp312-* cp313-* cp314-*"
# skip musl builds, and PyPy builds
CIBW_SKIP: "*-musllinux_*"
# use abi3audit to catch issues with Limited API wheels
CIBW_REPAIR_WHEEL_COMMAND_LINUX: |
auditwheel repair -w {dest_dir} {wheel}
if [[ "{wheel}" == *abi3* ]]; then
pipx run abi3audit --strict --report {wheel}
else
echo "{wheel} is not abi3, skipping abi3audit"
fi
# use abi3audit to catch issues with Limited API wheels
CIBW_REPAIR_WHEEL_COMMAND_MACOS: |
delocate-wheel --require-archs {delocate_archs} -w {dest_dir} -v {wheel}
if [[ "{wheel}" == *abi3* ]]; then
pipx run abi3audit --strict --report {wheel}
else
echo "{wheel} is not abi3, skipping abi3audit"
fi
CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: |
delvewheel repair -w {dest_dir} {wheel}
if [[ "{wheel}" == *abi3* ]]; then
pipx run abi3audit --strict --report {wheel}
else
echo "{wheel} is not abi3, skipping abi3audit"
fi
CIBW_TEST_COMMAND: python -m pytest {package}/tests
CIBW_TEST_GROUPS: "test"
- name: Upload wheels
uses: actions/upload-artifact@v6
with:
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
path: wheelhouse/*.whl