Skip to content

Commit 4107197

Browse files
committed
ci: update to build for python3.14
Problem: we need to support Python 3.14 and also publish correct metadata. Solution: Do that. Signed-off-by: vsoch <vsoch@users.noreply.github.com>
1 parent 3b0a82e commit 4107197

4 files changed

Lines changed: 44 additions & 43 deletions

File tree

‎.github/workflows/build-release.yaml‎

Lines changed: 38 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88
description: 'Pypi version'
99
release_version:
1010
description: 'Version of flux to build'
11-
default: "0.68.0"
11+
default: "0.88.0"
1212
rc:
1313
description: 'Release candidate to build (for wheel)'
1414
default: "0"
@@ -18,16 +18,35 @@ on:
1818
repo:
1919
description: 'Repository to build from'
2020
default: "https://github.com/flux-framework/flux-core"
21+
glibc:
22+
description: 'Oldest glibc to support, as a manylinux tag version'
23+
default: "2_17"
2124

2225
jobs:
23-
build-manual:
26+
build:
2427
runs-on: ubuntu-latest
2528
strategy:
2629
fail-fast: false
2730
matrix:
28-
python: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
31+
include:
32+
# Maybe time to stop supporting...
33+
- python: "3.8"
34+
base: jammy
35+
- python: "3.9"
36+
base: jammy
37+
- python: "3.10"
38+
base: jammy
39+
- python: "3.11"
40+
base: jammy
41+
- python: "3.12"
42+
base: jammy
43+
- python: "3.13"
44+
base: jammy
45+
# Update to noble for 3.14
46+
- python: "3.14"
47+
base: noble
2948
container:
30-
image: fluxrm/testenv:jammy
49+
image: fluxrm/testenv:${{ matrix.base }}
3150
steps:
3251
- uses: actions/checkout@v4
3352
- name: Setup Python
@@ -38,8 +57,8 @@ jobs:
3857

3958
- name: Build Flux Core Branch
4059
env:
41-
FLUX_RELEASE_VERSION: ${{ inputs.release_version }}
42-
FLUX_VERSION: ${{ inputs.version }}
60+
FLUX_RELEASE_VERSION: ${{ inputs.release_version || '0.88.0' }}
61+
FLUX_VERSION: ${{ inputs.version || inputs.release_version || '0.88.0' }}
4362
run: /bin/bash .github/scripts/setup.sh
4463

4564
- name: Build Python Bindings
@@ -56,7 +75,7 @@ jobs:
5675
if [[ "${FLUX_BRANCH}" == "" ]]; then
5776
FLUX_BRANCH="master"
5877
fi
59-
git clone -b ${FLUX_BRANCH} ${FLUX_REPO} /tmp/flux-core
78+
git clone -b ${FLUX_BRANCH} ${FLUX_REPO} /tmp/flux-core
6079
mv /tmp/flux-core/src/bindings/python/flux ./flux
6180
/opt/conda/envs/build/bin/python3 setup.py sdist
6281
sudo ldconfig
@@ -65,11 +84,20 @@ jobs:
6584
env:
6685
build_number: ${{ inputs.rc }}
6786
python_version: ${{ matrix.python }}
87+
MANYLINUX_GLIBC: ${{ inputs.glibc || '2_17' }}
6888
run: |
6989
/bin/bash ./docker/build-wheels.sh ${build_number} ${python_version}
7090
ls ./dist
7191
72-
- name: Upload distributions
92+
- name: Test Install
93+
shell: bash
94+
run: |
95+
PIP_INSTALL="/opt/conda/envs/build/bin/python3 -m pip install"
96+
${PIP_INSTALL} ./dist/*.whl || ${PIP_INSTALL} ./dist/*.whl --break-system-packages
97+
cd /tmp
98+
/opt/conda/envs/build/bin/python3 -c "import flux, _flux._core, _flux._hostlist, _flux._idset; print(flux.__file__)"
99+
100+
- name: Upload Artifacts
73101
if: success()
74102
uses: actions/upload-artifact@v4
75103
with:
@@ -78,7 +106,8 @@ jobs:
78106

79107
upload:
80108
runs-on: ubuntu-latest
81-
needs: [build-manual]
109+
needs: [build]
110+
if: (github.event_name == 'workflow_dispatch')
82111
steps:
83112
- name: Download Artifacts
84113
uses: actions/download-artifact@v4
@@ -97,7 +126,6 @@ jobs:
97126
ls ./dist
98127
99128
- name: Build and publish
100-
if: (github.event_name != 'pull_request')
101129
env:
102130
TWINE_USERNAME: ${{ secrets.PYPI_USER }}
103131
TWINE_PASSWORD: ${{ secrets.PYPI_PASS }}

‎.github/workflows/test-build.yaml‎

Lines changed: 0 additions & 29 deletions
This file was deleted.

‎docker/build-wheels.sh‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
here=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
44
build_number=${1:-0}
55
version=${2:-3.11}
6+
glibc=${MANYLINUX_GLIBC:-2_17}
67

78
# This is intended to run in the container
89
echo "Building Python version ${version}"
@@ -14,5 +15,6 @@ export PYTHONPATH=/opt/conda/envs/build/lib/python${version}/site-packages
1415

1516
# Build the bindings for this python version!
1617
/opt/conda/envs/build/bin/python3 setup.py sdist
17-
/opt/conda/envs/build/bin/python3 setup.py bdist_wheel --plat-name=any --build-number=${build_number}
18+
arch=$(/opt/conda/envs/build/bin/python3 -c 'import sysconfig; print(sysconfig.get_platform().replace("-", "_").replace(".", "_").split("linux_", 1)[1])')
19+
/opt/conda/envs/build/bin/python3 setup.py bdist_wheel --plat-name=manylinux_${glibc}_${arch} --build-number=${build_number}
1820
unset PYTHONPATH

‎docker/install-mamba.sh‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ PYTHON_VERSION=${1:-3.11}
55
sudo apt-get update && sudo apt-get install -y curl
66

77
# Install mamba for different python versions
8-
# Python - instead of a system python we install mamba
98
curl -L https://github.com/conda-forge/miniforge/releases/download/24.3.0-0/Mambaforge-24.3.0-0-Linux-x86_64.sh > mambaforge.sh
109

1110
# Does not build 3.8
@@ -18,6 +17,7 @@ sudo /opt/conda/bin/mamba activate build
1817

1918
# This is intended to run in the container
2019
echo "Building Python version ${version}"
21-
/opt/conda/envs/build/bin/python3 -m pip install cffi ply six pyyaml jsonschema
20+
PIP_INSTALL="/opt/conda/envs/build/bin/python3 -m pip install"
21+
${PIP_INSTALL} cffi ply six pyyaml jsonschema || ${PIP_INSTALL} cffi ply six pyyaml jsonschema --break-system-packages
2222
sudo chown -R $(id -u) /opt/conda
23-
/opt/conda/envs/build/bin/python3 -m pip install --upgrade pkginfo
23+
${PIP_INSTALL} --upgrade pkginfo || ${PIP_INSTALL} --upgrade pkginfo --break-system-packages

0 commit comments

Comments
 (0)