diff --git a/.github/workflows/build-release.yaml b/.github/workflows/build-release.yaml index 4aea67f..4a695c5 100644 --- a/.github/workflows/build-release.yaml +++ b/.github/workflows/build-release.yaml @@ -82,11 +82,11 @@ jobs: - name: Build Python Wheels env: - build_number: ${{ inputs.rc }} + 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} + /bin/bash ./docker/build-wheels.sh "${build_number}" "${python_version}" ls ./dist - name: Test Install @@ -107,7 +107,6 @@ jobs: upload: runs-on: ubuntu-latest needs: [build] - if: (github.event_name == 'workflow_dispatch') steps: - name: Download Artifacts uses: actions/download-artifact@v8 @@ -125,13 +124,21 @@ jobs: 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: | - ls dist/ - python3 -m pip install setuptools wheel - python3 -m pip install twine==6.0.1 - python3 -m pip install --upgrade pkginfo - twine upload --skip-existing dist/flux_python* + run: twine upload --verbose --skip-existing dist/flux_python* diff --git a/README.md b/README.md index 17f1874..82e3120 100644 --- a/README.md +++ b/README.md @@ -2,12 +2,10 @@ > 🐍️ You called me? -Hello! You've found the flux Python bindings, an experiment to build and deploy -Flux to Pypi without needing to store code alongside Flux. The goal of -this experiment is to test them separately. This was originally developed +Hello! You've found the flux Python bindings to build and deploy +Flux to Pypi without needing to store code alongside Flux. This was originally developed at [vsoch/flux-python](https://github.com/vsoch/flux-python) and has -been ported here to automate more officially. The following guides might be useful -to you: +been ported here to automate more officially. The following guides might be useful to you: - ⭐️ [Flux Framework Documentation](https://flux-framework.readthedocs.io) - ⭐️ [Flux Projects](https://flux-framework.org) @@ -17,7 +15,7 @@ to you: ## Helper Install -If you don't want to figure out your flux version and install with pip directory (per instructions in [manual install](#manual-install)) +If you need to install on a system without Flux, please [target a wheel](https://pypi.org/project/flux-python/#files) (`.whl`) file directly that matches the version of Flux you intend to use it with. A vanilla `pip install` will try to compile from source, which requires Flux. If you don't want to figure out your flux version and install with pip directory (per instructions in [manual install](#manual-install)) we provide a helper script [install-flux-python.sh](script/install-flux-python.sh) that will: 1. Determine that Flux and Python are installed with pip diff --git a/docker/build-wheels.sh b/docker/build-wheels.sh index 4fa58e7..2cf7727 100755 --- a/docker/build-wheels.sh +++ b/docker/build-wheels.sh @@ -7,6 +7,7 @@ glibc=${MANYLINUX_GLIBC:-2_17} # This is intended to run in the container echo "Building Python version ${version}" +echo "Build number ${build_number}" export PATH=/opt/conda/envs/build/bin:$PATH export PYTHONPATH=/opt/conda/envs/build/lib/python${version}/site-packages