Skip to content

wheel CI: adjust to pip deprecating the use of PIP_CONSTRAINT to affect build environments #242

@jameslamb

Description

@jameslamb

Description

I recently noticed warnings like this in some wheel-based CI jobs:

DEPRECATION: Setting PIP_CONSTRAINT will not affect build constraints in the future, pip 26.2 will enforce this behaviour change. A possible replacement is to specify build constraints using --build-constraint or PIP_BUILD_CONSTRAINT. To disable this warning without any build constraints set --use-feature=build-constraint or PIP_USE_FEATURE="build-constraint".

(example from rapidsai/cugraph)

Looks like that was introduced in pip around 5 months ago: pypa/pip#13534

When pip starts to enforce that, it'll cause issues for RAPIDS CI. We explicitly rely on PIP_CONSTRAINT to influence the isolated build environment, to ensure that downloaded CI artifacts are used. Like this:

# Download the libcuml wheel built in the previous step and make it
# available for pip to find.
#
# Using env variable PIP_CONSTRAINT (initialized by 'rapids-init-pip') is necessary to ensure the constraints
# are used when creating the isolated build environment.
LIBCUML_WHEELHOUSE=$(RAPIDS_PY_WHEEL_NAME="libcuml_${RAPIDS_PY_CUDA_SUFFIX}" rapids-download-wheels-from-github cpp)
echo "libcuml-${RAPIDS_PY_CUDA_SUFFIX} @ file://$(echo "${LIBCUML_WHEELHOUSE}"/libcuml_*.whl)" >> "${PIP_CONSTRAINT}"

./ci/build_wheel.sh "${package_name}" "${package_dir}"

(rapidsai/cuml - ci/build_wheel_cuml.sh)

We'll need to react to this to avoid CI being broken by newer versions of pip.

Benefits of this work

  • keeps wheels CI working

Acceptance Criteria

  • RAPIDS wheels CI works in a way that we're confident will not be broken when this deprecation is enforced

Approach

It looks like it should be possible to fix this in a way that's backwards-compatible with older pip versions, so we shouldn't need to worry too much about the specific version of pip in CI environments.

In rapids-init-pip (code link):

  • set environment variable PIP_BUILD_CONSTRAINT to point at the same file as PIP_CONSTRAINT
  • disable the warning with PIP_USE_FEATURE="build-constraint"

And then we should check for any other uses of PIP_CONSTRAINT in RAPIDS code (GitHub search):

  • references to PIP_CONSTRAINT should be updated where appropriate to include PIP_BUILD_CONSTRAINT
  • any other uses of that environment variable outside of rapids-init-pip should be adjusted accordingly

Task Tracking

Library repo updates

Other tasks

Notes

N/A

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions