Skip to content

Add isolated load_library() smoke tests for library wheels #307

Description

@bdice

Add isolated load_library() smoke tests for library wheels

Description

RAPIDS wheel test jobs can install a library wheel together with its high-level wheel and test extras. Those additional packages can satisfy runtime dependencies that are missing from the library wheel's metadata, so the test suite passes even though a user installing only the library wheel cannot load its shared library.

For example, rapidsai/kvikio#1013 tests libkvikio in an isolated virtual environment:

python -m venv libkvikio-env
. libkvikio-env/bin/activate
rapids-pip-retry install --prefer-binary --constraint "${PIP_CONSTRAINT}" \
  "${LIBKVIKIO_WHEELHOUSE}"/libkvikio_"${RAPIDS_PY_CUDA_SUFFIX}"*.whl
python -c "import libkvikio; libkvikio.load_library()"
deactivate

We should roll this pattern out to every library wheel that exposes load_library(). The smoke test must run before installing the high-level wheel or test extras.

Benefits

  • Detects missing shared-library runtime dependencies from the library wheel alone.
  • Exercises the same load path users take when installing a library wheel directly.
  • Keeps the existing full wheel test suite focused on functional testing.

Acceptance Criteria

  • Each repository runs its wheel test script through rapidsai/shared-workflows/.github/workflows/wheels-test.yaml. We only modify the script that is called in that workflow.
  • Each library wheel exposing load_library() is installed in a fresh virtual environment with the generated test constraints and without test extras.
  • The smoke test imports the library package and calls its load_library() entry point.
  • The existing high-level-wheel installation and test suite do not use the smoke-test environment.
  • The smoke test runs for every supported CUDA wheel variant in the existing wheel-test matrix.

Approach

For each repository below:

  1. Add the wheels-test.yaml reusable workflow job if the repository does not already invoke it.
  2. In the wheel test script, create and activate a virtual environment before the existing package and test-extra installation.
  3. Install only the library wheel, using the existing generated constraints and wheel-selection convention.
  4. Run python -c "import <library-package>; <library-package>.load_library()".
  5. Deactivate the environment, then continue the existing wheel tests in their own environment.

Tracking

The following repositories expose a Python load_library() API.

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