Skip to content

Commit f01b451

Browse files
committed
add cuda-python pure Python wheel
1 parent 66739e1 commit f01b451

File tree

6 files changed

+108
-2
lines changed

6 files changed

+108
-2
lines changed

.github/workflows/build-and-test.yml

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,35 @@ jobs:
132132
name: ${{ env.CUDA_BINDINGS_ARTIFACT_NAME }}
133133
path: ${{ env.CUDA_BINDINGS_ARTIFACTS_DIR }}/*.whl
134134
if-no-files-found: error
135-
overwrite: 'true'
135+
136+
# upload-artifact's "overwrite: true" option has a race condition among parallel
137+
# jobs, so we let job 0 do the work
138+
- name: Build and check cuda-python wheel
139+
if: ${{ strategy.job-index == 0 }}
140+
run: |
141+
pushd cuda_python
142+
pip wheel -v --no-deps .
143+
twine check *.whl
144+
popd
145+
146+
- name: List the cuda-python artifacts directory
147+
if: ${{ strategy.job-index == 0 }}
148+
run: |
149+
if [[ "${{ matrix.host-platform }}" == win* ]]; then
150+
export CHOWN=chown
151+
else
152+
export CHOWN="sudo chown"
153+
fi
154+
$CHOWN -R $(whoami) cuda_python/*.whl
155+
ls -lahR cuda_python
156+
157+
- name: Upload cuda-python build artifacts
158+
if: ${{ strategy.job-index == 0 }}
159+
uses: actions/upload-artifact@v4
160+
with:
161+
name: cuda-python-wheel
162+
path: cuda_python/*.whl
163+
if-no-files-found: error
136164

137165
- name: Pass environment variables to the next runner
138166
id: pass_env
@@ -221,6 +249,17 @@ jobs:
221249
echo "CUDA_BINDINGS_ARTIFACTS_DIR=$(realpath "$REPO_DIR/cuda_bindings/dist")" >> $GITHUB_ENV
222250
echo "SKIP_CUDA_BINDINGS_TEST=${SKIP_CUDA_BINDINGS_TEST}" >> $GITHUB_ENV
223251
252+
- name: Download cuda-python build artifacts
253+
uses: actions/download-artifact@v4
254+
with:
255+
name: cuda-python-wheel
256+
path: .
257+
258+
- name: Display structure of downloaded cuda-python artifacts
259+
run: |
260+
pwd
261+
ls -lahR .
262+
224263
- name: Download cuda.bindings build artifacts
225264
uses: actions/download-artifact@v4
226265
with:
@@ -280,6 +319,10 @@ jobs:
280319
fi
281320
popd
282321
322+
- name: Ensure cuda-python installable
323+
run: |
324+
pip install cuda_python*.whl
325+
283326
checks:
284327
name: Check job status
285328
permissions:

cuda_bindings/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ requires = ["setuptools", "cython", "pyclibrary"]
1111
build-backend = "setuptools.build_meta"
1212

1313
[project]
14-
name = "cuda-python"
14+
name = "cuda-bindings"
1515
description = "Python bindings for CUDA"
1616
authors = [{name = "NVIDIA Corporation", email = "[email protected]"},]
1717
license = {file = "LICENSE"}

cuda_python/LICENSE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../LICENSE

cuda_python/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../README.md

cuda_python/pyproject.toml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Copyright 2023-2025 NVIDIA Corporation. All rights reserved.
2+
#
3+
# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE
4+
5+
[build-system]
6+
requires = ["setuptools",]
7+
build-backend = "setuptools.build_meta"
8+
9+
[project]
10+
name = "cuda-python"
11+
description = "CUDA Python: Performance meets Productivity"
12+
readme = {file = "README.md", content-type = "text/markdown"}
13+
authors = [{name = "NVIDIA Corporation", email = "[email protected]"},]
14+
license = {file = "LICENSE"}
15+
classifiers = [
16+
"Operating System :: POSIX :: Linux",
17+
"Operating System :: Microsoft :: Windows",
18+
"Topic :: Software Development :: Libraries",
19+
"Topic :: Education",
20+
"Topic :: Scientific/Engineering",
21+
"Intended Audience :: Developers",
22+
"Intended Audience :: Science/Research",
23+
"Intended Audience :: End Users/Desktop",
24+
"License :: Other/Proprietary License",
25+
"Programming Language :: Python :: 3 :: Only",
26+
"Programming Language :: Python :: 3.9",
27+
"Programming Language :: Python :: 3.10",
28+
"Programming Language :: Python :: 3.11",
29+
"Programming Language :: Python :: 3.12",
30+
"Programming Language :: Python :: 3.13",
31+
"Programming Language :: Python :: Implementation :: CPython",
32+
"Environment :: GPU :: NVIDIA CUDA",
33+
"Environment :: GPU :: NVIDIA CUDA :: 12",
34+
]
35+
dynamic = ["version", "dependencies"]
36+
37+
[project.urls]
38+
homepage = "https://nvidia.github.io/cuda-python/"
39+
documentation = "https://nvidia.github.io/cuda-python/"
40+
repository = "https://github.com/NVIDIA/cuda-python/"
41+
issues = "https://github.com/NVIDIA/cuda-python/issues/"

cuda_python/setup.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Copyright (c) 2025, NVIDIA CORPORATION & AFFILIATES. ALL RIGHTS RESERVED.
2+
#
3+
# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE
4+
5+
from setuptools import setup
6+
7+
# We want to keep the version in sync with cuda.bindings, but setuptools would not let
8+
# us to refer to any files outside of the project root, so we have to employ our own
9+
# run-time lookup using setup()...
10+
with open("../cuda_bindings/cuda/bindings/_version.py") as f:
11+
exec(f.read())
12+
version = __version__ # noqa: F821
13+
del __version__ # noqa: F821
14+
15+
setup(
16+
version=version,
17+
install_requires=[
18+
f"cuda-bindings~={version}",
19+
],
20+
)

0 commit comments

Comments
 (0)