From aa362e1ea79e34fd48a75dc11f647522794ab70d Mon Sep 17 00:00:00 2001 From: vsoch Date: Tue, 25 Aug 2026 18:29:41 -0700 Subject: [PATCH] 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 --- .github/workflows/build-release.yaml | 54 +++++++++++++++++++++------- .github/workflows/test-build.yaml | 29 --------------- docker/build-wheels.sh | 4 ++- docker/install-mamba.sh | 6 ++-- 4 files changed, 47 insertions(+), 46 deletions(-) delete mode 100644 .github/workflows/test-build.yaml diff --git a/.github/workflows/build-release.yaml b/.github/workflows/build-release.yaml index c0c366a..4aea67f 100644 --- a/.github/workflows/build-release.yaml +++ b/.github/workflows/build-release.yaml @@ -8,7 +8,7 @@ on: description: 'Pypi version' release_version: description: 'Version of flux to build' - default: "0.68.0" + default: "0.88.0" rc: description: 'Release candidate to build (for wheel)' default: "0" @@ -18,18 +18,37 @@ on: repo: description: 'Repository to build from' default: "https://github.com/flux-framework/flux-core" + glibc: + description: 'Oldest glibc to support, as a manylinux tag version' + default: "2_17" jobs: - build-manual: + build: runs-on: ubuntu-latest strategy: fail-fast: false matrix: - python: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"] + include: + # Maybe time to stop supporting... + - python: "3.8" + base: jammy + - python: "3.9" + base: jammy + - python: "3.10" + base: jammy + - python: "3.11" + base: jammy + - python: "3.12" + base: jammy + - python: "3.13" + base: jammy + # Update to noble for 3.14 + - python: "3.14" + base: noble container: - image: fluxrm/testenv:jammy + image: fluxrm/testenv:${{ matrix.base }} steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v7 - name: Setup Python env: python_version: ${{ matrix.python }} @@ -38,8 +57,8 @@ jobs: - name: Build Flux Core Branch env: - FLUX_RELEASE_VERSION: ${{ inputs.release_version }} - FLUX_VERSION: ${{ inputs.version }} + FLUX_RELEASE_VERSION: ${{ inputs.release_version || '0.88.0' }} + FLUX_VERSION: ${{ inputs.version || inputs.release_version || '0.88.0' }} run: /bin/bash .github/scripts/setup.sh - name: Build Python Bindings @@ -56,7 +75,7 @@ jobs: if [[ "${FLUX_BRANCH}" == "" ]]; then FLUX_BRANCH="master" fi - git clone -b ${FLUX_BRANCH} ${FLUX_REPO} /tmp/flux-core + git clone -b ${FLUX_BRANCH} ${FLUX_REPO} /tmp/flux-core mv /tmp/flux-core/src/bindings/python/flux ./flux /opt/conda/envs/build/bin/python3 setup.py sdist sudo ldconfig @@ -65,23 +84,33 @@ jobs: env: build_number: ${{ inputs.rc }} python_version: ${{ matrix.python }} + MANYLINUX_GLIBC: ${{ inputs.glibc || '2_17' }} run: | /bin/bash ./docker/build-wheels.sh ${build_number} ${python_version} ls ./dist - - name: Upload distributions + - name: Test Install + shell: bash + run: | + PIP_INSTALL="/opt/conda/envs/build/bin/python3 -m pip install" + ${PIP_INSTALL} ./dist/*.whl || ${PIP_INSTALL} ./dist/*.whl --break-system-packages + cd /tmp + /opt/conda/envs/build/bin/python3 -c "import flux, _flux._core, _flux._hostlist, _flux._idset; print(flux.__file__)" + + - name: Upload Artifacts if: success() - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v7 with: name: ${{ matrix.python }} path: ./dist upload: runs-on: ubuntu-latest - needs: [build-manual] + needs: [build] + if: (github.event_name == 'workflow_dispatch') steps: - name: Download Artifacts - uses: actions/download-artifact@v4 + uses: actions/download-artifact@v8 # If name unspecified, all artifacts download for run - name: Show Files @@ -97,7 +126,6 @@ jobs: ls ./dist - name: Build and publish - if: (github.event_name != 'pull_request') env: TWINE_USERNAME: ${{ secrets.PYPI_USER }} TWINE_PASSWORD: ${{ secrets.PYPI_PASS }} diff --git a/.github/workflows/test-build.yaml b/.github/workflows/test-build.yaml deleted file mode 100644 index 19fc480..0000000 --- a/.github/workflows/test-build.yaml +++ /dev/null @@ -1,29 +0,0 @@ -name: test-build flux-python - -on: - pull_request: [] - schedule: - - cron: "5 4 * * *" - -jobs: - build: - runs-on: ubuntu-latest - container: - image: fluxrm/testenv:focal - steps: - - uses: actions/checkout@v3 - - - name: Build Flux Core - env: - FLUX_RELEASE_VERSION: "0.50.0" - run: /bin/bash .github/scripts/setup.sh - - - name: Build Python Bindings - run: | - mv /code/src/bindings/python/flux ./flux - python3 setup.py sdist - - - name: Build Python Wheels - run: | - /bin/bash ./docker/install-mamba.sh - /bin/bash ./docker/build-wheels.sh \ No newline at end of file diff --git a/docker/build-wheels.sh b/docker/build-wheels.sh index 6de1336..4fa58e7 100755 --- a/docker/build-wheels.sh +++ b/docker/build-wheels.sh @@ -3,6 +3,7 @@ here=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) build_number=${1:-0} version=${2:-3.11} +glibc=${MANYLINUX_GLIBC:-2_17} # This is intended to run in the container echo "Building Python version ${version}" @@ -14,5 +15,6 @@ export PYTHONPATH=/opt/conda/envs/build/lib/python${version}/site-packages # Build the bindings for this python version! /opt/conda/envs/build/bin/python3 setup.py sdist -/opt/conda/envs/build/bin/python3 setup.py bdist_wheel --plat-name=any --build-number=${build_number} +arch=$(/opt/conda/envs/build/bin/python3 -c 'import sysconfig; print(sysconfig.get_platform().replace("-", "_").replace(".", "_").split("linux_", 1)[1])') +/opt/conda/envs/build/bin/python3 setup.py bdist_wheel --plat-name=manylinux_${glibc}_${arch} --build-number=${build_number} unset PYTHONPATH diff --git a/docker/install-mamba.sh b/docker/install-mamba.sh index fc67b5d..4df6362 100755 --- a/docker/install-mamba.sh +++ b/docker/install-mamba.sh @@ -5,7 +5,6 @@ PYTHON_VERSION=${1:-3.11} sudo apt-get update && sudo apt-get install -y curl # Install mamba for different python versions -# Python - instead of a system python we install mamba 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 # Does not build 3.8 @@ -18,6 +17,7 @@ sudo /opt/conda/bin/mamba activate build # This is intended to run in the container echo "Building Python version ${version}" -/opt/conda/envs/build/bin/python3 -m pip install cffi ply six pyyaml jsonschema +PIP_INSTALL="/opt/conda/envs/build/bin/python3 -m pip install" +${PIP_INSTALL} cffi ply six pyyaml jsonschema || ${PIP_INSTALL} cffi ply six pyyaml jsonschema --break-system-packages sudo chown -R $(id -u) /opt/conda -/opt/conda/envs/build/bin/python3 -m pip install --upgrade pkginfo +${PIP_INSTALL} --upgrade pkginfo || ${PIP_INSTALL} --upgrade pkginfo --break-system-packages