Use pathlib in cuda.bindings build hooks and tests (part 6 of #2410) - #2501
Open
LeSingh1 wants to merge 1 commit into
Open
Use pathlib in cuda.bindings build hooks and tests (part 6 of #2410)#2501LeSingh1 wants to merge 1 commit into
LeSingh1 wants to merge 1 commit into
Conversation
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.
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part 6 of #2410, and the last of the series.
Replaces
os.path/os.sepwithpathlib.Pathincuda_bindings/build_hooks.pyand 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 staystr; only the path construction moves to pathlib.As in part 5,
glob.globis 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 39cuda.bindingsmodule names and basenames, and identical include/library dir lists.One cosmetic note: the
test_examples.pyparametrize IDs change from.../tests/../examples/foo.pyto.../examples/foo.py. Same file set — I greppedci/,.github/,scripts/andtoolshed/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 plusruff check,ruff format --checkandpy_compilerather than by a test run;cuda_core/tests/test_build_hooks.pystill passes 14/14 on Linux CI.NOTE: developed with the assistance of an AI coding agent. I reviewed and verified the change before submitting.