From b809f3ae65517c75d104a7e5089e9fbd3aab8e42 Mon Sep 17 00:00:00 2001 From: Graham Markall Date: Mon, 16 Sep 2024 10:38:50 +0100 Subject: [PATCH] Build and upload sdist Switching to using the `build` module from `pip` to build the sdist and to build the wheel from the sdist - this ensures that a wheel is buildable from the sdist. The use of the `wheel` module to build the wheel was inherited from other scripts in RAPIDS that were copied, and I don't think there was any reason to prefer it over the `build` module in the context of numba-cuda. CI scripts have been updated accordingly to also upload the sdist (so it can be inspected if necessary). The `gh-action-pypi-publish` step is unchanged as it is expected to pick up the sdist from the `dist/` directory. The version is bumped to 0.0.15 so that a new version with the sdist can be published to PyPI once it is merged and tagged. --- .github/workflows/wheels-build.yaml | 9 ++++++++- ci/build_wheel.sh | 18 ++++++++++++------ ci/test_wheel.sh | 2 +- numba_cuda/VERSION | 2 +- 4 files changed, 22 insertions(+), 9 deletions(-) diff --git a/.github/workflows/wheels-build.yaml b/.github/workflows/wheels-build.yaml index ee953ca..96581c5 100644 --- a/.github/workflows/wheels-build.yaml +++ b/.github/workflows/wheels-build.yaml @@ -161,12 +161,19 @@ jobs: GH_TOKEN: ${{ github.token }} # Use a shell that loads the rc file so that we get the compiler settings shell: bash -leo pipefail {0} + - name: Upload sdist + if: "!cancelled()" + uses: actions/upload-artifact@v4 + with: + name: sdist + path: ${{ env.sdist_path }} - name: Upload wheel if: "!cancelled()" uses: actions/upload-artifact@v4 with: name: wheel - path: ${{ env.package_path }} + path: ${{ env.wheel_path }} + - name: Publish wheel if: inputs.upload_to_pypi uses: pypa/gh-action-pypi-publish@release/v1 diff --git a/ci/build_wheel.sh b/ci/build_wheel.sh index 34930f1..837e1f9 100755 --- a/ci/build_wheel.sh +++ b/ci/build_wheel.sh @@ -3,10 +3,16 @@ set -euo pipefail -rapids-logger "Build wheel" -mkdir -p ./dist -python -m pip wheel . --wheel-dir=./dist -vvv --disable-pip-version-check --no-deps +rapids-logger "Install build package" +python -m pip install build -package_path=$(realpath ./dist/numba_cuda-*.whl) -echo "Package path: $package_path" -echo "package_path=$package_path" >> $GITHUB_ENV +rapids-logger "Build sdist and wheel" +python -m build . + +wheel_path=$(realpath ./dist/numba_cuda-*.whl) +echo "Wheel path: $wheel_path" +echo "wheel_path=$wheel_path" >> $GITHUB_ENV + +sdist_path=$(realpath ./dist/numba_cuda-*.tar.gz) +echo "ssdist path: $sdist_path" +echo "sdist_path=$sdist_path" >> $GITHUB_ENV diff --git a/ci/test_wheel.sh b/ci/test_wheel.sh index 5ffd014..20c7379 100755 --- a/ci/test_wheel.sh +++ b/ci/test_wheel.sh @@ -12,7 +12,7 @@ python -m pip install \ rapids-logger "Install wheel" package=$(realpath wheel/numba_cuda*.whl) -echo "Package path: $package" +echo "Wheel path: $package" python -m pip install $package rapids-logger "Check GPU usage" diff --git a/numba_cuda/VERSION b/numba_cuda/VERSION index 9789c4c..ceddfb2 100644 --- a/numba_cuda/VERSION +++ b/numba_cuda/VERSION @@ -1 +1 @@ -0.0.14 +0.0.15