fix(runfiles): update Path method signatures for Python 3.14 compatibility and fix match() - #4100
Merged
Merged
Conversation
…ility Align runfiles.Path method signatures with Python 3.14 typeshed stubs to prevent type checker errors under newer Python versions. This updates method signatures (including glob, rglob, exists, is_dir, is_file, and read_text) and applies typing.override decorators where available.
Test runfiles and pathlib test suites across all supported Python versions (3.10 through 3.14) using pytest_test's python_versions attribute instead of separate targets. Additionally override Path.match() to delegate to _as_path(), fixing a Python 3.12 compatibility bug where pattern matching failed on runfile path objects.
Document the updated runfiles.Path method signatures for Python 3.14 compatibility and the fix for Path.match on Python 3.12+.
…E pytest_test deps Update runfiles.Path.is_dir, is_file, and read_text to check for Python 3.13+ before forwarding keyword arguments added in 3.13, ensuring Pyrefly compatibility across Python 3.10-3.14. Include exceptiongroup in pytest_test default dependencies to fix Python 3.10 test execution under WORKSPACE mode.
…st as bzlmod-only Replace Pyrefly ignore comment in Path.read_text with a sys.version_info >= (3, 13) check before passing the newline keyword argument. Revert exceptiongroup dependency from pytest_test macro and restrict multi-version runfiles pytest targets to Bzlmod mode via SUPPORTS_BZLMOD.
rickeylev
marked this pull request as ready for review
August 23, 2026 06:21
rickeylev
enabled auto-merge
August 23, 2026 06:54
aignas
approved these changes
Aug 23, 2026
aignas
left a comment
Collaborator
There was a problem hiding this comment.
I really like the python_versions attr for things like this.
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.
Align runfiles.Path method signatures with Python 3.14 typeshed stubs to
avoid type checker errors on newer Python releases. This also fixes a
bug where pattern matching failed on Python 3.12+.
This change splits the runfiles compatibility updates from PR #4023.