Skip to content

Commit 3fbb83d

Browse files
authored
Merge pull request #207 from tower/develop
Release v0.3.49
2 parents 9a2c123 + c0ede92 commit 3fbb83d

552 files changed

Lines changed: 13040 additions & 4897 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/build-binaries.yml

Lines changed: 78 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,10 @@ on:
1515
plan:
1616
required: true
1717
type: string
18+
workflow_dispatch:
1819
pull_request:
19-
paths:
20-
# When we change pyproject.toml, we want to ensure that the maturin builds still work.
21-
- pyproject.toml
22-
# And when we change this workflow itself...
23-
- .github/workflows/build-binaries.yml
20+
paths-ignore:
21+
- '**.md'
2422

2523
concurrency:
2624
group: ${{ github.workflow }}-${{ github.ref }}
@@ -67,52 +65,62 @@ jobs:
6765
macos-x86_64:
6866
if: ${{ !contains(github.event.pull_request.labels.*.name, 'no-build') }}
6967
runs-on: macos-15
68+
strategy:
69+
matrix:
70+
# Python 3.9/3.10 macOS builds require libintl from Homebrew gettext,
71+
# which is not available on macos-15 runners
72+
python-version: ["3.11", "3.12", "3.13", "3.14"]
7073
steps:
7174
- uses: actions/checkout@v4.2.2
7275
with:
7376
submodules: recursive
7477
- uses: actions-rust-lang/setup-rust-toolchain@v1.11.0
7578
- uses: actions/setup-python@v5.5.0
7679
with:
77-
python-version: ${{ env.PYTHON_VERSION }}
80+
python-version: ${{ matrix.python-version }}
7881
architecture: x64
7982
- name: "Build wheels - x86_64"
8083
uses: PyO3/maturin-action@v1.49.1
8184
with:
8285
target: x86_64
83-
args: --release --locked --out dist
86+
args: --release --locked --out dist -i python${{ matrix.python-version }}
8487
- name: "Upload wheels"
8588
uses: actions/upload-artifact@v4.6.2
8689
with:
87-
name: wheels-macos-x86_64
90+
name: wheels-macos-x86_64-py${{ matrix.python-version }}
8891
path: dist
8992

9093
macos-aarch64:
9194
if: ${{ !contains(github.event.pull_request.labels.*.name, 'no-build') }}
9295
runs-on: macos-15
96+
strategy:
97+
matrix:
98+
# Python 3.9/3.10 macOS builds require libintl from Homebrew gettext,
99+
# which is not available on macos-15 runners
100+
python-version: ["3.11", "3.12", "3.13", "3.14"]
93101
steps:
94102
- uses: actions/checkout@v4.2.2
95103
with:
96104
submodules: recursive
97105
- uses: actions-rust-lang/setup-rust-toolchain@v1.11.0
98106
- uses: actions/setup-python@v5.5.0
99107
with:
100-
python-version: ${{ env.PYTHON_VERSION }}
108+
python-version: ${{ matrix.python-version }}
101109
architecture: arm64
102110
- name: "Build wheels - aarch64"
103111
uses: PyO3/maturin-action@v1.49.1
104112
with:
105113
target: aarch64
106-
args: --release --locked --out dist
114+
args: --release --locked --out dist -i python${{ matrix.python-version }}
107115
- name: "Test wheel - aarch64"
108116
run: |
109-
pip install dist/${{ env.PACKAGE_NAME }}-*.whl --force-reinstall
117+
pip install dist/*.whl --force-reinstall
110118
${{ env.EXECUTABLE_NAME }} --help
111119
python -m ${{ env.MODULE_NAME }} --help
112120
- name: "Upload wheels"
113121
uses: actions/upload-artifact@v4.6.2
114122
with:
115-
name: wheels-aarch64-apple-darwin
123+
name: wheels-aarch64-apple-darwin-py${{ matrix.python-version }}
116124
path: dist
117125

118126
windows:
@@ -123,40 +131,66 @@ jobs:
123131
platform:
124132
- target: x86_64-pc-windows-msvc
125133
arch: x64
126-
- target: aarch64-pc-windows-msvc
127-
arch: x64
128-
# NOTE: Disabling this target due to poor support in PyArrow and
129-
# friends.
134+
# NOTE: i686 disabled due to poor support in PyArrow and friends.
130135
#- target: i686-pc-windows-msvc
131136
# arch: x86
137+
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
132138
steps:
133139
- uses: actions/checkout@v4.2.2
134140
with:
135141
submodules: recursive
136142
- uses: actions-rust-lang/setup-rust-toolchain@v1.11.0
137143
- uses: actions/setup-python@v5.5.0
138144
with:
139-
python-version: ${{ env.PYTHON_VERSION }}
145+
python-version: ${{ matrix.python-version }}
140146
architecture: ${{ matrix.platform.arch }}
141147
- name: "Build wheels"
142148
uses: PyO3/maturin-action@v1.49.1
143149
with:
144150
target: ${{ matrix.platform.target }}
145-
args: --release --locked --out dist
146-
env:
147-
# aarch64 build fails, see https://github.com/PyO3/maturin/issues/2110
148-
XWIN_VERSION: 16
151+
args: --release --locked --out dist -i python${{ matrix.python-version }}
149152
- name: "Test wheel"
150-
if: ${{ !startsWith(matrix.platform.target, 'aarch64') }}
151153
shell: bash
152154
run: |
153-
python -m pip install dist/${{ env.PACKAGE_NAME }}-*.whl --force-reinstall
155+
python -m pip install dist/*.whl --force-reinstall
154156
${{ env.EXECUTABLE_NAME }} --help
155157
python -m ${{ env.MODULE_NAME }} --help
156158
- name: "Upload wheels"
157159
uses: actions/upload-artifact@v4.6.2
158160
with:
159-
name: wheels-${{ matrix.platform.target }}
161+
name: wheels-${{ matrix.platform.target }}-py${{ matrix.python-version }}
162+
path: dist
163+
164+
windows-aarch64:
165+
if: ${{ !contains(github.event.pull_request.labels.*.name, 'no-build') }}
166+
runs-on: windows-11-arm
167+
strategy:
168+
matrix:
169+
# Python ARM64 Windows builds started with 3.11
170+
python-version: ["3.11", "3.12", "3.13", "3.14"]
171+
steps:
172+
- uses: actions/checkout@v4.2.2
173+
with:
174+
submodules: recursive
175+
- uses: actions-rust-lang/setup-rust-toolchain@v1.11.0
176+
- uses: actions/setup-python@v5.5.0
177+
with:
178+
python-version: ${{ matrix.python-version }}
179+
- name: "Build wheels"
180+
uses: PyO3/maturin-action@v1.49.1
181+
with:
182+
target: aarch64-pc-windows-msvc
183+
args: --release --locked --out dist -i python${{ matrix.python-version }}
184+
- name: "Test wheel"
185+
shell: bash
186+
run: |
187+
python -m pip install dist/*.whl --force-reinstall
188+
${{ env.EXECUTABLE_NAME }} --help
189+
python -m ${{ env.MODULE_NAME }} --help
190+
- name: "Upload wheels"
191+
uses: actions/upload-artifact@v4.6.2
192+
with:
193+
name: wheels-aarch64-pc-windows-msvc-py${{ matrix.python-version }}
160194
path: dist
161195

162196
linux:
@@ -180,7 +214,7 @@ jobs:
180214
uses: PyO3/maturin-action@v1.49.1
181215
with:
182216
manylinux: auto
183-
args: --release --locked --out dist
217+
args: --release --locked --out dist -i python3.10 python3.11 python3.12 python3.13 python3.14
184218
before-script-linux: |
185219
# If we're running on rhel centos, install needed packages.
186220
if command -v yum &> /dev/null; then
@@ -199,7 +233,8 @@ jobs:
199233
- name: "Test wheel"
200234
if: ${{ startsWith(matrix.target, 'x86_64') }}
201235
run: |
202-
pip install dist/${{ env.PACKAGE_NAME }}-*.whl --force-reinstall
236+
PYTAG="cp$(python -c "import sys; print(f'{sys.version_info.major}{sys.version_info.minor}')")"
237+
pip install dist/*-${PYTAG}-*.whl --force-reinstall
203238
${{ env.EXECUTABLE_NAME }} --help
204239
python -m ${{ env.MODULE_NAME }} --help
205240
- name: "Upload wheels"
@@ -218,11 +253,7 @@ jobs:
218253
arch: aarch64
219254
# see https://github.com/astral-sh/ruff/issues/3791
220255
# and https://github.com/gnzlbg/jemallocator/issues/170#issuecomment-1503228963
221-
maturin_docker_options: -e JEMALLOC_SYS_WITH_LG_PAGE=16
222-
- target: armv7-unknown-linux-gnueabihf
223-
arch: armv7
224-
- target: arm-unknown-linux-musleabihf
225-
arch: arm
256+
maturin_docker_options: -e JEMALLOC_SYS_WITH_LG_PAGE=16 -e PYO3_USE_ABI3_FORWARD_COMPATIBILITY=1
226257

227258
steps:
228259
- uses: actions/checkout@v4.2.2
@@ -238,8 +269,9 @@ jobs:
238269
target: ${{ matrix.platform.target }}
239270
manylinux: auto
240271
docker-options: ${{ matrix.platform.maturin_docker_options }}
241-
args: --release --locked --out dist
272+
args: --release --locked --out dist -i python3.10 python3.11 python3.12 python3.13 python3.14
242273
env:
274+
CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse
243275
# Set the CFLAGS for the aarch64 target, defining the ARM architecture
244276
# for the ring crate's build script. This is a workaround for the
245277
# issue where the ring crate's build script is not able to detect the
@@ -249,18 +281,22 @@ jobs:
249281
if: ${{ matrix.platform.arch != 'ppc64' && matrix.platform.arch != 'ppc64le'}}
250282
name: Test wheel
251283
with:
252-
arch: ${{ matrix.platform.arch == 'arm' && 'armv6' || matrix.platform.arch }}
253-
distro: ${{ matrix.platform.arch == 'arm' && 'bullseye' || 'ubuntu22.04' }}
284+
arch: ${{ matrix.platform.arch }}
285+
distro: ubuntu22.04
254286
githubToken: ${{ github.token }}
255287
install: |
256288
apt-get update
257289
apt-get install -y --no-install-recommends python3 python3-pip python3-venv python3-dev cargo libffi-dev
258-
pip3 install -U pip
259290
# Create and use a virtual environment to avoid the externally-managed-environment error
260291
run: |
292+
# Workaround for QEMU bug when emulating 32-bit on 64-bit hosts
293+
# See: https://github.com/docker/buildx/issues/395
294+
# Use /tmp for CARGO_HOME (often tmpfs, which avoids the QEMU filesystem bug)
295+
export CARGO_HOME=/tmp/cargo-home
261296
python3 -m venv /tmp/venv
262297
. /tmp/venv/bin/activate
263-
pip3 install dist/${{ env.PACKAGE_NAME }}-*.whl --force-reinstall
298+
PYTAG="cp$(python3 -c "import sys; print(f'{sys.version_info.major}{sys.version_info.minor}')")"
299+
pip3 install dist/*-${PYTAG}-*.whl --force-reinstall
264300
${{ env.EXECUTABLE_NAME }} --help
265301
- name: "Upload wheels"
266302
uses: actions/upload-artifact@v4.6.2
@@ -290,7 +326,7 @@ jobs:
290326
with:
291327
target: ${{ matrix.target }}
292328
manylinux: musllinux_1_2
293-
args: --release --locked --out dist
329+
args: --release --locked --out dist -i python3.10 python3.11 python3.12 python3.13 python3.14
294330
- name: "Test wheel"
295331
if: matrix.target == 'x86_64-unknown-linux-musl'
296332
uses: addnab/docker-run-action@v3
@@ -300,7 +336,8 @@ jobs:
300336
run: |
301337
apk add python3 python3-dev py3-pip rust
302338
python -m venv .venv
303-
.venv/bin/pip3 install dist/${{ env.PACKAGE_NAME }}-*.whl --force-reinstall
339+
PYTAG="cp$(python -c "import sys; print(f'{sys.version_info.major}{sys.version_info.minor}')")"
340+
.venv/bin/pip3 install dist/*-${PYTAG}-*.whl --force-reinstall
304341
.venv/bin/${{ env.EXECUTABLE_NAME }} --help
305342
- name: "Upload wheels"
306343
uses: actions/upload-artifact@v4.6.2
@@ -328,8 +365,7 @@ jobs:
328365
with:
329366
target: ${{ matrix.platform.target }}
330367
manylinux: musllinux_1_2
331-
args: --release --locked --out dist
332-
docker-options: ${{ matrix.platform.maturin_docker_options }}
368+
args: --release --locked --out dist -i python3.10 python3.11 python3.12 python3.13 python3.14
333369
- uses: uraimo/run-on-arch-action@v2
334370
name: Test wheel
335371
with:
@@ -340,7 +376,8 @@ jobs:
340376
apk add python3 python3-dev py3-pip rust
341377
run: |
342378
python -m venv .venv
343-
.venv/bin/pip3 install dist/${{ env.PACKAGE_NAME }}-*.whl --force-reinstall
379+
PYTAG="cp$(python3 -c "import sys; print(f'{sys.version_info.major}{sys.version_info.minor}')")"
380+
.venv/bin/pip3 install dist/*-${PYTAG}-*.whl --force-reinstall
344381
.venv/bin/${{ env.EXECUTABLE_NAME }} --help
345382
- name: "Upload wheels"
346383
uses: actions/upload-artifact@v4.6.2

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
/.venv
33
*.pyc
44
__pycache__
5+
*.so
56

67

78
# may contain sensitive data
@@ -24,3 +25,6 @@ pytest.ini
2425

2526
# from nix builds
2627
/result
28+
29+
# wheel build artifacts
30+
*.data/

CODE_OF_CONDUCT.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ representative at an online or offline event.
5555
## Enforcement
5656

5757
Instances of abusive, harassing, or otherwise unacceptable behaviour may be
58-
reported to the community leaders responsible for enforcement at <engineering@tower.dev>.
58+
reported to the community leaders responsible for enforcement at <hello@tower.dev>.
5959
All complaints will be reviewed and investigated promptly and fairly.
6060

6161
All community leaders are obligated to respect the privacy and security of the
@@ -113,3 +113,7 @@ This Code of Conduct is adapted from the [Contributor Covenant](https://contribu
113113
[1.4](https://www.contributor-covenant.org/version/1/4/code-of-conduct/code_of_conduct.md) and
114114
[2.0](https://www.contributor-covenant.org/version/2/0/code_of_conduct/code_of_conduct.md),
115115
and was generated by [contributing.md](https://contributing.md/generator).
116+
117+
---
118+
119+
See also: [CONTRIBUTING.md](CONTRIBUTING.md) · [DEVELOPMENT.md](DEVELOPMENT.md) · [README.md](README.md)

0 commit comments

Comments
 (0)