Skip to content

agents: document rf.root() path navigation and Runfiles.CreateOrRaise() in python rules - #4078

Merged
rickeylev merged 1 commit into
bazel-contrib:mainfrom
rickeylev:agents_runfiles_path_rule
Aug 18, 2026
Merged

rickeylev merged 1 commit into
bazel-contrib:mainfrom
rickeylev:agents_runfiles_path_rule

Conversation

@rickeylev

Copy link
Copy Markdown
Collaborator

When interacting with Bazel runfiles in Python tests and runtime helpers, using structured path navigation and globbing provides a cleaner, less error-prone interface than manual path manipulation or multi-root fallback loops.

Update .agents/rules/python.md to document the preference for rf.root() / "<repo>/<path>" over Rlocation() and using .glob() on runfiles.Path. Refine fail-fast creation guidance to prefer runfiles.CreateOrRaise() over runfiles.Create() with assertions.

…() in python rules

When interacting with Bazel runfiles in Python tests and runtime
helpers, using structured path navigation and globbing provides a
cleaner, less error-prone interface than manual path manipulation or
multi-root fallback loops.

Update .agents/rules/python.md to document the preference for
`rf.root() / "<repo>/<path>"` over `Rlocation()` and using `.glob()` on
`runfiles.Path`. Refine fail-fast creation guidance to prefer
`runfiles.CreateOrRaise()` over `runfiles.Create()` with assertions.
@rickeylev
rickeylev marked this pull request as ready for review August 18, 2026 22:05
@rickeylev
rickeylev requested a review from aignas as a code owner August 18, 2026 22:05
@rickeylev
rickeylev merged commit 2e65252 into bazel-contrib:main Aug 18, 2026
3 of 5 checks passed
@rickeylev
rickeylev deleted the agents_runfiles_path_rule branch August 18, 2026 22:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant