Skip to content

Commit 0f17413

Browse files
committed
ci: move wheelbuilding config out of ci
1 parent 95ffffe commit 0f17413

File tree

3 files changed

+27
-17
lines changed

3 files changed

+27
-17
lines changed

.github/workflows/build-wheel.yml

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -110,12 +110,6 @@ jobs:
110110
uses: pypa/cibuildwheel@c923d83ad9c1bc00211c5041d0c3f73294ff88f6 # v3.1.4
111111
env:
112112
CIBW_BUILD: ${{ env.CIBW_BUILD }}
113-
CIBW_ARCHS_LINUX: "native"
114-
CIBW_BUILD_VERBOSITY: 1
115-
CIBW_BEFORE_BUILD_WINDOWS: "pip install delvewheel"
116-
CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: "delvewheel repair --namespace-pkg cuda -w {dest_dir} {wheel}"
117-
CIBW_ENVIRONMENT: >
118-
CUDA_PYTHON_PARALLEL_LEVEL=${{ env.CUDA_PYTHON_PARALLEL_LEVEL }}
119113
with:
120114
package-dir: ./cuda_core/
121115
output-dir: ${{ env.CUDA_CORE_ARTIFACTS_DIR }}
@@ -152,17 +146,6 @@ jobs:
152146
uses: pypa/cibuildwheel@c923d83ad9c1bc00211c5041d0c3f73294ff88f6 # v3.1.4
153147
env:
154148
CIBW_BUILD: ${{ env.CIBW_BUILD }}
155-
CIBW_ARCHS_LINUX: "native"
156-
CIBW_BUILD_VERBOSITY: 1
157-
# CIBW mounts the host filesystem under /host
158-
CIBW_ENVIRONMENT_LINUX: >
159-
CUDA_PATH=/host/${{ env.CUDA_PATH }}
160-
CUDA_PYTHON_PARALLEL_LEVEL=${{ env.CUDA_PYTHON_PARALLEL_LEVEL }}
161-
CIBW_ENVIRONMENT_WINDOWS: >
162-
CUDA_HOME="$(cygpath -w ${{ env.CUDA_PATH }})"
163-
CUDA_PYTHON_PARALLEL_LEVEL=${{ env.CUDA_PYTHON_PARALLEL_LEVEL }}
164-
CIBW_BEFORE_BUILD_WINDOWS: "pip install delvewheel"
165-
CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: "delvewheel repair --namespace-pkg cuda -w {dest_dir} {wheel}"
166149
with:
167150
package-dir: ./cuda_bindings/
168151
output-dir: ${{ env.CUDA_BINDINGS_ARTIFACTS_DIR }}

cuda_bindings/pyproject.toml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,3 +110,18 @@ exclude = ["cuda/bindings/_version.py"]
110110
"UP022",
111111
"E402", # module level import not at top of file
112112
"F841"] # F841 complains about unused variables, but some assignments have side-effects that could be useful for tests (func calls for example)
113+
114+
[tool.cibuildwheel]
115+
enable = "cpython-freethreading"
116+
build-verbosity = 1
117+
environment-pass = ["CUDA_PYTHON_PARALLEL_LEVEL"]
118+
119+
[tool.cibuildwheel.linux]
120+
archs = "native"
121+
# CIBW mounts the host filesystem under /host
122+
environment = { CUDA_PATH = "/host/$CUDA_PATH" }
123+
124+
[tool.cibuildwheel.windows]
125+
before-build = "pip install delvewheel"
126+
repair-wheel-command = "delvewheel repair --namespace-pkg cuda -w {dest_dir} {wheel}"
127+
environment = { CUDA_HOME = "$(cygpath -w $CUDA_PATH)" }

cuda_core/pyproject.toml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,3 +108,15 @@ exclude = ["cuda/core/_version.py"]
108108
[tool.ruff.lint.per-file-ignores]
109109
"__init__.py" = ["F401"]
110110
"setup.py" = ["F401"]
111+
112+
[tool.cibuildwheel]
113+
enable = "cpython-freethreading"
114+
build-verbosity = 1
115+
environment-pass = ["CUDA_PYTHON_PARALLEL_LEVEL"]
116+
117+
[tool.cibuildwheel.linux]
118+
archs = "native"
119+
120+
[tool.cibuildwheel.windows]
121+
before-build = "pip install delvewheel"
122+
repair-wheel-command = "delvewheel repair --namespace-pkg cuda -w {dest_dir} {wheel}"

0 commit comments

Comments
 (0)