Skip to content

Commit cea934b

Browse files
committed
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.
1 parent 506ec1a commit cea934b

File tree

4 files changed

+22
-9
lines changed

4 files changed

+22
-9
lines changed

.github/workflows/wheels-build.yaml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,12 +161,19 @@ jobs:
161161
GH_TOKEN: ${{ github.token }}
162162
# Use a shell that loads the rc file so that we get the compiler settings
163163
shell: bash -leo pipefail {0}
164+
- name: Upload sdist
165+
if: "!cancelled()"
166+
uses: actions/upload-artifact@v4
167+
with:
168+
name: sdist
169+
path: ${{ env.sdist_path }}
164170
- name: Upload wheel
165171
if: "!cancelled()"
166172
uses: actions/upload-artifact@v4
167173
with:
168174
name: wheel
169-
path: ${{ env.package_path }}
175+
path: ${{ env.wheel_path }}
176+
170177
- name: Publish wheel
171178
if: inputs.upload_to_pypi
172179
uses: pypa/gh-action-pypi-publish@release/v1

ci/build_wheel.sh

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,16 @@
33

44
set -euo pipefail
55

6-
rapids-logger "Build wheel"
7-
mkdir -p ./dist
8-
python -m pip wheel . --wheel-dir=./dist -vvv --disable-pip-version-check --no-deps
6+
rapids-logger "Install build package"
7+
python -m pip install build
98

10-
package_path=$(realpath ./dist/numba_cuda-*.whl)
11-
echo "Package path: $package_path"
12-
echo "package_path=$package_path" >> $GITHUB_ENV
9+
rapids-logger "Build sdist and wheel"
10+
python -m build .
11+
12+
wheel_path=$(realpath ./dist/numba_cuda-*.whl)
13+
echo "Wheel path: $wheel_path"
14+
echo "wheel_path=$wheel_path" >> $GITHUB_ENV
15+
16+
sdist_path=$(realpath ./dist/numba_cuda-*.tar.gz)
17+
echo "ssdist path: $sdist_path"
18+
echo "sdist_path=$sdist_path" >> $GITHUB_ENV

ci/test_wheel.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ python -m pip install \
1212

1313
rapids-logger "Install wheel"
1414
package=$(realpath wheel/numba_cuda*.whl)
15-
echo "Package path: $package"
15+
echo "Wheel path: $package"
1616
python -m pip install $package
1717

1818
rapids-logger "Check GPU usage"

numba_cuda/VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.0.14
1+
0.0.15

0 commit comments

Comments
 (0)