packaging: add missing ply #202
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: build flux-python | |
| on: | |
| pull_request: {} | |
| workflow_dispatch: | |
| inputs: | |
| version: | |
| description: 'Pypi version' | |
| release_version: | |
| description: 'Version of flux to build' | |
| default: "0.88.0" | |
| rc: | |
| description: 'Release candidate to build (for wheel)' | |
| default: "0" | |
| branch: | |
| description: 'Branch or tag to build from (defaults to v<release_version>)' | |
| default: "" | |
| 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: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| 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:${{ matrix.base }} | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - name: Setup Python | |
| env: | |
| python_version: ${{ matrix.python }} | |
| # Installs to /opt/conda/envs/build/bin/python3 | |
| run: /bin/bash ./docker/install-mamba.sh ${python_version} | |
| - name: Build Flux Core Branch | |
| env: | |
| 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 | |
| env: | |
| FLUX_BRANCH: ${{ inputs.branch }} | |
| FLUX_REPO: ${{ inputs.repo }} | |
| FLUX_RELEASE_VERSION: ${{ inputs.release_version || '0.88.0' }} | |
| shell: bash | |
| run: | | |
| if [[ "${FLUX_REPO}" == "" ]]; then | |
| FLUX_REPO="https://github.com/flux-framework/flux-core" | |
| fi | |
| # Match the bindings to the release that libflux was built from | |
| if [[ "${FLUX_BRANCH}" == "" ]]; then | |
| FLUX_BRANCH="v${FLUX_RELEASE_VERSION}" | |
| fi | |
| echo "Flux Repo: ${FLUX_REPO}" | |
| echo "Flux Branch: ${FLUX_BRANCH}" | |
| 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 | |
| - name: Build Python Wheels | |
| env: | |
| build_number: ${{ inputs.rc || '0' }} | |
| python_version: ${{ matrix.python }} | |
| MANYLINUX_GLIBC: ${{ inputs.glibc || '2_17' }} | |
| run: | | |
| /bin/bash ./docker/build-wheels.sh "${build_number}" "${python_version}" | |
| ls ./dist | |
| - name: Test Install | |
| shell: bash | |
| run: | | |
| # Use a clean environment so the build env cannot mask missing dependencies | |
| /opt/conda/envs/build/bin/python3 -m venv /tmp/test-env | |
| /tmp/test-env/bin/python3 -m pip install ./dist/*.whl | |
| cd /tmp | |
| /tmp/test-env/bin/python3 -c "import flux, flux.job, _flux._core, _flux._hostlist, _flux._idset; print(flux.__file__)" | |
| - name: Upload Artifacts | |
| if: success() | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: ${{ matrix.python }} | |
| path: ./dist | |
| upload: | |
| runs-on: ubuntu-latest | |
| needs: [build] | |
| steps: | |
| - name: Download Artifacts | |
| uses: actions/download-artifact@v8 | |
| # If name unspecified, all artifacts download for run | |
| - name: Show Files | |
| run: | | |
| ls */ | |
| # We just need one of these | |
| first_dir=$(ls . | head -n 1) | |
| mkdir -p ./dist | |
| mv */*.whl ./dist/ | |
| cp ${first_dir}/*.tar.gz ./dist/ | |
| echo | |
| echo "Files to distribute:" | |
| ls ./dist | |
| - name: Check distributions | |
| run: | | |
| python3 -m pip install setuptools wheel twine | |
| twine check --strict dist/* | |
| - name: Test upload | |
| if: (github.event_name != 'workflow_dispatch') | |
| env: | |
| TWINE_USERNAME: __token__ | |
| TWINE_PASSWORD: ${{ secrets.TEST_PYPI_TOKEN }} | |
| run: twine upload --verbose --repository testpypi --skip-existing dist/flux_python* | |
| - name: Build and publish | |
| if: (github.event_name == 'workflow_dispatch') | |
| env: | |
| TWINE_USERNAME: ${{ secrets.PYPI_USER }} | |
| TWINE_PASSWORD: ${{ secrets.PYPI_PASS }} | |
| run: twine upload --verbose --skip-existing dist/flux_python* |