You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
refactor(pathfinder): resolve_path returns a string - #3628
Reviewing files that changed from the base of the PR and between f47941a and 5fe686a.
You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.
Use the checkbox below for a quick retry:
Trigger review
No actionable comments were generated in the recent review.
Summary
Summary by CodeRabbit
Bug Fixes
Path resolution now returns resolved paths as strings, keeping path values consistent across file discovery and lookup operations.
resolve_path now returns a resolved path as a string. Callers no longer convert its result to a string, and the resolver tests now check string results.
resolve_path now returns the resolved absolute path as a string instead of a Path.
Caller and test updates cuda_pathfinder/cuda/pathfinder/_binaries/find_nvidia_binary_utility.py, cuda_pathfinder/cuda/pathfinder/_dynamic_libs/search_steps.py, cuda_pathfinder/cuda/pathfinder/_headers/find_nvidia_headers.py, cuda_pathfinder/cuda/pathfinder/_static_libs/locate_file.py, cuda_pathfinder/tests/test_utils_resolve_path.py
Path discovery callers pass through resolver results directly. Tests expect strings and convert the result to Path when checking file existence.
Possibly related PRs
NVIDIA/cuda-python#3418: Introduces the shared resolve_path() helper and updates path lookups to use it; this PR changes the same helper’s return type and its callers.
Change: Refactor
Merge Risk: Minimal · previous review f4794
This is an internal refactor that changes where a resolved path is converted to a string. Callers receive the same string values as before, so no user-visible behavior change is expected. The merge risk is minimal.
Security architecture risk: Minimal · up to f4794
The refactor moves string conversion into the private resolver. It does not change which paths are selected or what callers receive.
- [ ] Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 4 remain after this review.
`resolve_path` returned a `Path`, and all five callers wrapped it in
`str(...)`. It now returns the string itself and the wrappers are gone.
Its tests compare against `str(target.resolve())` instead of the `Path`.
The expected paths are the same.
No behavior change: every caller gets the same string as before.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Signed-off-by: Rob Parolin <rparolin@nvidia.com>
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
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.
— codex on behalf of Ralf —
Description
Part 19 of 23 of a readability stack for
cuda.pathfinder(stack: #3623 → #3602 → #3603 → #3604 → #3605 → #3606 → #3607 → #3608 → #3609 → #3610 → #3611 → #3613 → #3618 → #3619 → #3620 → #3621 → #3622 → #3627 → #3628 → #3629 → #3630 → #3631 → #3632). No behavior change.resolve_pathreturned aPath, and all five callers wrapped it instr(...). It now returns the string, and the wrappers are gone.Tests: the three
resolve_pathtests compare againststr(target.resolve())instead of thePath. The expected paths are the same.No behavior change: every caller gets the same string as before.
Testing
cuda_pathfindertest suite at this commit: 1297 passed, 6 skipped (Linux, Python 3.14).mypy-pathfinder. mypy also passes with--platform win32.mainare still byte-identical (Linux, simulated Windows x64 and arm64), and all 526 public-API scenarios give the same result as fix(pathfinder): check for an already-loaded library before searching the disk #3623.PLC Local Security Evidence (Advisory)
Local advisory checks only, run over the whole stack. Not release-gate results.
subprocess.runcall in the canary probe, now incanary_probe.pyChecklist
🤖 Generated with Claude Code