Skip to content

Commit 719040b

Browse files
authored
Merge pull request #215 from light-curve/maturin-v0.15
Maturin v0.15
2 parents 3b402ae + 9e3c361 commit 719040b

File tree

4 files changed

+53
-18
lines changed

4 files changed

+53
-18
lines changed

.github/workflows/test.yml

Lines changed: 40 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,30 @@ name: Test
33
on: [push, pull_request]
44

55
jobs:
6+
py_build_deps:
7+
outputs:
8+
output: ${{ steps.extract_from_toml.outputs.output }}
9+
10+
runs-on: ubuntu-latest
11+
12+
defaults:
13+
run:
14+
working-directory: light-curve
15+
16+
steps:
17+
- uses: actions/checkout@v3
18+
with:
19+
submodules: true
20+
- name: Set up Python 3.11
21+
uses: actions/setup-python@v4
22+
with:
23+
python-version: "3.11"
24+
- name: Extract build deps from pyproject.toml
25+
id: extract_from_toml
26+
run: |
27+
echo "output="$(python -c 'import tomllib; print(" ".join(tomllib.load(open("pyproject.toml", "rb"))["build-system"]["requires"]))') >> "$GITHUB_OUTPUT"
28+
29+
630
test:
731
runs-on: ubuntu-latest
832

@@ -45,6 +69,8 @@ jobs:
4569
build:
4670
runs-on: ${{ matrix.os }}
4771

72+
needs: [py_build_deps]
73+
4874
strategy:
4975
fail-fast: false
5076
matrix:
@@ -89,10 +115,6 @@ jobs:
89115
run:
90116
working-directory: light-curve
91117

92-
env:
93-
# maturin sets it to 10.7, which is too low for Ceres
94-
MACOSX_DEPLOYMENT_TARGET: '10.9'
95-
96118
steps:
97119
- uses: actions/checkout@v3
98120
- name: Install ceres on macOS
@@ -147,8 +169,8 @@ jobs:
147169
python-version: '3.11'
148170
- name: Set up Rust toolchain
149171
uses: dtolnay/rust-toolchain@stable
150-
- name: Install maturin
151-
run: python3 -mpip install 'maturin>=0.14,<0.15'
172+
- name: Install build deps
173+
run: python3 -mpip install "${{ needs.py_build_deps.outputs.output }}"
152174
- name: Build wheels for abi3=${{ matrix.abi3 }} fftw=${{ matrix.fftw }} ceres=${{ matrix.ceres }} gsl=${{ matrix.gsl }}
153175
run: |
154176
maturin build --find-interpreter --manylinux=off --locked --no-default-features --features=fftw-${{ matrix.fftw }}${{ matrix.ceres == 'source' && ',ceres-source' || '' }}${{ matrix.ceres == 'system' && ',ceres-system' || '' }}${{ matrix.gsl && ',gsl' || '' }}${{ matrix.abi3 && ',abi3' || '' }}
@@ -165,6 +187,8 @@ jobs:
165187
coverage:
166188
runs-on: ubuntu-latest
167189

190+
needs: [py_build_deps]
191+
168192
defaults:
169193
run:
170194
working-directory: light-curve
@@ -182,8 +206,8 @@ jobs:
182206
uses: actions/setup-python@v4
183207
with:
184208
python-version: "3.11"
185-
- name: Install maturin
186-
run: pip install $(python -c 'import tomllib; print(" ".join(tomllib.load(open("pyproject.toml", "rb"))["build-system"]["requires"]))')
209+
- name: Install build deps
210+
run: pip install "${{ needs.py_build_deps.outputs.output }}"
187211
- name: Generate code coverage
188212
run: |
189213
source <(cargo llvm-cov show-env --export-prefix)
@@ -201,6 +225,8 @@ jobs:
201225
msrv-build:
202226
runs-on: ubuntu-latest
203227

228+
needs: [py_build_deps]
229+
204230
defaults:
205231
run:
206232
working-directory: light-curve
@@ -233,24 +259,25 @@ jobs:
233259
- uses: dtolnay/rust-toolchain@master
234260
with:
235261
toolchain: ${{ steps.get_msrv.outputs.msrv }}
236-
- name: Install maturin
237-
run: pip install 'maturin>=0.14,<0.15'
262+
- name: Install build_deps
263+
run: pip install "${{ needs.py_build_deps.outputs.output }}"
238264
- name: Build
239265
run: |
240266
rustup default ${{ steps.get_msrv.outputs.msrv }}
241267
maturin build --find-interpreter
242268
243269
arm:
244-
245270
runs-on: [self-hosted, linux, ARM64]
246271

272+
needs: [py_build_deps]
273+
247274
defaults:
248275
run:
249276
working-directory: light-curve
250277

251278
steps:
252279
- uses: actions/checkout@v3
253-
- name: install maturin
254-
run: pip install 'maturin[patchelf]>=0.14,<0.15'
280+
- name: Install build_deps
281+
run: pip install "${{ needs.py_build_deps.outputs.output }}"
255282
- name: Build
256283
run: maturin build

CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1313

1414
### Changed
1515

16-
--
16+
- **Build breaking**: the only Python build requirement `maturin` updated from v0.14.x to v0.15
1717

1818
### Deprecated
1919

@@ -25,7 +25,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2525

2626
### Fixed
2727

28-
--
28+
- Building from sdist on x86-64 macOS required manual setting of `$MACOSX_DEPLOYMENT_TARGET` to 10.9 or higher. Recent `maturin` update allowed us to specify it via `pyproject.toml`
2929

3030
### Security
3131

light-curve/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ We build aarch64 macOS 12.0+ Python 3.8+ wheels locally and submit them running
3535
rm -rf ./wheelhouse
3636
curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain stable -y
3737
brew install gsl
38-
CIBW_BUILD='cp3*-macosx_arm64' CIBW_ENVIRONMENT="MACOSX_DEPLOYMENT_TARGET=12.0 MATURIN_PEP517_ARGS='--locked --no-default-features --features ceres-source,fftw-source,gsl'" CIBW_BEFORE_ALL='' python3 -mcibuildwheel --platform macos
39-
CIBW_BUILD='cp310-macosx_arm64' CIBW_ENVIRONMENT="MACOSX_DEPLOYMENT_TARGET=12.0 MATURIN_PEP517_ARGS='--locked --no-default-features --features ceres-source,fftw-source,gsl,abi3'" CIBW_BEFORE_ALL='' python3 -mcibuildwheel --platform macos
38+
CIBW_BUILD='cp3*-macosx_arm64' CIBW_ENVIRONMENT="MATURIN_PEP517_ARGS='--locked --no-default-features --features ceres-source,fftw-source,gsl'" CIBW_BEFORE_ALL='' python3 -mcibuildwheel --platform macos
39+
CIBW_BUILD='cp310-macosx_arm64' CIBW_ENVIRONMENT="MATURIN_PEP517_ARGS='--locked --no-default-features --features ceres-source,fftw-source,gsl,abi3'" CIBW_BEFORE_ALL='' python3 -mcibuildwheel --platform macos
4040
twine upload wheelhouse/*.whl
4141
```
4242

light-curve/pyproject.toml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[build-system]
2-
requires = ["maturin>=0.14.0,<0.15"]
2+
requires = ["maturin>=0.15,<0.16"]
33
build-backend = "maturin"
44

55
[project]
@@ -55,6 +55,14 @@ dynamic = [
5555
# It asks to use Cargo.lock to make the build reproducible
5656
locked = true
5757

58+
[tool.maturin.target.aarch64-apple-darwin]
59+
# I belive Rust requires it
60+
macos-deployment-target = "11.0"
61+
62+
[tool.maturin.target.x86_64-apple-darwin]
63+
# Default is 10.7, but we need 10.9 for Ceres
64+
macos-deployment-target = "10.9"
65+
5866
[tool.black]
5967
line-length = 120
6068
target-version = ["py37"]

0 commit comments

Comments
 (0)