Upgrade rules_python to 1.7.0#27792
Closed
dabanki wants to merge 14 commits intobazelbuild:masterfrom
Closed
Conversation
Contributor
Author
|
@rickeylev Do the test modifications look okay to you? And do the failing test look important or can they also be removed? |
Contributor
|
lgtm |
Contributor
Author
|
Thanks for taking a look! Do the failing tests look like legitimate issues to you? |
Member
|
@bazel-io fork 9.0.0 |
Removing some more obsolete tests that fail with the new version update.
cad6ea7 to
ea945c0
Compare
gregestren
approved these changes
Dec 2, 2025
| self.ScratchFile('BUILD') | ||
|
|
||
| # Vendor, assert and build with no problems | ||
| self.RunBazel(['vendor', '--vendor_dir=vendor', '@@rules_python+//python/config_settings:python_path']) |
Contributor
There was a problem hiding this comment.
Maybe add a comment that (I think) we only need this until
bazel/src/main/java/com/google/devtools/build/lib/skyframe/SkyframeExecutor.java
Lines 3239 to 3258 in 57ccfd7
bazel-io
pushed a commit
to bazel-io/bazel
that referenced
this pull request
Dec 2, 2025
This is a fork of bazelbuild#27498. From the comments/open items on that PR, I've: 1. Removed the tests that were called out as not needed. 2. Added manual tag to `focus_test` to avoid pickup in larger runs until issue with `--experimental_enable_skyfocus` is resolved. 3. Switched failing test cases from using `from bazel_tools.tools.python.runfiles import runfiles` to use `from python.runfiles import runfiles` There are still a couple failing tests, looking for some guidance on if these can be removed/ignored: ``` test_source_file_does_not_override_standard_library FAILED: Expected regexp 'I am lib!' not found. ``` and ``` 1) explicitInitPy_CanBeSelectivelyDisabled(com.google.devtools.build.lib.bazel.rules.python.BazelPyBinaryConfiguredTargetTest) value of : getEmptyFilenames() unexpected (4): pkg/_foo.venv/lib/python3.11/__init__.py, pkg/_foo.venv/__init__.py, pkg/_foo.venv/lib/python3.11/site-packages/__init__.py, pkg/_foo.venv/lib/__init__.py --- expected : [pkg/__init__.py] but was : [pkg/_foo.venv/lib/python3.11/__init__.py, pkg/_foo.venv/__init__.py, pkg/_foo.venv/lib/python3.11/site-packages/__init__.py, pkg/__init__.py, pkg/_foo.venv/lib/__init__.py] at com.google.devtools.build.lib.bazel.rules.python.BazelPyBinaryConfiguredTargetTest.explicitInitPy_CanBeSelectivelyDisabled(BazelPyBinaryConfiguredTargetTest.java:235) 2) explicitInitPy_CanBeGloballyDisabled(com.google.devtools.build.lib.bazel.rules.python.BazelPyBinaryConfiguredTargetTest) value of : getEmptyFilenames() unexpected (4): pkg/_foo.venv/lib/python3.11/__init__.py, pkg/_foo.venv/__init__.py, pkg/_foo.venv/lib/python3.11/site-packages/__init__.py, pkg/_foo.venv/lib/__init__.py --- expected : [pkg/__init__.py] but was : [pkg/_foo.venv/lib/python3.11/__init__.py, pkg/_foo.venv/__init__.py, pkg/_foo.venv/lib/python3.11/site-packages/__init__.py, pkg/__init__.py, pkg/_foo.venv/lib/__init__.py] at com.google.devtools.build.lib.bazel.rules.python.BazelPyBinaryConfiguredTargetTest.explicitInitPy_CanBeGloballyDisabled(BazelPyBinaryConfiguredTargetTest.java:250) ``` Closes bazelbuild#27792. PiperOrigin-RevId: 839448559 Change-Id: I888614dd92fcbc4deda63a86a452bbd94e8f1523
github-merge-queue bot
pushed a commit
that referenced
this pull request
Dec 3, 2025
This is a fork of #27498. From the comments/open items on that PR, I've: 1. Removed the tests that were called out as not needed. 2. Added manual tag to `focus_test` to avoid pickup in larger runs until issue with `--experimental_enable_skyfocus` is resolved. 3. Switched failing test cases from using `from bazel_tools.tools.python.runfiles import runfiles` to use `from python.runfiles import runfiles` There are still a couple failing tests, looking for some guidance on if these can be removed/ignored: ``` test_source_file_does_not_override_standard_library FAILED: Expected regexp 'I am lib!' not found. ``` and ``` 1) explicitInitPy_CanBeSelectivelyDisabled(com.google.devtools.build.lib.bazel.rules.python.BazelPyBinaryConfiguredTargetTest) value of : getEmptyFilenames() unexpected (4): pkg/_foo.venv/lib/python3.11/__init__.py, pkg/_foo.venv/__init__.py, pkg/_foo.venv/lib/python3.11/site-packages/__init__.py, pkg/_foo.venv/lib/__init__.py --- expected : [pkg/__init__.py] but was : [pkg/_foo.venv/lib/python3.11/__init__.py, pkg/_foo.venv/__init__.py, pkg/_foo.venv/lib/python3.11/site-packages/__init__.py, pkg/__init__.py, pkg/_foo.venv/lib/__init__.py] at com.google.devtools.build.lib.bazel.rules.python.BazelPyBinaryConfiguredTargetTest.explicitInitPy_CanBeSelectivelyDisabled(BazelPyBinaryConfiguredTargetTest.java:235) 2) explicitInitPy_CanBeGloballyDisabled(com.google.devtools.build.lib.bazel.rules.python.BazelPyBinaryConfiguredTargetTest) value of : getEmptyFilenames() unexpected (4): pkg/_foo.venv/lib/python3.11/__init__.py, pkg/_foo.venv/__init__.py, pkg/_foo.venv/lib/python3.11/site-packages/__init__.py, pkg/_foo.venv/lib/__init__.py --- expected : [pkg/__init__.py] but was : [pkg/_foo.venv/lib/python3.11/__init__.py, pkg/_foo.venv/__init__.py, pkg/_foo.venv/lib/python3.11/site-packages/__init__.py, pkg/__init__.py, pkg/_foo.venv/lib/__init__.py] at com.google.devtools.build.lib.bazel.rules.python.BazelPyBinaryConfiguredTargetTest.explicitInitPy_CanBeGloballyDisabled(BazelPyBinaryConfiguredTargetTest.java:250) ``` Closes #27792. PiperOrigin-RevId: 839448559 Change-Id: I888614dd92fcbc4deda63a86a452bbd94e8f1523 Commit fbe3009 --------- Co-authored-by: Damian Banki <[email protected]>
copybara-service bot
pushed a commit
that referenced
this pull request
Dec 9, 2025
This removes hard-coded flags `--python_path`, `--experimental_python_import_all_repositories`, and `--incompatible_remove_ctx_bazel_py_fragment`. The first two are redefined in `rules_python` 1.7.0+ and linked into Bazel in #27792. This PR graveyards them but we can delete them outright when #27793 merges. `--incompatible_remove_ctx_bazel_py_fragment` was added in Bazel 9 to allow toggling between the native and Starlark definitions. By removing `--incompatible_remove_ctx_bazel_py_fragment`, this change removes the ability to revert to native definitions for post-9 Bazel. For #26521 and bazel-contrib/rules_python#3252. Closes #27842. PiperOrigin-RevId: 842305784 Change-Id: If55aa925d0cd546e0671ddcb44f9e2819697b22f
copybara-service bot
pushed a commit
that referenced
this pull request
Dec 12, 2025
Related to #27842. This removes hard-coded flags `--build_python_zip`, `--incompatible_default_to_explicit_init_py`, `--python_native_rules_allowlist`, `incompatible_python_disallow_native_rules`, and `incompatible_remove_ctx_py_fragment`. These flags are re-difined in rules_python 1.7.0+ and linked into Bazel in #27792. This PR graveyards them but we can delete them outright when #27793 merges. By removing --incompatible_remove_ctx_py_fragment, this change removes the ability to revert to native definitions for post-9 Bazel. For #26521 and bazel-contrib/rules_python#3252. Closes #27900. PiperOrigin-RevId: 843734148 Change-Id: I1bb9624b3e5a579f6aa50663eb63ef4d7d482b57
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.
This is a fork of #27498.
From the comments/open items on that PR, I've:
focus_testto avoid pickup in larger runs until issue with--experimental_enable_skyfocusis resolved.from bazel_tools.tools.python.runfiles import runfilesto usefrom python.runfiles import runfilesThere are still a couple failing tests, looking for some guidance on if these can be removed/ignored:
and