Skip to content

Use pathlib in toolshed and ci helper scripts (part 7 of #2410) - #2496

Open
LeSingh1 wants to merge 1 commit into
NVIDIA:mainfrom
LeSingh1:pathlib/toolshed-ci
Open

Use pathlib in toolshed and ci helper scripts (part 7 of #2410)#2496
LeSingh1 wants to merge 1 commit into
NVIDIA:mainfrom
LeSingh1:pathlib/toolshed-ci

Conversation

@LeSingh1

@LeSingh1 LeSingh1 commented Aug 4, 2026

Copy link
Copy Markdown

Path joining and filesystem predicates in the helper scripts, plus glob.globPath.glob in dump_cutile_b64.py.

os.path.isfile stays in check_generated_file_seals.py: that guard skips anything that is not a readable regular file, and Path.is_file() raises on EACCES/ENAMETOOLONG where os.path.isfile returns False. os.path.abspath stays where sys.path needs a str.

Not covered by the cuda_pathfinder CI job, so I verified locally instead: ci/tools/tests/test_check_release_notes.py passes (42 tests), and both pre-commit hooks produce output identical to the pre-change scripts when run over every tracked .py file.

Part 7 of #2410.

Parts 5 and 6 (cuda_core and cuda_bindings, largely build_hooks.py) are not ready — I have no way to run a wheel build here, and given the Path.is_file() divergence noted on #2410 I would rather not ship unverifiable build-system path changes.

Part 7 of the series proposed in NVIDIA#2410.

Path joining and filesystem predicates in the toolshed and ci/tools helper
scripts now go through pathlib. glob.glob in dump_cutile_b64.py becomes
Path.glob, with the mtime key reading Path.stat().

Kept on os.path, with a comment where it is not obvious:

- os.path.abspath in build_static_bitcode_input.py, since sys.path wants a str
  and Path.absolute() does not normalize.
- os.path.isfile in check_generated_file_seals.py. That guard exists to skip
  anything that is not a readable regular file, and Path.is_file() is not a
  drop-in: it propagates OSError for errnos outside pathlib's ignore list
  (EACCES, ENAMETOOLONG) where os.path.isfile returns False.
- os.path.normpath in check_spdx.py, which already carries its own comment.

The plan on NVIDIA#2410 also listed a root conftest.py; there is no such file. The
three conftest.py files live under cuda_pathfinder, cuda_core and
cuda_bindings, and none of them use os.path.

Verified locally: ci/tools/tests/test_check_release_notes.py passes (42
tests), and check_spdx.py and check_generated_file_seals.py produce output
identical to the pre-change scripts when run over every tracked .py file.

Signed-off-by: LeSingh1 <sshaurya914@gmail.com>
@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 CI/CD CI/CD infrastructure label Aug 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI/CD CI/CD infrastructure

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant