Skip to content

Use pathlib in cuda.bindings build hooks and tests (part 6 of #2410) - #2501

Open
LeSingh1 wants to merge 1 commit into
NVIDIA:mainfrom
LeSingh1:pathlib/cuda-bindings-hooks
Open

Use pathlib in cuda.bindings build hooks and tests (part 6 of #2410)#2501
LeSingh1 wants to merge 1 commit into
NVIDIA:mainfrom
LeSingh1:pathlib/cuda-bindings-hooks

Conversation

@LeSingh1

@LeSingh1 LeSingh1 commented Aug 4, 2026

Copy link
Copy Markdown

Part 6 of #2410, and the last of the series.

Replaces os.path/os.sep with pathlib.Path in cuda_bindings/build_hooks.py and in the test modules that build paths to test data, the examples directory, and a reproducer's cwd.

Values handed to setuptools' Extension (include_dirs, library_dirs) and to the cuFile string parameters stay str; only the path construction moves to pathlib.

As in part 5, glob.glob is left alone and only the pattern construction moved, and I diffed the old and new extension-discovery logic against the real source tree on Linux — identical across all 39 cuda.bindings module names and basenames, and identical include/library dir lists.

One cosmetic note: the test_examples.py parametrize IDs change from .../tests/../examples/foo.py to .../examples/foo.py. Same file set — I grepped ci/, .github/, scripts/ and toolshed/ and nothing selects these tests by ID. Happy to preserve the literal .. if you would rather keep the IDs stable.

These files all need a GPU or a built cuda.bindings, so the changes are verified by inspection plus ruff check, ruff format --check and py_compile rather than by a test run; cuda_core/tests/test_build_hooks.py still passes 14/14 on Linux CI.

NOTE: developed with the assistance of an AI coding agent. I reviewed and verified the change before submitting.

Part of NVIDIA#2410. Replaces os.path/os.sep with pathlib.Path in
cuda_bindings/build_hooks.py and in the test modules that build paths
to the test data, the examples directory and the reproducer cwd.

Values handed to setuptools' Extension and to the cuFile string
parameters stay str; only the path construction moves to pathlib.
@copy-pr-bot

copy-pr-bot Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@github-actions github-actions Bot added the cuda.bindings Everything related to the cuda.bindings module label Aug 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cuda.bindings Everything related to the cuda.bindings module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant