Skip to content

Commit 543d19d

Browse files
committed
fix for changes in pip's handling of build constraints
1 parent 0602c90 commit 543d19d

File tree

2 files changed

+25
-9
lines changed

2 files changed

+25
-9
lines changed

ci/build_wheel.sh

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22

3-
# SPDX-FileCopyrightText: Copyright (c) 2023-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
3+
# SPDX-FileCopyrightText: Copyright (c) 2023-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
44
# SPDX-License-Identifier: Apache-2.0
55

66
set -euo pipefail
@@ -21,12 +21,28 @@ sccache --zero-stats
2121

2222
rapids-logger "Building '${package_name}' wheel"
2323

24+
RAPIDS_PIP_WHEEL_ARGS=(
25+
-w dist
26+
-v
27+
--no-deps
28+
--disable-pip-version-check
29+
--extra-index-url=https://pypi.nvidia.com
30+
)
31+
32+
# Only use --build-constraint when build isolation is enabled.
33+
#
34+
# Passing '--build-constraint' and '--no-build-isolation` together results in an error from 'pip',
35+
# but we want to keep environment variable PIP_CONSTRAINT set unconditionally.
36+
# PIP_NO_BUILD_ISOLATION=0 means "add --no-build-isolation" (ref: https://github.com/pypa/pip/issues/573
37+
if [[ "${PIP_NO_BUILD_ISOLATION:-}" != "0" ]]; then
38+
RAPIDS_PIP_WHEEL_ARGS+=(--build-constraint="${PIP_CONSTRAINT}")
39+
fi
40+
41+
# unset PIP_CONSTRAINT (set by rapids-init-pip)... it doesn't affect builds as of pip 25.3, and
42+
# results in an error from 'pip wheel' when set and --build-constraint is also passed
43+
unset PIP_CONSTRAINT
2444
rapids-pip-retry wheel \
25-
-w dist \
26-
-v \
27-
--no-deps \
28-
--disable-pip-version-check \
29-
--extra-index-url=https://pypi.nvidia.com \
45+
"${RAPIDS_PIP_WHEEL_ARGS[@]}" \
3046
.
3147

3248
sccache --show-adv-stats

ci/build_wheel_cuopt.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22

3-
# SPDX-FileCopyrightText: Copyright (c) 2023-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
3+
# SPDX-FileCopyrightText: Copyright (c) 2023-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
44
# SPDX-License-Identifier: Apache-2.0
55

66

@@ -24,8 +24,8 @@ RAPIDS_PY_CUDA_SUFFIX="$(rapids-wheel-ctk-name-gen "${RAPIDS_CUDA_VERSION}")"
2424
# Download the libcuopt and cuopt-mps-parser wheel built in the previous step and make it
2525
# available for pip to find.
2626
#
27-
# Using env variable PIP_CONSTRAINT (initialized by 'rapids-init-pip') is necessary to ensure the constraints
28-
# are used when creating the isolated build environment.
27+
# env variable 'PIP_CONSTRAINT' is set up by rapids-init-pip. It constrains all subsequent
28+
# 'pip install', 'pip download', etc. calls (except those used in 'pip wheel', handled separately in build scripts)
2929
RAPIDS_PY_CUDA_SUFFIX="$(rapids-wheel-ctk-name-gen "${RAPIDS_CUDA_VERSION}")"
3030
CUOPT_MPS_PARSER_WHEELHOUSE=$(RAPIDS_PY_WHEEL_NAME="cuopt_mps_parser" rapids-download-wheels-from-github python)
3131
LIBCUOPT_WHEELHOUSE=$(RAPIDS_PY_WHEEL_NAME="libcuopt_${RAPIDS_PY_CUDA_SUFFIX}" rapids-download-wheels-from-github cpp)

0 commit comments

Comments
 (0)