8000 Update release workflows for Python 3.13, Ubuntu 24.04, etc · pysam-developers/pysam@6a5b80c · GitHub
[go: up one dir, main page]

Skip to content

Commit 6a5b80c

Browse files
committed
Update release workflows for Python 3.13, Ubuntu 24.04, etc
Add Python 3.13 to release workflows and update cibuildwheel to a release that uses 3.13-final. Run GitHub release workflow based on pushing tags or release/* branches. Building wheels based on the GitHub Release going live means the wheels take longer to appear than they need to. GitHub Action's macos-latest is now ARM, which we have to date built on Cirrus CI instead. Build on ubuntu-latest and macos-13 (which is x86_64) and add a script and step to check that architectures are as expected. GitHub's Ubuntu 24.04 image has fewer development packages pre-installed; ensure that libbz2 and liblzma development files are present. On macOS, wheels don't carry their own shared libraries, so avoid linking with the non-system-provided library libdeflate.dylib.
1 parent 4c4d9ac commit 6a5b80c

File tree

3 files changed

+55
-17
lines changed

3 files changed

+55
-17
lines changed

.cirrus.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@ build_wheels_task:
1111
- name: Build ARM Linux py3.6-9 wheels
1212
env:
1313
CIBW_BUILD: "cp36-* cp37-* cp38-* cp39-*"
14-
- name: Build ARM Linux py3.10-12 wheels
14+
- name: Build ARM Linux py3.10-13 wheels
1515
env:
16-
CIBW_BUILD: "cp310-* cp311-* cp312-*"
16+
CIBW_BUILD: "cp310-* cp311-* cp312-* cp313-*"
1717

1818
- name: Build ARM macOS wheels
1919
macos_instance:
2020
image: ghcr.io/cirruslabs/macos-sonoma-base:latest
2121
env:
22-
CIBW_BUILD: "cp39-* cp310-* cp311-* cp312-*"
22+
CIBW_BUILD: "cp39-* cp310-* cp311-* cp312-* cp313-*"
2323

2424
alias: build_wheels
2525

@@ -32,11 +32,14 @@ build_wheels_task:
3232
CIBW_SKIP: "*-musllinux_*"
3333
CIBW_BUILD_VERBOSITY: 1
3434

35+
# Avoid linking with non-system library libdeflate.dylib
36+
CIBW_ENVIRONMENT_MACOS: HTSLIB_CONFIGURE_OPTIONS="--without-libdeflate"
37+
3538
CIBW_MANYLINUX_AARCH64_IMAGE: manylinux_2_28
3639

3740
install_script: |
3841
python3 -m venv $VENV
39-
pip3 install cibuildwheel==2.17.0
42+
pip3 install cibuildwheel==2.22.0
4043
4144
build_script: |
4245
cibuildwheel

.github/workflows/release.yaml

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,22 @@ name: Publish wheels
33
on:
44
push:
55
branches:
6-
- v[0-9]+.*
6+
- release/*
77
tags:
88
- v[0-9]+.*
9-
release:
10-
types:
11-
- published
129

1310
jobs:
1411
build_wheels:
15-
runs-on: ${{ matrix.os }}-latest
12+
runs-on: ${{ matrix.os }}
1613
strategy:
1714
matrix:
18-
os: [ubuntu, macos]
19-
build: ["cp36-* cp37-* cp38-* cp39-*", "cp310-* cp311-* cp312-*"]
15+
os: [ubuntu-latest, macos-13]
16+
build: ["cp36-* cp37-* cp38-* cp39-*", "cp310-* cp311-* cp312-* cp313-*"]
2017
x64image: [manylinux_2_28]
2118
nametag: [none]
2219

2320
include:
24-
- os: ubuntu
21+
- os: ubuntu-latest
2522
build: "cp38-manylinux_x86_64"
2623
x64image: manylinux2014
2724
nametag: focal
@@ -30,13 +27,19 @@ jobs:
3027
- name: Checkout pysam
3128
uses: actions/checkout@v4
3229

30+
- name: Check platform ${{ matrix.os }} is the expected architecture
31+
run: devtools/check-platform.sh ${{ matrix.os }}
32+
3333
- name: Build wheels
34-
uses: pypa/cibuildwheel@v2.17.0
34+
uses: pypa/cibuildwheel@v2.22.0
3535
env:
3636
CIBW_BUILD: ${{ matrix.build }}
3737
CIBW_SKIP: "*-musllinux_*"
3838
CIBW_BUILD_VERBOSITY: 1
3939

40+
# Avoid linki 8000 ng with non-system library libdeflate.dylib
41+
CIBW_ENVIRONMENT_MACOS: HTSLIB_CONFIGURE_OPTIONS="--without-libdeflate"
42+
4043
CIBW_ARCHS_LINUX: x86_64
4144
CIBW_ARCHS_MACOS: x86_64
4245

@@ -75,7 +78,7 @@ jobs:
7578
- name: Install build prerequisites
7679
run: |
7780
sudo apt-get update
78-
sudo apt-get install -q --no-install-recommends --no-install-suggests libcurl4-openssl-dev
81+
sudo apt-get install -q --no-install-recommends --no-install-suggests libbz2-dev libcurl4-openssl-dev liblzma-dev
7982
8083
- name: Create source distribution
8184
run: python setup.py sdist --owner=root --group=root
@@ -88,7 +91,7 @@ jobs:
8891
upload_pypi:
8992
needs: [build_wheels, build_sdist]
9093
runs-on: ubuntu-latest
91-
environment: ${{ github.event_name == 'release' && 'pypi' || 'testpypi' }}
94+
environment: ${{ github.ref_type == 'tag' && 'pypi' || 'testpypi' }}
9295

9396
permissions:
9497
id-token: write
@@ -101,11 +104,11 @@ jobs:
101104
path: dist
102105

103106
- name: Publish distribution to Test PyPI
104-
if: github.event_name == 'push'
107+
if: github.ref_type == 'branch'
105108
uses: pypa/gh-action-pypi-publish@release/v1
106109
with:
107110
repository-url: https://test.pypi.org/legacy/
108111

109112
- name: Publish distribution to PyPI
110-
if: github.event_name == 'release' && github.event.action == 'published'
113+
if: github.ref_type == 'tag'
111114
uses: pypa/gh-action-pypi-publish@release/v1

devtools/check-platform.sh

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#!/bin/sh -e
2+
3+
case $1 in
4+
ubuntu-*-arm) expected=arm ;;
5+
macos-13) expected=x86_64 ;;
6+
ubuntu-*) expected=x86_64 ;;
7+
macos-*) expected=arm ;;
8+
windows-*) expected=x86_64 ;;
9+
*)
10+
echo Unknown platform $1 >&2
11+
exit 2
12+
;;
13+
esac
14+
15+
arch=$(uname -m)
16+
case $arch in
17+
arm*|aarch*) actual=arm ;;
18+
x86*) actual=x86_64 ;;
19+
*)
20+
echo Unrecognized uname result $arch >&2
21+
exit 2
22+
;;
23+
esac
24+
25+
if test $actual = $expected
26+
then
27+
echo Running on $arch as expected
28+
exit 0
29+
else
30+
echo Platform $arch is not the expected $expected >&2
31+
exit 1
32+
fi

0 commit comments

Comments
 (0)
0