Skip to content

Commit

Permalink
Build and upload sdist
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
gmarkall committed Sep 16, 2024
1 parent 506ec1a commit b809f3a
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 9 deletions.
9 changes: 8 additions & 1 deletion .github/workflows/wheels-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
18 changes: 12 additions & 6 deletions ci/build_wheel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion ci/test_wheel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion numba_cuda/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.0.14
0.0.15

0 comments on commit b809f3a

Please sign in to comment.