Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,56 @@ jobs:
with:
docs-projects: cudf,dask-cudf,libcudf
dry-run: false
cudf-polars-quent-build-matrix:
uses: rapidsai/shared-workflows/.github/workflows/compute-matrix.yaml@main
with:
build_type: ${{ inputs.build_type || 'branch' }}
matrix_name: conda-python-build
# abi3-py312 wheels only need one build per architecture/platform.
matrix_filter: 'map(select(.PY_VER == "3.12" and .CUDA_VER == "12.9.2"))'
cudf-polars-quent:
needs: [build-details, telemetry-setup, cudf-polars-quent-build-matrix]
permissions:
actions: read
contents: read
id-token: write
packages: read
pull-requests: read
secrets: inherit # zizmor: ignore[secrets-inherit]
uses: rapidsai/shared-workflows/.github/workflows/custom-job.yaml@main
strategy:
fail-fast: false
matrix: ${{ fromJSON(needs.cudf-polars-quent-build-matrix.outputs.matrix) }}
with:
build_type: ${{ inputs.build_type || 'branch' }}
branch: ${{ inputs.branch }}
build-datetime: ${{ needs.build-details.outputs.build-datetime }}
date: ${{ inputs.date }}
sha: ${{ inputs.sha }}
node_type: cpu8
arch: ${{ matrix.ARCH }}
container_image: "rapidsai/ci-conda:26.12-cuda${{ matrix.CUDA_VER }}-${{ matrix.LINUX_VER }}-py${{ matrix.PY_VER }}"
script: "ci/test_cudf_polars_quent.sh"
file_to_upload: "python/cudf_polars/quent/bridge/target/wheels/*.whl"
artifact-name: "cudf_wheel_python_cudf-polars-quent_${{ matrix.ARCH == 'amd64' && 'x86_64' || 'aarch64' }}_abi3"
wheel-publish-cudf-polars-quent:
needs: cudf-polars-quent
permissions:
actions: read
contents: read
id-token: write
packages: read
pull-requests: read
secrets: inherit # zizmor: ignore[secrets-inherit]
uses: rapidsai/shared-workflows/.github/workflows/wheels-publish.yaml@main
with:
build_type: ${{ inputs.build_type || 'branch' }}
branch: ${{ inputs.branch }}
sha: ${{ inputs.sha }}
date: ${{ inputs.date }}
package-name: cudf_polars_quent
package-type: python
publish-wheel-search-key: cudf_wheel_python_cudf-polars-quent
wheel-build:
needs: [build-details, telemetry-setup]
permissions:
Expand Down Expand Up @@ -396,6 +446,7 @@ jobs:
- upload-conda
- wheel-publish-cudf
- wheel-publish-cudf-polars
- wheel-publish-cudf-polars-quent
- wheel-publish-dask-cudf
- wheel-publish-libcudf
- wheel-publish-pylibcudf
Expand Down
19 changes: 15 additions & 4 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -323,13 +323,22 @@ jobs:
pull-requests: read
secrets: inherit # zizmor: ignore[secrets-inherit]
uses: rapidsai/shared-workflows/.github/workflows/custom-job.yaml@main
if: fromJSON(needs.changed-files.outputs.changed_file_groups).test_cudf_polars_quent
if: >
fromJSON(needs.changed-files.outputs.changed_file_groups).cpp_build_inputs ||
fromJSON(needs.changed-files.outputs.changed_file_groups).test_python_all ||
fromJSON(needs.changed-files.outputs.changed_file_groups).test_python_cudf_polars ||
fromJSON(needs.changed-files.outputs.changed_file_groups).test_python_wheels ||
fromJSON(needs.changed-files.outputs.changed_file_groups).test_python_wheel_cudf_polars ||
fromJSON(needs.changed-files.outputs.changed_file_groups).test_python_cudf_polars_runner ||
fromJSON(needs.changed-files.outputs.changed_file_groups).test_cudf_polars_quent
with:
build_type: pull-request
node_type: cpu8
arch: "amd64"
container_image: "rapidsai/ci-conda:26.12-latest"
container_image: "rapidsai/ci-conda:26.12-cuda12.9.2-rockylinux8-py3.12"
script: "ci/test_cudf_polars_quent.sh"
file_to_upload: "python/cudf_polars/quent/bridge/target/wheels/*.whl"
artifact-name: "cudf_wheel_python_cudf-polars-quent_x86_64_abi3"
cpp-linters:
permissions:
actions: read
Expand Down Expand Up @@ -768,7 +777,8 @@ jobs:
# https://github.com/NVIDIA/cudf/issues/23498
matrix_filter: map(select(.GPU != "gb300" and .GPU != "gh200"))
wheel-tests-cudf-polars:
needs: [wheel-build, wheel-python-build-noarch, changed-files]
needs:
[wheel-build, wheel-python-build-noarch, cudf-polars-quent, changed-files]
permissions:
actions: read
contents: read
Expand All @@ -783,7 +793,8 @@ jobs:
fromJSON(needs.changed-files.outputs.changed_file_groups).test_python_cudf_polars ||
fromJSON(needs.changed-files.outputs.changed_file_groups).test_python_wheels ||
fromJSON(needs.changed-files.outputs.changed_file_groups).test_python_wheel_cudf_polars ||
fromJSON(needs.changed-files.outputs.changed_file_groups).test_python_cudf_polars_runner
fromJSON(needs.changed-files.outputs.changed_file_groups).test_python_cudf_polars_runner ||
fromJSON(needs.changed-files.outputs.changed_file_groups).test_cudf_polars_quent
with:
# This selects "ARCH=amd64 + the latest supported Python + CUDA".
matrix_filter: map(select(.ARCH == "amd64")) | group_by(.CUDA_VER|split(".")|map(tonumber)|.[0]) | map(max_by([(.PY_VER|split(".")|map(tonumber)), (.CUDA_VER|split(".")|map(tonumber))]))
Expand Down
3 changes: 2 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,8 @@ repos:
RAPIDS_BRANCH$|
[.](md|rst|avro|parquet|png|orc|gz|pkl|sas7bdat)$|
^python/cudf/cudf/tests|
^python/cudf/cudf/VERSION$
^python/cudf/cudf/VERSION$|
^python/cudf_polars/quent/bridge/Cargo[.]lock$
- id: verify-pyproject-license
# ignore the top-level pyproject.toml, which doesn't
# have or need a [project] table
Expand Down
26 changes: 25 additions & 1 deletion ci/run_cudf_polars_quent_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,38 @@ set -euo pipefail
cd "$(dirname "$(realpath "${BASH_SOURCE[0]}")")"/../

BRIDGE_DIR="${PWD}/python/cudf_polars/quent/bridge"
CI_UTILS_DIR="${PWD}/ci/utils"
TRACKED_STUB="${BRIDGE_DIR}/cudf_polars_quent.pyi"
RAPIDS_PACKAGE_VERSION="$(<VERSION)"

python "${CI_UTILS_DIR}/set_pyproject_version.py" \
"${BRIDGE_DIR}/pyproject.toml" \
"${RAPIDS_PACKAGE_VERSION}"

pushd "${BRIDGE_DIR}"
cargo fmt --all -- --check
cargo clippy --locked --all-targets -- -D warnings
cargo check --locked
cargo clean -p cudf-polars-quent
python -m maturin build --locked
rm -f target/wheels/*.whl
python -m maturin build --release --locked

shopt -s nullglob
generated_wheels=(target/wheels/*.whl)
shopt -u nullglob
if ((${#generated_wheels[@]} != 1)); then
echo "Expected exactly one generated Quent wheel, found ${#generated_wheels[@]}" >&2
exit 1
fi
if [[ "$(basename "${generated_wheels[0]}")" != *-cp312-abi3-*.whl ]]; then
echo "Expected a cp312-abi3 wheel, found ${generated_wheels[0]}" >&2
exit 1
fi

python "${CI_UTILS_DIR}/validate_maturin_wheel.py" \
"${generated_wheels[0]}" \
"${RAPIDS_PACKAGE_VERSION}" \
Cargo.toml

shopt -s nullglob
generated_stubs=(target/*/build/cudf-polars-quent-*/out/cudf_polars_quent.pyi)
Expand Down
2 changes: 2 additions & 0 deletions ci/test_cudf_polars_quent.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ set -euo pipefail
# Support invoking this script outside the repository root.
cd "$(dirname "$(realpath "${BASH_SOURCE[0]}")")"/../

rapids-generate-version > VERSION

rapids-logger "Create cudf-polars Quent test environment"
. /opt/conda/etc/profile.d/conda.sh

Expand Down
2 changes: 2 additions & 0 deletions ci/test_wheel_cudf_polars.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ RAPIDS_PY_CUDA_SUFFIX="$(rapids-wheel-ctk-name-gen "${RAPIDS_CUDA_VERSION}")"
LIBCUDF_WHEELHOUSE=$(rapids-download-from-github "$(rapids-artifact-name wheel_cpp libcudf cudf --cuda "$RAPIDS_CUDA_VERSION")")
PYLIBCUDF_WHEELHOUSE=$(rapids-download-from-github "$(rapids-artifact-name wheel_python pylibcudf cudf --stable --cuda "$RAPIDS_CUDA_VERSION")")
CUDF_POLARS_WHEELHOUSE=$(rapids-download-from-github "$(rapids-artifact-name wheel_python cudf-polars cudf --pure --arch any --cuda "$RAPIDS_CUDA_VERSION")")
CUDF_POLARS_QUENT_WHEELHOUSE=$(rapids-download-from-github "$(rapids-artifact-name wheel_python cudf-polars-quent cudf --stable)")

# Download libcudf_streaming and cudf_streaming built in the previous step
LIBCUDF_STREAMING_WHEELHOUSE=$(rapids-download-from-github "$(rapids-artifact-name wheel_cpp libcudf-streaming cudf --cuda "$RAPIDS_CUDA_VERSION")")
Expand Down Expand Up @@ -80,6 +81,7 @@ for version in "${VERSIONS[@]}"; do
"$(echo "${PYLIBCUDF_WHEELHOUSE}"/pylibcudf_"${RAPIDS_PY_CUDA_SUFFIX}"*.whl)" \
"$(echo "${LIBCUDF_STREAMING_WHEELHOUSE}"/libcudf_streaming_"${RAPIDS_PY_CUDA_SUFFIX}"*.whl)" \
"$(echo "${CUDF_STREAMING_WHEELHOUSE}"/cudf_streaming_"${RAPIDS_PY_CUDA_SUFFIX}"*.whl)" \
"$(echo "${CUDF_POLARS_QUENT_WHEELHOUSE}"/cudf_polars_quent-*-cp312-abi3-*.whl)" \
-r "polars-compat-${version}-requirements.txt"

rapids-logger "Running tests for polars ${version}.*"
Expand Down
30 changes: 30 additions & 0 deletions ci/utils/set_pyproject_version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0

import argparse
import re
from pathlib import Path

from packaging.version import Version


def main() -> None:
parser = argparse.ArgumentParser()
parser.add_argument("pyproject", type=Path)
parser.add_argument("version", type=Version)
args = parser.parse_args()

contents, replacements = re.subn(
r'^version = "[^"]+"$',
f'version = "{args.version}"',
args.pyproject.read_text(),
count=1,
flags=re.MULTILINE,
)
if replacements != 1:
raise RuntimeError(f"Expected one project version in {args.pyproject}")
args.pyproject.write_text(contents)


if __name__ == "__main__":
main()
58 changes: 58 additions & 0 deletions ci/utils/validate_maturin_wheel.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0

import argparse
import email
import tomllib
import zipfile
from pathlib import Path

from packaging.utils import parse_wheel_filename
from packaging.version import Version


def main() -> None:
parser = argparse.ArgumentParser()
parser.add_argument("wheel", type=Path)
parser.add_argument("expected_version", type=Version)
parser.add_argument("cargo_manifest", type=Path)
args = parser.parse_args()

_, filename_version, _, _ = parse_wheel_filename(args.wheel.name)
if filename_version != args.expected_version:
raise RuntimeError(
f"Wheel filename version {filename_version} does not match "
f"{args.expected_version}"
)

with zipfile.ZipFile(args.wheel) as archive:
metadata_files = [
name
for name in archive.namelist()
if name.endswith(".dist-info/METADATA")
]
if len(metadata_files) != 1:
raise RuntimeError(
f"Expected one METADATA file in {args.wheel}, "
f"found {len(metadata_files)}"
)
metadata = email.message_from_bytes(archive.read(metadata_files[0]))
metadata_version = Version(metadata["Version"])

if metadata_version != args.expected_version:
raise RuntimeError(
f"Wheel METADATA version {metadata_version} does not match "
f"{args.expected_version}"
)

with args.cargo_manifest.open("rb") as file:
cargo_version = Version(tomllib.load(file)["package"]["version"])
if cargo_version.release != args.expected_version.release:
raise RuntimeError(
f"Cargo release {cargo_version.release} does not match "
f"wheel release {args.expected_version.release}"
)


if __name__ == "__main__":
main()
1 change: 1 addition & 0 deletions dependencies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1293,6 +1293,7 @@ dependencies:
- output_types: conda
packages:
- maturin>=1.14,<2
- packaging
- rust=1.97
test_python_narwhals:
common:
Expand Down
2 changes: 1 addition & 1 deletion python/cudf_polars/quent/bridge/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion python/cudf_polars/quent/bridge/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

[package]
name = "cudf-polars-quent"
version = "0.1.0"
# rapids-pre-commit-hooks: disable-next-line
version = "26.12.0"
edition = "2024"
publish = false

Expand Down
3 changes: 2 additions & 1 deletion python/cudf_polars/quent/bridge/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ build-backend = "maturin"

[project]
name = "cudf-polars-quent"
version = "0.1.0"
# rapids-pre-commit-hooks: disable-next-line
version = "26.12.0"
requires-python = ">=3.12"
license = "Apache-2.0"

Expand Down
Loading