Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .agents/rules/pr.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ Before drafting any pull request description, strictly adhere to the rules in
(`.github/workflows/`).
* `tests:`: Test-only changes and test-helper fixes (never `fix:` or
`fix(tests):`).
* `agents:` / `agents(<scope>):`: Agent rules, skills, and prompts
(`.agents/`).

## PR Commit Workflow Invariant
* Once a Pull Request is created, always make new commits or merge commits.
Expand Down
3 changes: 3 additions & 0 deletions .agents/rules/python.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@
link to its definition in the docstring.

## Type Checking & Annotations
* **Version differences**: Guard version-specific arguments or APIs with runtime
checks (e.g. `if sys.version_info >= (3, 13):`) instead of
`# pyrefly: ignore[...]` comments.
* **`importlib.metadata` `PackagePath`**: `f.locate()` is typed as `PathLike`.
Wrap with `pathlib.Path(f.locate())` to call `.exists()`, `.is_file()`, etc.
* **In-file disables vs target skipping**: Prefer
Expand Down
4 changes: 4 additions & 0 deletions .agents/rules/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,7 @@
* **Platform Constraints**: Restrict OS-specific targets with
`target_compatible_with` (e.g., `["@platforms//os:windows"]`) to skip on
incompatible platforms.
* **Multi-version `pytest_test`**: Restrict targets using `python_versions` to
Bzlmod with `target_compatible_with = SUPPORTS_BZLMOD`
(`//tests/support:support.bzl`). WORKSPACE mode resolves pip dependencies for
only the host Python version.
2 changes: 2 additions & 0 deletions python/runfiles/runfiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,7 @@ def iterdir(self) -> Generator[Self, None, None]:
for p in resolved.iterdir():
yield self / p.name

# Return types and keyword arguments vary across Python versions in typeshed.
@override
def glob( # pyrefly: ignore[bad-override]
self,
Expand All @@ -407,6 +408,7 @@ def glob( # pyrefly: ignore[bad-override]
for p in it:
yield self / p.relative_to(resolved)

# Return types and keyword arguments vary across Python versions in typeshed.
@override
def rglob( # pyrefly: ignore[bad-override]
self,
Expand Down