feat: Rule for C extensions#1
Draft
rsartor-cmd wants to merge 95 commits into
Draft
Conversation
…#3795) Rules that execute a py_runtime interpreter in an action need the interpreter executable together with its runfiles metadata. The existing PyRuntimeInfo fields identify the interpreter file and runtime files, but do not preserve the target's FilesToRunProvider for executable interpreter targets. Add PyRuntimeInfo.interpreter_files_to_run for runtimes created from an executable interpreter target, and validate that direct provider construction keeps the FilesToRunProvider executable aligned with the interpreter field. Direct file interpreters and platform runtimes continue to leave this field unset, preserving existing py_runtime behavior. Document the new public provider field and add focused analysis-test coverage for executable, file-only, platform, and invalid constructor cases. One example is [rules_pycross](https://github.com/jvolkman/rules_pycross) wheel building with an in-build executable Python runtime. pycross needs to run the selected Python interpreter in an action, but PyRuntimeInfo previously exposed only the interpreter File and runtime files, not the interpreter target's FilesToRunProvider. For executable in-build runtimes, the FilesToRunProvider is the Bazel-native handle that carries both the executable and the runfiles metadata needed to stage it as an action tool. Exposing it lets pycross consume the runtime interpreter directly for wheel-build actions instead of reconstructing or approximating the interpreter's runtime closure from separate fields. Co-authored-by: Richard Levasseur <richardlev@gmail.com>
Update changelog and version markers --------- Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Currently, we update the change log directly when user-visible changes are made. This works, but makes backporting patches into release branches prone to unnecessary conflicts. These conflicts can sometimes be quite confusing, making it easy to accidentally merge incorrect content. Instead, what we can do is keep track of an upcoming release's change log entries in separate files under the `news/` directory. When creating a release, all the news entries are assembled into a section in the change log and the news entries deleted. When backporting a change, after cherry picking, the news entries are merged into the release's change log section.
…trib#3832) Under `bazel coverage`, coverage.py raises `NoDataError` from `lcov_report()` when no instrumented Python code was executed, instead of writing an (empty) report. This error currently propagates out of the coverage bootstrap and fails an otherwise passing test. This is common and benign in a few setups: - a `py_binary` that only spawns another process and runs no Python itself - a test whose instrumented sources happen not to execute any Python **Before:** `bazel coverage //a:test` fails with `coverage.exceptions.NoDataError` even though `bazel test //a:test` passes. **After:** the `NoDataError` is caught and the empty report is skipped, so the test result is unchanged by whether coverage data happened to be collected. This mirrors the reporter's suggestion in bazel-contrib#2762 to "ignore the return code of `coverage lcov`", applied in-process. As noted on the original report and in bazel-contrib#3823, there is no in-repo harness for exercising real coverage collection, so this change does not add an automated test. Fixes bazel-contrib#2762 --------- Co-authored-by: Richard Levasseur <richardlev@gmail.com>
…bazel-contrib#3828) Resolve `pip.parse(experimental_index_url = ...)` through `envsubst` before checking whether the experimental index-url code path should be enabled. Previously, an unsubstituted template like `$RULES_PYTHON_PIP_INDEX_URL` is a non-empty string and therefore truthy, so `_set_get_index_urls` enabled the experimental index-url mode even when the env var was unset or expanded to empty. With this change, the value is expanded first (using `pip_attr.envsubst` and `module_ctx.os.environ.get`) and the truthiness check runs against the resolved string, matching the behavior users expect when they gate the index URL on an env var. --------- Co-authored-by: Richard Levasseur <richardlev@gmail.com>
1. Refactored patch_whl.bzl — Extracted fix_record_content() as a public pure function (no rctx dependency) so it can be unit tested directly. 2. Unit tests (patch_whl_tests.bzl) — 5 new rules_testing tests for fix_record_content: - Adds missing files to RECORD - Returns None when nothing is missing - Preserves quoting style of existing entries - Skips excluded files (INSTALLER, RECORD*, REQUESTED) - Skips .whl files 3. Integration test (patch_whl_patch_test.py) — End-to-end test that: - Creates a wheel from testdata/pkg/ via whl_from_dir_repo - Applies a patch via whl_library(whl_patches=...) - Verifies pkg.PATCHED is True (was False) and pkg.DATA is unchanged The integration test follows the established pattern: test data in tests/pypi/patch_whl/testdata/, registered in internal_dev_deps.bzl, wired into MODULE.bazel, and built as a py_test. All 205 pypi tests pass. With this we can potentially more easily separate whl and sdist path ways. --------- Co-authored-by: Richard Levasseur <richardlev@gmail.com>
…APIs (bazel-contrib#3835) Currently, `VenvSymlinkEntry` and `VenvSymlinkKind` are defined in the private `python/private/py_info.bzl` file, making them inaccessible to users who want to programmatically define virtual environment symlinks when using `PyInfo` (or at the least, having to load private file paths). To fix this, we load and re-export both symbols in the public `python/py_info.bzl` file. Along the way * Adds `VenvSymlinkEntryBuilder` to allow fluent construction of symlink entries via PyInfoBuilder. * Adds `features.loadable_symbols` to allow programmatic detection of these public symbols.
Currently, the generated changelog has a broken link to the news directory. Since we can process the files as part of docgen, fix the broken link by rendering the news as one would see it for a release. Along the way... * Delete defunct unreleased template handling, as we've switched to news file assembly instead.
Enable bazel-diff to improve CI performance by skipping targets that aren't affected by a PR
This PR fixes the CI breakage on main where bazel-diff ran in plain query mode, ignoring target_compatible_with and attempting to run platform-incompatible tests. It re-introduces the java wrapper to inject cquery mode targeting only non-manual tests, and re-applies the visibility fix.
…-contrib#3840) This PR disables the bazel-diff target filtering to repair the CI. Since we make heavy use of target_compatible_with to restrict tests to specific platforms, and Bazel CI's bazel-diff integration isn't able to handle those.
Implicit `__init__.py` creation is deprecated and will be disabled by default in a future release. We need to warn users when their targets rely on this behavior so they can transition to explicit `__init__.py` files before the default changes and their builds break. Work towards bazel-contrib#2945
…template (bazel-contrib#3842) Align the Windows path resolution in the site initialization template with the bootstrap template to prevent flaky platform lookup errors on Windows 2022. This is achieved by wrapping the win32 version retrieval in a retrying loop. Fixes bazel-contrib#3721
Fixes venv output naming for `py_binary` and `py_test` targets whose names contain path separators. Before this change, the venv output prefix was derived from the executable basename. Distinct targets such as `//:foo/tool` and `//:bar/tool` both have executable basename `tool`, so they could both declare the same package-relative venv output directory: ```text bazel-out/.../bin/_tool.venv ``` After this change, the venv output prefix is derived from the full target name with `/` replaced by `_`, so those targets use separate venv output directories such as: ```text _foo_tool.venv _bar_tool.venv ``` Added regression coverage for slash-named executable targets in the shared `py_binary` / `py_test` base-rule tests. Fixes bazel-contrib#3844
This introduces workflows and tools to automate releases. The basic idea it to have an issue with tasks, and workflows invoke tools that parse and update the tasks in the issue. The basic release steps are: 1. Prepare a release (update changelog via PR) 2. Create a release branch after preparation 3. Backport changes into the release branch 4. Tag RCs 5. Promote to final Each step has a workflow. For now, most of the workflows require a manual trigger, to help prevent workflows from running wild as we flush out bugs and edge cases. The workflows almost entirely delegate to the `release` tool. There's basically one command per workflow. This makes it easy to encode specialized logic and run it locally for testing or reproduction.
Bumps [actions/checkout](https://github.com/actions/checkout) from 6 to 7. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/actions/checkout/releases">actions/checkout's releases</a>.</em></p> <blockquote> <h2>v7.0.0</h2> <h2>What's Changed</h2> <ul> <li>block checking out fork pr for pull_request_target and workflow_run by <a href="https://github.com/aiqiaoy"><code>@aiqiaoy</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2454">actions/checkout#2454</a></li> <li>Bump actions/publish-immutable-action from 0.0.3 to 0.0.4 in the minor-actions-dependencies group across 1 directory by <a href="https://github.com/dependabot"><code>@dependabot</code></a>[bot] in <a href="https://redirect.github.com/actions/checkout/pull/2458">actions/checkout#2458</a></li> <li>Bump flatted from 3.3.1 to 3.4.2 by <a href="https://github.com/dependabot"><code>@dependabot</code></a>[bot] in <a href="https://redirect.github.com/actions/checkout/pull/2460">actions/checkout#2460</a></li> <li>Bump js-yaml from 4.1.0 to 4.2.0 by <a href="https://github.com/dependabot"><code>@dependabot</code></a>[bot] in <a href="https://redirect.github.com/actions/checkout/pull/2461">actions/checkout#2461</a></li> <li>Bump <code>@actions/core</code> and <code>@actions/tool-cache</code> and Remove uuid by <a href="https://github.com/dependabot"><code>@dependabot</code></a>[bot] in <a href="https://redirect.github.com/actions/checkout/pull/2459">actions/checkout#2459</a></li> <li>upgrade module to esm and update dependencies by <a href="https://github.com/aiqiaoy"><code>@aiqiaoy</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2463">actions/checkout#2463</a></li> <li>Bump the minor-npm-dependencies group across 1 directory with 3 updates by <a href="https://github.com/dependabot"><code>@dependabot</code></a>[bot] in <a href="https://redirect.github.com/actions/checkout/pull/2462">actions/checkout#2462</a></li> <li>getting ready for checkout v7 release by <a href="https://github.com/aiqiaoy"><code>@aiqiaoy</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2464">actions/checkout#2464</a></li> <li>update error wording by <a href="https://github.com/aiqiaoy"><code>@aiqiaoy</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2467">actions/checkout#2467</a></li> </ul> <h2>New Contributors</h2> <ul> <li><a href="https://github.com/aiqiaoy"><code>@aiqiaoy</code></a> made their first contribution in <a href="https://redirect.github.com/actions/checkout/pull/2454">actions/checkout#2454</a></li> </ul> <p><strong>Full Changelog</strong>: <a href="https://github.com/actions/checkout/compare/v6.0.3...v7.0.0">https://github.com/actions/checkout/compare/v6.0.3...v7.0.0</a></p> <h2>v6.0.3</h2> <h2>What's Changed</h2> <ul> <li>Update changelog by <a href="https://github.com/ericsciple"><code>@ericsciple</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2357">actions/checkout#2357</a></li> <li>fix: expand merge commit SHA regex and add SHA-256 test cases by <a href="https://github.com/yaananth"><code>@yaananth</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2414">actions/checkout#2414</a></li> <li>Fix checkout init for SHA-256 repositories by <a href="https://github.com/yaananth"><code>@yaananth</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2439">actions/checkout#2439</a></li> <li>Update changelog for v6.0.3 by <a href="https://github.com/yaananth"><code>@yaananth</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2446">actions/checkout#2446</a></li> </ul> <h2>New Contributors</h2> <ul> <li><a href="https://github.com/yaananth"><code>@yaananth</code></a> made their first contribution in <a href="https://redirect.github.com/actions/checkout/pull/2414">actions/checkout#2414</a></li> </ul> <p><strong>Full Changelog</strong>: <a href="https://github.com/actions/checkout/compare/v6...v6.0.3">https://github.com/actions/checkout/compare/v6...v6.0.3</a></p> <h2>v6.0.2</h2> <h2>What's Changed</h2> <ul> <li>Add orchestration_id to git user-agent when ACTIONS_ORCHESTRATION_ID is set by <a href="https://github.com/TingluoHuang"><code>@TingluoHuang</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2355">actions/checkout#2355</a></li> <li>Fix tag handling: preserve annotations and explicit fetch-tags by <a href="https://github.com/ericsciple"><code>@ericsciple</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2356">actions/checkout#2356</a></li> </ul> <p><strong>Full Changelog</strong>: <a href="https://github.com/actions/checkout/compare/v6.0.1...v6.0.2">https://github.com/actions/checkout/compare/v6.0.1...v6.0.2</a></p> <h2>v6.0.1</h2> <h2>What's Changed</h2> <ul> <li>Update all references from v5 and v4 to v6 by <a href="https://github.com/ericsciple"><code>@ericsciple</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2314">actions/checkout#2314</a></li> <li>Add worktree support for persist-credentials includeIf by <a href="https://github.com/ericsciple"><code>@ericsciple</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2327">actions/checkout#2327</a></li> <li>Clarify v6 README by <a href="https://github.com/ericsciple"><code>@ericsciple</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2328">actions/checkout#2328</a></li> </ul> <p><strong>Full Changelog</strong>: <a href="https://github.com/actions/checkout/compare/v6...v6.0.1">https://github.com/actions/checkout/compare/v6...v6.0.1</a></p> </blockquote> </details> <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/actions/checkout/blob/main/CHANGELOG.md">actions/checkout's changelog</a>.</em></p> <blockquote> <h1>Changelog</h1> <h2>v7.0.0</h2> <ul> <li>Block checking out fork PR for pull_request_target and workflow_run by <a href="https://github.com/aiqiaoy"><code>@aiqiaoy</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2454">actions/checkout#2454</a></li> <li>Bump actions/publish-immutable-action from 0.0.3 to 0.0.4 in the minor-actions-dependencies group across 1 directory by <a href="https://github.com/dependabot"><code>@dependabot</code></a>[bot] in <a href="https://redirect.github.com/actions/checkout/pull/2458">actions/checkout#2458</a></li> <li>Bump flatted from 3.3.1 to 3.4.2 by <a href="https://github.com/dependabot"><code>@dependabot</code></a>[bot] in <a href="https://redirect.github.com/actions/checkout/pull/2460">actions/checkout#2460</a></li> <li>Bump js-yaml from 4.1.0 to 4.2.0 by <a href="https://github.com/dependabot"><code>@dependabot</code></a>[bot] in <a href="https://redirect.github.com/actions/checkout/pull/2461">actions/checkout#2461</a></li> <li>Bump <code>@actions/core</code> and <code>@actions/tool-cache</code> and Remove uuid by <a href="https://github.com/dependabot"><code>@dependabot</code></a>[bot] in <a href="https://redirect.github.com/actions/checkout/pull/2459">actions/checkout#2459</a></li> <li>upgrade module to esm and update dependencies by <a href="https://github.com/aiqiaoy"><code>@aiqiaoy</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2463">actions/checkout#2463</a></li> <li>Bump the minor-npm-dependencies group across 1 directory with 3 updates by <a href="https://github.com/dependabot"><code>@dependabot</code></a>[bot] in <a href="https://redirect.github.com/actions/checkout/pull/2462">actions/checkout#2462</a></li> </ul> <h2>v6.0.3</h2> <ul> <li>Fix checkout init for SHA-256 repositories by <a href="https://github.com/yaananth"><code>@yaananth</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2439">actions/checkout#2439</a></li> <li>fix: expand merge commit SHA regex and add SHA-256 test cases by <a href="https://github.com/yaananth"><code>@yaananth</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2414">actions/checkout#2414</a></li> </ul> <h2>v6.0.2</h2> <ul> <li>Fix tag handling: preserve annotations and explicit fetch-tags by <a href="https://github.com/ericsciple"><code>@ericsciple</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2356">actions/checkout#2356</a></li> </ul> <h2>v6.0.1</h2> <ul> <li>Add worktree support for persist-credentials includeIf by <a href="https://github.com/ericsciple"><code>@ericsciple</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2327">actions/checkout#2327</a></li> </ul> <h2>v6.0.0</h2> <ul> <li>Persist creds to a separate file by <a href="https://github.com/ericsciple"><code>@ericsciple</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2286">actions/checkout#2286</a></li> <li>Update README to include Node.js 24 support details and requirements by <a href="https://github.com/salmanmkc"><code>@salmanmkc</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2248">actions/checkout#2248</a></li> </ul> <h2>v5.0.1</h2> <ul> <li>Port v6 cleanup to v5 by <a href="https://github.com/ericsciple"><code>@ericsciple</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2301">actions/checkout#2301</a></li> </ul> <h2>v5.0.0</h2> <ul> <li>Update actions checkout to use node 24 by <a href="https://github.com/salmanmkc"><code>@salmanmkc</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2226">actions/checkout#2226</a></li> </ul> <h2>v4.3.1</h2> <ul> <li>Port v6 cleanup to v4 by <a href="https://github.com/ericsciple"><code>@ericsciple</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2305">actions/checkout#2305</a></li> </ul> <h2>v4.3.0</h2> <ul> <li>docs: update README.md by <a href="https://github.com/motss"><code>@motss</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/1971">actions/checkout#1971</a></li> <li>Add internal repos for checking out multiple repositories by <a href="https://github.com/mouismail"><code>@mouismail</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/1977">actions/checkout#1977</a></li> <li>Documentation update - add recommended permissions to Readme by <a href="https://github.com/benwells"><code>@benwells</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2043">actions/checkout#2043</a></li> <li>Adjust positioning of user email note and permissions heading by <a href="https://github.com/joshmgross"><code>@joshmgross</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2044">actions/checkout#2044</a></li> <li>Update README.md by <a href="https://github.com/nebuk89"><code>@nebuk89</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2194">actions/checkout#2194</a></li> <li>Update CODEOWNERS for actions by <a href="https://github.com/TingluoHuang"><code>@TingluoHuang</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2224">actions/checkout#2224</a></li> <li>Update package dependencies by <a href="https://github.com/salmanmkc"><code>@salmanmkc</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2236">actions/checkout#2236</a></li> </ul> <h2>v4.2.2</h2> <ul> <li><code>url-helper.ts</code> now leverages well-known environment variables by <a href="https://github.com/jww3"><code>@jww3</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/1941">actions/checkout#1941</a></li> <li>Expand unit test coverage for <code>isGhes</code> by <a href="https://github.com/jww3"><code>@jww3</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/1946">actions/checkout#1946</a></li> </ul> <h2>v4.2.1</h2> <ul> <li>Check out other refs/* by commit if provided, fall back to ref by <a href="https://github.com/orhantoy"><code>@orhantoy</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/1924">actions/checkout#1924</a></li> </ul> <!-- raw HTML omitted --> </blockquote> <p>... (truncated)</p> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/actions/checkout/commit/9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0"><code>9c091bb</code></a> update error wording (<a href="https://redirect.github.com/actions/checkout/issues/2467">#2467</a>)</li> <li><a href="https://github.com/actions/checkout/commit/1044a6dea927916f2c38ba5aeffbc0a847b1221a"><code>1044a6d</code></a> getting ready for checkout v7 release (<a href="https://redirect.github.com/actions/checkout/issues/2464">#2464</a>)</li> <li><a href="https://github.com/actions/checkout/commit/f0282184c7ce73ab54c7e4ab5a617122602e575f"><code>f028218</code></a> Bump the minor-npm-dependencies group across 1 directory with 3 updates (<a href="https://redirect.github.com/actions/checkout/issues/2462">#2462</a>)</li> <li><a href="https://github.com/actions/checkout/commit/d914b262ffc244530a203ab40decab34c3abf34d"><code>d914b26</code></a> upgrade module to esm and update dependencies (<a href="https://redirect.github.com/actions/checkout/issues/2463">#2463</a>)</li> <li><a href="https://github.com/actions/checkout/commit/537c7ef99cef6e5ddb5e7ff5d16d14510503801d"><code>537c7ef</code></a> Bump <code>@actions/core</code> and <code>@actions/tool-cache</code> and Remove uuid (<a href="https://redirect.github.com/actions/checkout/issues/2459">#2459</a>)</li> <li><a href="https://github.com/actions/checkout/commit/130a169078a413d3a5246a393625e8e742f387f6"><code>130a169</code></a> Bump js-yaml from 4.1.0 to 4.2.0 (<a href="https://redirect.github.com/actions/checkout/issues/2461">#2461</a>)</li> <li><a href="https://github.com/actions/checkout/commit/7d09575332117a40b46e5e020664df234cd416f3"><code>7d09575</code></a> Bump flatted from 3.3.1 to 3.4.2 (<a href="https://redirect.github.com/actions/checkout/issues/2460">#2460</a>)</li> <li><a href="https://github.com/actions/checkout/commit/0f9f3aa320cb53abeb534aeb54048075d9697a0e"><code>0f9f3aa</code></a> Bump actions/publish-immutable-action (<a href="https://redirect.github.com/actions/checkout/issues/2458">#2458</a>)</li> <li><a href="https://github.com/actions/checkout/commit/f9e715a95fcd1f9253f77dd28f11e88d2d6460c7"><code>f9e715a</code></a> block checking out fork pr for pull_request_target and workflow_run (<a href="https://redirect.github.com/actions/checkout/issues/2454">#2454</a>)</li> <li>See full diff in <a href="https://github.com/actions/checkout/compare/v6...v7">compare view</a></li> </ul> </details> <br /> [](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) </details> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…ontrib#3846) This file was not intended to be tracked in the repository, so it has been removed.
This implements a pypi hub that is the union of all pypi hubs. The basic design is: * The `pip` extension _always_ creates a `@pypi` repo unless the name is already taken by another hub definition. * The `--pypi_hub` flag dispatches to one of the hubs. If not set, then it uses a default one (first, or as configured) The set of packages and targets the unified hub exposes is a union of all other hubs. If the unified hub routes to a hub that doesn't support such a target, then it points to a target that fails at execution time. This is to allow query and cquery to work even if some targets don't exist in some hubs.
The strategy for this is: * First add a way for us to create a `uv.lock` file from the `lock` rule. * Then add a `uv.lock` reader via the bazel toml parser. * Then plug the code into the `parse_requirements` function so that we can reuse the most of code already there. * Add some sample docs for the `uv.lock`. Extra things that we could do: * Call the PyPI index to understand if the packages are yanked or not - lock file does not have that information. * Read the `pyproject.toml` file to get the index values for each package. * Add e2e tests from `rules_py` test suite. Closes bazel-contrib#3557 Work towards bazel-contrib#2787 --------- Co-authored-by: Richard Levasseur <richardlev@gmail.com> Co-authored-by: Richard Levasseur <rlevasseur@google.com>
…ntrib#3849) Add a workspace-specific agent rule to ensure that new conversations/sessions and branches are always based on the latest upstream code to avoid using outdated code states. This comes about after having several sessions go haywire at the start because they didn't see the latest changes.
rsartor-cmd
force-pushed
the
py-extension
branch
from
June 26, 2026 18:05
c050aed to
109eb69
Compare
…trib#3859) Create a workflow for lighter weight PR checks. These just check basic things about a PR, e.g. markers to prevent submit, blocking files that shouldn't be checked in.
To make it easier to manage the many bzl_library targets we have, switch
to using
gazelle to do so.
Unfortunately, gazelle has strong opinions about target names: it forces
`{foo}` names and doesn't allow `{foo}_bzl` names. Trying to make it do
so requires
quite a bit of gazelle directives.
Instead, rename all the internal targets, but create aliases for public
targets.
Along the way...
* Delete unused py_args.bzl
* Add agent rule to avoid inappropriate copyright
* Add a skill for creating rules
…ib#3861) The pr-metadata-checks workflow was failing because gh pr diff requires a git repository context when run without target repository information. We now explicitly pass the repository using the --repo flag, allowing the job to run successfully without needing a full repository checkout.
## Summary Add an `extract_needs_chmod` config flag that controls whether `chmod` is run after extracting wheel files. The flag is `False` for Bazel >= 8.6 (where the fix for file permissions is built into Bazel) and `True` for older versions. Move `_maybe_fix_permissions` from `whl_extract.bzl` into `repo_utils.bzl` and have `_extract` call it conditionally based on the config flag. This ensures both `whl_extract` and `patch_whl` benefit from the chmod fix when needed. Whilst at it migrate tests to common mocks. Fixes bazel-contrib#3585 Closes bazel-contrib#3860
Make the check run on edit so that it can detect adding/removing of the special marker text.
This is no longer used starting when we enabled pipstar by default and did a code cleanup where Python is no longer used to extract the wheels. Split from bazel-contrib#3856
…azel-contrib#3866) This change refactors the release promotion tool to ensure all pre-conditions are verified before making any modifications and automates post-promotion tracking updates. It also fixes a bug where the tool incorrectly assumed 'v' prefixes when identifying the latest release candidate and computing the final version tag.
rsartor-cmd
force-pushed
the
py-extension
branch
from
June 29, 2026 18:58
815f0fd to
9bfc331
Compare
We had to disable the `sphinxdocs` persistent worker in Pigweed (https://pwbug.dev/493749800) because the cache invalidation logic seemed incomplete with regards to Git branches. E.g. in branch `feat` you create a new doc `foo.rst`. You switch back to branch `main` and try to build Sphinx, but Sphinx warns about needing to ignore unreadable document `foo.rst`. Because Pigweed builds Sphinx with `--fail-on-warning` this would break our docs build. This PR adds the bug fix and also starts a suite of tests that will be focused on persistent worker correctness. --------- Co-authored-by: Richard Levasseur <richardlev@gmail.com>
…bazel-contrib#3920) Currently, several internal macros, toolchain definitions, and config settings either hardcode \`["//visibility:public"]\` or define private copies like \`_NOT_ACTUALLY_PUBLIC\`. This scatters visibility workarounds across the codebase and makes developer intent unclear. To clean this up, transition internal rules across \`python/private\` to use \`NOT_ACTUALLY_PUBLIC\` from \`python/private/visibility.bzl\`, and update corresponding \`bzl_library\` dependencies to match.
…e rule builders (bazel-contrib#3919) `create_executable_rule_builder()` (used by `py_binary_rule_builder()` / `py_test_rule_builder()`, the public `python/api/executables.bzl` API) bundles three implicit attrs whose defaults point at private targets under `//python/private`: `build_data_writer`, `debugger_if_target_config`, and `uncachable_version_file`. These targets had no explicit visibility, so they inherited the package's `default_visibility` (`//:__subpackages__`), which only covers packages inside the rules_python repo itself. Because the builder API is designed to let external modules call `rule()` themselves (via `builder.build()`), Bazel checks visibility of these attr defaults from the *calling* module's package, not from rules_python's. Any external repo constructing a rule via `py_binary_rule_builder()` / `py_test_rule_builder()` therefore fails at analysis time with a visibility error. This has been broken since the builder API's introduction; there's prior art in this same file for exactly this situation (e.g. `stage1_bootstrap_template`, among others) Co-authored-by: Richard Levasseur <richardlev@gmail.com>
…azel-contrib#3922) Currently, `LocalAgentConfig` only configures a single default model without an explicit endpoint attached when passing `ModelTarget` objects, which causes startup errors (`must have an endpoint configured`) or rate-limit failures when quota runs short. To fix, import `GeminiAPIEndpoint` and `ModelTarget`, create an explicit endpoint (`GeminiAPIEndpoint()`), and configure a prioritized multi-model cascade across all major Gemini 3 and Gemini 2 models so the agent automatically falls back to whichever model has open quota and full function calling capabilities.
rsartor-cmd
force-pushed
the
py-extension
branch
3 times, most recently
from
July 17, 2026 22:06
0425e9f to
549bc49
Compare
…request (bazel-contrib#3933) The Sphinx worker keeps doctrees outside declared outputs so that incremental builds survive across invocations. A newly started worker has no digest history, so it treats every input as changed and re-reads all docs. Re-reading against the stale environment left by a previous worker can produce spurious warnings, e.g. duplicate labels, which become build failures when `--fail-on-warning` is enabled. On the first request, delete the worker output directory and doctree directory so the worker starts from a clean Sphinx environment.
…trib#3927) Bumps [myst-parser](https://github.com/executablebooks/MyST-Parser) from 4.0.1 to 5.1.0. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/executablebooks/MyST-Parser/releases">myst-parser's releases</a>.</em></p> <blockquote> <h2>v5.1.0</h2> <h2>✨ New Features</h2> <ul> <li>✨ Add <code>"alert"</code> syntax extension for <a href="https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax#alerts">GFM alerts</a> (e.g. <code>> [!NOTE]</code>), see <a href="https://myst-parser.readthedocs.io/en/latest/syntax/optional.html#alerts-github-style-callouts">docs</a> by <a href="https://github.com/chrisjsewell"><code>@chrisjsewell</code></a> in <a href="https://redirect.github.com/executablebooks/MyST-Parser/issues/1128">#1128</a></li> <li>✨ Add <code>"gfm_autolink"</code> syntax extension for <a href="https://github.github.com/gfm/#autolinks-extension-">GFM autolinks</a>, see <a href="https://myst-parser.readthedocs.io/en/latest/syntax/optional.html#gfm-autolinks">docs</a> by <a href="https://github.com/chrisjsewell"><code>@chrisjsewell</code></a> in <a href="https://redirect.github.com/executablebooks/MyST-Parser/issues/1128">#1128</a></li> <li>✨ Add <code>myst_strikethrough_single_tilde</code> <a href="https://myst-parser.readthedocs.io/en/latest/configuration.html">config option</a> to allow single tilde (<code>~</code>) for strikethrough by <a href="https://github.com/chrisjsewell"><code>@chrisjsewell</code></a> in <a href="https://redirect.github.com/executablebooks/MyST-Parser/issues/1128">#1128</a></li> <li>✨ Add <code>myst_colon_fence_exact_match</code> <a href="https://myst-parser.readthedocs.io/en/latest/configuration.html">config option</a> to require the closing colon fence to have exactly the same number of colons as the opening, see <a href="https://myst-parser.readthedocs.io/en/latest/syntax/optional.html#code-fences-using-colons">docs</a> by <a href="https://github.com/chrisjsewell"><code>@chrisjsewell</code></a> in <a href="https://redirect.github.com/executablebooks/MyST-Parser/issues/1128">#1128</a></li> </ul> <h2>👌 Improvements</h2> <ul> <li>👌 Update <code>myst_gfm_only</code> mode to use the unified <code>gfm_plugin</code>, which now includes GFM autolinks, alerts, and improved strikethrough/tasklist handling by <a href="https://github.com/chrisjsewell"><code>@chrisjsewell</code></a> in <a href="https://redirect.github.com/executablebooks/MyST-Parser/issues/1128">#1128</a></li> <li>👌 Improve MathJax 4 compatibility for Sphinx 9 by <a href="https://github.com/chrisjsewell"><code>@chrisjsewell</code></a> in <a href="https://redirect.github.com/executablebooks/MyST-Parser/issues/1110">#1110</a></li> <li>👌 Stop directive-option parsing at colon fences, fixing nested colon fence directives by <a href="https://github.com/chrisjsewell"><code>@chrisjsewell</code></a> in <a href="https://redirect.github.com/executablebooks/MyST-Parser/issues/1133">#1133</a></li> </ul> <h2>🐛 Bug Fixes</h2> <ul> <li>🐛 Use docname instead of source path in warning locations by <a href="https://github.com/chrisjsewell"><code>@chrisjsewell</code></a> in <a href="https://redirect.github.com/executablebooks/MyST-Parser/issues/1114">#1114</a></li> <li>🐛 Correctly encode <code>&</code> in Markdown URLs by not HTML-escaping <code>refuri</code> by <a href="https://github.com/chrisjsewell"><code>@chrisjsewell</code></a> in <a href="https://redirect.github.com/executablebooks/MyST-Parser/issues/1126">#1126</a></li> <li>🐛 Fix <code>RemovedInSphinx10Warning</code> for inventory item iteration by <a href="https://github.com/chrisjsewell"><code>@chrisjsewell</code></a> in <a href="https://redirect.github.com/executablebooks/MyST-Parser/issues/1129">#1129</a></li> <li>🐛 Pin <code>mdit-py-plugins>=0.6.1</code> for nested field list fix by <a href="https://github.com/chrisjsewell"><code>@chrisjsewell</code></a> in <a href="https://redirect.github.com/executablebooks/MyST-Parser/issues/1134">#1134</a></li> </ul> <h2>⬆️ Dependency Upgrades</h2> <ul> <li>⬆️ Upgrade to <code>markdown-it-py~=4.2</code> and <code>mdit-py-plugins~=0.6</code> by <a href="https://github.com/chrisjsewell"><code>@chrisjsewell</code></a> in <a href="https://redirect.github.com/executablebooks/MyST-Parser/issues/1128">#1128</a></li> <li>⬆️ Update pygments requirement from <code><2.20</code> to <code><2.21</code> by <a href="https://github.com/chrisjsewell"><code>@chrisjsewell</code></a> in <a href="https://redirect.github.com/executablebooks/MyST-Parser/issues/1117">#1117</a></li> </ul> <h2>New Contributors</h2> <ul> <li><a href="https://github.com/mb"><code>@mb</code></a> made their first contribution in <a href="https://redirect.github.com/executablebooks/MyST-Parser/pull/1126">executablebooks/MyST-Parser#1126</a></li> <li><a href="https://github.com/Bizordec"><code>@Bizordec</code></a> made their first contribution in <a href="https://redirect.github.com/executablebooks/MyST-Parser/pull/1114">executablebooks/MyST-Parser#1114</a></li> <li><a href="https://github.com/ilia-kats"><code>@ilia-kats</code></a> made their first contribution in <a href="https://redirect.github.com/executablebooks/MyST-Parser/pull/1110">executablebooks/MyST-Parser#1110</a></li> </ul> <p><strong>Full Changelog</strong>: <a href="https://github.com/executablebooks/MyST-Parser/compare/v5.0.0...v5.1.0">https://github.com/executablebooks/MyST-Parser/compare/v5.0.0...v5.1.0</a></p> <h2>v5.0.0</h2> <h1>MyST-Parser 5.0.0</h1> <p><strong>Release Date</strong>: 2026-01-15</p> <p>This release significantly bumps the supported versions of core dependencies:</p> <h2>‼️ Breaking Changes</h2> <p>This release updates the minimum supported versions:</p> <ul> <li><strong>Python</strong>: <code>>=3.11</code> (dropped Python 3.10, tests up to 3.14)</li> <li><strong>Sphinx</strong>: <code>>=8,<10</code> (dropped Sphinx 7, added Sphinx 9)</li> <li><strong>Docutils</strong>: <code>>=0.20,<0.23</code> (dropped docutils 0.19, added docutils 0.22)</li> <li><strong>markdown-it-py</strong>: <code>~=4.0</code> (upgraded from v3)</li> </ul> <!-- raw HTML omitted --> </blockquote> <p>... (truncated)</p> </details> <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/executablebooks/MyST-Parser/blob/master/CHANGELOG.md">myst-parser's changelog</a>.</em></p> <blockquote> <h2>5.1.0 - 2026-05-13</h2> <h3>✨ New Features</h3> <ul> <li>✨ Add <code>"alert"</code> syntax extension for <a href="https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax#alerts">GFM alerts</a> (e.g. <code>> [!NOTE]</code>), see <a href="https://github.com/executablebooks/MyST-Parser/blob/master/syntax/alerts"></a> by <a href="gh-user:chrisjsewell">gh-user:chrisjsewell</a> in <a href="gh-pr:1128">gh-pr:1128</a></li> <li>✨ Add <code>"gfm_autolink"</code> syntax extension for <a href="https://github.github.com/gfm/#autolinks-extension-">GFM autolinks</a>, see <a href="https://github.com/executablebooks/MyST-Parser/blob/master/syntax/gfm-autolink"></a> by <a href="gh-user:chrisjsewell">gh-user:chrisjsewell</a> in <a href="gh-pr:1128">gh-pr:1128</a></li> <li>✨ Add <code>myst_strikethrough_single_tilde</code> <a href="https://github.com/executablebooks/MyST-Parser/blob/master/sphinx/config-options">config option</a> to allow single tilde (<code>~</code>) for strikethrough by <a href="gh-user:chrisjsewell">gh-user:chrisjsewell</a> in <a href="gh-pr:1128">gh-pr:1128</a></li> <li>✨ Add <code>myst_colon_fence_exact_match</code> <a href="https://github.com/executablebooks/MyST-Parser/blob/master/sphinx/config-options">config option</a> to require the closing colon fence to have exactly the same number of colons as the opening, see <a href="https://github.com/executablebooks/MyST-Parser/blob/master/syntax/colon_fence"></a> by <a href="gh-user:chrisjsewell">gh-user:chrisjsewell</a> in <a href="gh-pr:1128">gh-pr:1128</a></li> </ul> <h3>👌 Improvements</h3> <ul> <li>👌 Update <a href="https://github.com/executablebooks/MyST-Parser/blob/master/sphinx/config-options"><code>myst_gfm_only</code></a> mode to use the unified <code>gfm_plugin</code>, which now includes GFM autolinks, alerts, and improved strikethrough/tasklist handling by <a href="gh-user:chrisjsewell">gh-user:chrisjsewell</a> in <a href="gh-pr:1128">gh-pr:1128</a></li> <li>👌 Improve MathJax 4 compatibility for Sphinx 9 by <a href="gh-user:chrisjsewell">gh-user:chrisjsewell</a> in <a href="gh-pr:1110">gh-pr:1110</a></li> <li>👌 Stop directive-option parsing at colon fences, fixing nested colon fence directives by <a href="gh-user:chrisjsewell">gh-user:chrisjsewell</a> in <a href="gh-pr:1133">gh-pr:1133</a></li> </ul> <h3>🐛 Bug Fixes</h3> <ul> <li>🐛 Use docname instead of source path in warning locations by <a href="gh-user:chrisjsewell">gh-user:chrisjsewell</a> in <a href="gh-pr:1114">gh-pr:1114</a></li> <li>🐛 Correctly encode <code>&</code> in Markdown URLs by not HTML-escaping <code>refuri</code> by <a href="gh-user:chrisjsewell">gh-user:chrisjsewell</a> in <a href="gh-pr:1126">gh-pr:1126</a></li> <li>🐛 Fix <code>RemovedInSphinx10Warning</code> for inventory item iteration by <a href="gh-user:chrisjsewell">gh-user:chrisjsewell</a> in <a href="gh-pr:1129">gh-pr:1129</a></li> <li>🐛 Pin <code>mdit-py-plugins>=0.6.1</code> for nested field list fix by <a href="gh-user:chrisjsewell">gh-user:chrisjsewell</a> in <a href="gh-pr:1134">gh-pr:1134</a></li> </ul> <h3>⬆️ Dependency Upgrades</h3> <ul> <li>⬆️ Upgrade to <code>markdown-it-py~=4.2</code> and <code>mdit-py-plugins~=0.6</code> by <a href="gh-user:chrisjsewell">gh-user:chrisjsewell</a> in <a href="gh-pr:1128">gh-pr:1128</a></li> <li>⬆️ Update pygments requirement from <code><2.20</code> to <code><2.21</code> by <a href="gh-user:chrisjsewell">gh-user:chrisjsewell</a> in <a href="gh-pr:1117">gh-pr:1117</a></li> </ul> <p><strong>Full Changelog</strong>: <a href="https://github.com/executablebooks/MyST-Parser/compare/v5.0.0...v5.1.0">v5.0.0...v5.1.0</a></p> <h2>5.0.0 - 2026-01-15</h2> <p>This release significantly bumps the supported versions of core dependencies:</p> <h3>‼️ Breaking Changes</h3> <p>This release updates the minimum supported versions:</p> <ul> <li><strong>Python</strong>: <code>>=3.11</code> (dropped Python 3.10, tests up to 3.14)</li> <li><strong>Sphinx</strong>: <code>>=8,<10</code> (dropped Sphinx 7, added Sphinx 9)</li> <li><strong>Docutils</strong>: <code>>=0.20,<0.23</code> (dropped docutils 0.19, added docutils 0.22)</li> <li><strong>markdown-it-py</strong>: <code>~=4.0</code> (upgraded from v3)</li> </ul> <h3>⬆️ Dependency Upgrades</h3> <ul> <li>⬆️ Upgrade to markdown-it-py v4 by <a href="gh-user:chrisjsewell">gh-user:chrisjsewell</a> in <a href="gh-pr:1060">gh-pr:1060</a></li> <li>⬆️ Drop Python 3.10 and Sphinx 7 by <a href="gh-user:chrisjsewell">gh-user:chrisjsewell</a> in <a href="gh-pr:1059">gh-pr:1059</a></li> <li>⬆️ Drop docutils 0.19 by <a href="gh-user:chrisjsewell">gh-user:chrisjsewell</a> in <a href="gh-pr:1061">gh-pr:1061</a></li> <li>⬆️ Add support for Python 3.14 by <a href="gh-user:chrisjsewell">gh-user:chrisjsewell</a> in <a href="gh-pr:1075">gh-pr:1075</a></li> <li>⬆️ Support Sphinx v9 by <a href="gh-user:chrisjsewell">gh-user:chrisjsewell</a> in <a href="gh-pr:1076">gh-pr:1076</a></li> <li>⬆️ Allow docutils 0.22 by <a href="gh-user:chrisjsewell">gh-user:chrisjsewell</a> in <a href="gh-pr:1084">gh-pr:1084</a></li> </ul> <!-- raw HTML omitted --> </blockquote> <p>... (truncated)</p> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/executablebooks/MyST-Parser/commit/2871eb95750873ccec2c4ab1dac0568815b64ca5"><code>2871eb9</code></a> 🚀 Release v5.1.0 (<a href="https://redirect.github.com/executablebooks/MyST-Parser/issues/1135">#1135</a>)</li> <li><a href="https://github.com/executablebooks/MyST-Parser/commit/cc5db37fd06445d7d023f7f2e0c2c073730be9cf"><code>cc5db37</code></a> 🐛 FIX: Pin mdit-py-plugins>=0.6.1 for nested field list fix (<a href="https://redirect.github.com/executablebooks/MyST-Parser/issues/1134">#1134</a>)</li> <li><a href="https://github.com/executablebooks/MyST-Parser/commit/4ce57f94af31de53c8790ccfffa3107c64241d0d"><code>4ce57f9</code></a> 👌 Stop directive-option parsing at colon fences (<a href="https://redirect.github.com/executablebooks/MyST-Parser/issues/1133">#1133</a>)</li> <li><a href="https://github.com/executablebooks/MyST-Parser/commit/cfcc3278f9e8c7508aae4cea82f1dd9c5c111183"><code>cfcc327</code></a> ⬆️ Bump mypy from 2.0.0 to 2.1.0 (<a href="https://redirect.github.com/executablebooks/MyST-Parser/issues/1131">#1131</a>)</li> <li><a href="https://github.com/executablebooks/MyST-Parser/commit/691738c3d897f82577440e18079d8b990edb8e34"><code>691738c</code></a> ⬆️ Bump ruff from 0.15.10 to 0.15.12 (<a href="https://redirect.github.com/executablebooks/MyST-Parser/issues/1132">#1132</a>)</li> <li><a href="https://github.com/executablebooks/MyST-Parser/commit/0fb1ae983d7b0df68bd02a9f77b0bc45057edbaf"><code>0fb1ae9</code></a> 👌 IMPROVE: MathJax 4 compatibility (Sphinx 9) (<a href="https://redirect.github.com/executablebooks/MyST-Parser/issues/1110">#1110</a>)</li> <li><a href="https://github.com/executablebooks/MyST-Parser/commit/f153b4b8ae68cbe77b41942147cf5cb6464168f0"><code>f153b4b</code></a> ⬆️ Bump actions/setup-python from 5 to 6 (<a href="https://redirect.github.com/executablebooks/MyST-Parser/issues/1092">#1092</a>)</li> <li><a href="https://github.com/executablebooks/MyST-Parser/commit/93acf8dae502aba484b14a1d291366fc21f839e6"><code>93acf8d</code></a> [pre-commit.ci] pre-commit autoupdate (<a href="https://redirect.github.com/executablebooks/MyST-Parser/issues/1095">#1095</a>)</li> <li><a href="https://github.com/executablebooks/MyST-Parser/commit/a5f1d6963bc3ee361d25309a24ccc42e6860fd54"><code>a5f1d69</code></a> ⬆️ Update pygments requirement from <2.20 to <2.21 (<a href="https://redirect.github.com/executablebooks/MyST-Parser/issues/1117">#1117</a>)</li> <li><a href="https://github.com/executablebooks/MyST-Parser/commit/838129687219517e31a395736397c957d93532dd"><code>8381296</code></a> 🐛 FIX: Use docname instead of source path in warning locations (<a href="https://redirect.github.com/executablebooks/MyST-Parser/issues/1114">#1114</a>)</li> <li>Additional commits viewable in <a href="https://github.com/executablebooks/MyST-Parser/compare/v4.0.1...v5.1.0">compare view</a></li> </ul> </details> <br /> [](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) </details> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…ib#3924) Bumps [astral-sh/setup-uv](https://github.com/astral-sh/setup-uv) from 8.3.0 to 8.3.2. <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/astral-sh/setup-uv/commit/11f9893b081a58869d3b5fccaea48c9e9e46f990"><code>11f9893</code></a> chore: roll up Dependabot updates (<a href="https://redirect.github.com/astral-sh/setup-uv/issues/948">#948</a>)</li> <li><a href="https://github.com/astral-sh/setup-uv/commit/f79855603231e1609d02bec6956bd0e05cbc46b5"><code>f798556</code></a> docs: update version references to v8.3.1 (<a href="https://redirect.github.com/astral-sh/setup-uv/issues/946">#946</a>)</li> <li><a href="https://github.com/astral-sh/setup-uv/commit/e80544d808267c93733c3fd1e2c8c65e0c8707d6"><code>e80544d</code></a> chore: update known checksums for 0.11.28 (<a href="https://redirect.github.com/astral-sh/setup-uv/issues/947">#947</a>)</li> <li><a href="https://github.com/astral-sh/setup-uv/commit/f98e06938123ccabd21905ea5d0069192241f9f1"><code>f98e069</code></a> Change update-docs PR labels from 'update-docs' to 'documentation' (<a href="https://redirect.github.com/astral-sh/setup-uv/issues/945">#945</a>)</li> <li><a href="https://github.com/astral-sh/setup-uv/commit/cd462639a967553a16241af35461402a96978d48"><code>cd46263</code></a> chore: update known checksums for 0.11.27 (<a href="https://redirect.github.com/astral-sh/setup-uv/issues/944">#944</a>)</li> <li><a href="https://github.com/astral-sh/setup-uv/commit/11245c7e122cd1c2297e8115d1e43fe1570f6270"><code>11245c7</code></a> docs: update version references to v8.3.0 (<a href="https://redirect.github.com/astral-sh/setup-uv/issues/939">#939</a>)</li> <li>See full diff in <a href="https://github.com/astral-sh/setup-uv/compare/v8.3.0...v8.3.2">compare view</a></li> </ul> </details> <br /> [](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) </details> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…ib#3935) This fixes the normalization function to return correctly normalized file URLs which is the minimum that we need to get absolute file URLs handled correctly. Related bazel-contrib#3312 --------- Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
…atch promotion (bazel-contrib#3936) Adds automated workflow and tooling support for multi-version backports and support direct patch release promotion. Previously, backports required manual preparation and tracking across multiple branches, and patch releases were promoted as RCs instead of direct patch releases. This change: * Adds backport_prepare and backport_create_releases scripts and GitHub Action workflows to track and automate cherry-picking PRs across multiple minor release branches. * Renames promote_rc to promote to support promoting patch releases directly. * Refactors release tools to use BackportMetadata dataclass and propagate errors with context (add_note). * Updates RELEASING.md documentation.
…rib#3931) This implements a pytest_test rule based upon the pytest_bazel library. The core implementation of this is fairly simple: a file is generated that calls `pytest.main()` with the `srcs` to test. This generated file is the file that is run by `py_test`. For now, this is kept under tests/support soas to use it for our own tests while some design decisions are figured out. Work towards bazel-contrib#3594
This was breaking rules_python CI with Bazel 9.0.0. @aranguyen and I made some changes that we thought would resolve in 9.1.0 or 9.2.0. The repro I tried on 9.0.0 now passes: Tested: ``` USE_BAZEL_VERSION=9.0.0 bazelisk build --nobuild //tests/py_zipapp:system_python_zipapp ERROR: Analysis of target '//tests/py_zipapp:system_python_zipapp' failed; build aborted: no such package '@@rules_python//python/config_settings': The repository '@@rules_python' could not be resolved: Repository '@@rules_python' is not defined ``` ``` USE_BAZEL_VERSION=9.2.0 bazelisk build --nobuild //tests/py_zipapp:system_python_zipapp INFO: Build completed successfully, 0 total actions ``` References: - bazel-contrib#3450 (comment) - bazel-contrib#3450 (comment) --------- Co-authored-by: Richard Levasseur <richardlev@gmail.com>
…est-mock (bazel-contrib#3937) Migrates release tool unit tests under `tests/tools/private/release/` to Pytest and Pytest-mock (`mocker` fixture). - Added `pytest-mock` dependency to `docs/pyproject.toml`, updated `docs/uv.lock` & `docs/requirements.txt`, and added `@pypi//pytest_mock` to release test helper `deps`. - Converted release test targets from standard unittest to pytest fixtures. - Refactored tests to use the standard `mocker` fixture from `pytest-mock`.
…zel-contrib#3940) Factor out PyPI publishing from release_publish.yaml into a new standalone workflow publish_pypi.yaml. This enables PyPI publishing to be manually executed via workflow_dispatch while maintaining the ability to be invoked by release_publish.yaml during release execution.
…#3941) Update RELEASING.md to clarify that rickeylev manages the PyPI account, while Google retains recovery access via recovery codes and the rules-python-pypi@google.com email address.
) > [!NOTE] > I created this PR with AI. Fixes bazel-contrib#3934. ## Problem `pip.parse(uv_lock = ...)` exposes every `[[package]]` in the lock, including uv workspace/root members with `source = { virtual = "." }` (and editable installs). These resolve to no wheel/sdist (`srcs = []`) but were still marked `is_exposed = True`, so the hub adds them to `all_requirements` / `all_whl_requirements` and creates an alias to a subpackage that doesn't exist. Anything enumerating the full set then fails analysis, e.g. `modules_mapping(wheels = all_whl_requirements)`: ``` ERROR: no such package '@@rules_python++pip+pip//myproject': BUILD file not found ... and referenced by '//:modules_map' ``` ## Fix `_parse_uv_lock_json` in `python/private/pypi/parse_requirements.bzl` set `is_exposed = True` unconditionally. This gates it on whether the package actually resolved to any sources: ```starlark is_exposed = bool(info["resolved_srcs"]), ``` The entry is still kept; it just isn't exposed when nothing resolved. This mirrors the requirements path, which already gates `is_exposed`. ## Tests As called out in the issue, this flips the expectations in two existing tests, both of which assert on source-less packages: - `_test_uv_lock_primary_source_includes_virtual` (the `virtual_pkg` entry) - `_test_uv_lock_requires_dist_extras` (the `root_pkg` entry) Both now expect `is_exposed = False`. A `news/3934.fixed.md` fragment is included.
...and sycophantic toasters are bad collaborators
…el-contrib#3851) This builds on the existing `py-extension` branch. It adds support for platform and abi tags in the resulting library filename. The `:py_extension_test`, `:py_extension_analysis_tests`, and `:py_limited_api_tests` test targets in `//tests/cc/py_extension` now build and pass. Relates to bazel-contrib#3283
…tension (bazel-contrib#3875) Per feedback from bazel-contrib#3851, this PR re-works the platform detection logic to rely on platform constraints instead of the Python runtime/toolchain. ### Description This PR contains updates to the experimental `py_extension` implementation. It re-works the platform tag detection to rely on modern platform constraints, and refactors the compilation and linking mechanism to delegate to Bazel's native `cc_shared_library` and `cc_library` rules. This PR targets the main repository's `py-extension` branch (not `main`). ### Key Changes #### 1. Platform Tag & ABI Tag Derivation * **Introduced `abi_tag` to `PyCcToolchainInfo`**: Added the `abi_tag` field to the `PyCcToolchainInfo` provider, populated by the `py_cc_toolchain` rule. It defaults to deriving the tag from `python_version` (e.g. `cpython-311`) for backward compatibility. * **Constraint-Based Detection**: Replaced legacy parsing of `cc_toolchain` CPU names with direct lookup in rules_python's central `PLATFORMS` registry using platform constraints. * **Limited API Configuration**: Updated how limited API (`.abi3.so`) suffixes are appended based on the toolchain configuration. #### 2. Compilation & Linking Delegation (Refactor to `cc_shared_library`) * **Macro Fusion**: Replaced the custom linking logic in the `py_extension` rule with a macro of the same name. It now accepts C/C++ source/header files directly (`srcs`, `hdrs`, `copts`, `defines`), implicitly wrapping them in a private `cc_library` under the hood. * **Consolidated Attributes**: Consolidated static linkage under standard `deps` (removing the redundant `static_deps` attribute) and aligned linker arguments with `cc_shared_library`'s `user_link_flags`. * **Wrapper Rule (`_py_extension_wrapper`)**: Added a lightweight, private rule that wraps the `cc_shared_library` output to: * Query the Python toolchain for platform/ABI tags to resolve PEP 3149 compliant filenames (e.g. `.cpython-311-x86_64-linux-gnu.so` or `.abi3.so`). * Create a cheap `symlink` from the CSL output to the PEP 3149 name. * Propagate `PyInfo` (for python rules) and `CcSharedLibraryInfo` (for dynamic C++ dependencies). * **ODR Validation**: Leveraging native `cc_shared_library` ensures strict analysis-time validation against One Definition Rule (ODR) violations (e.g., duplicate static linkage in dynamic chains). #### 3. Runfiles and Data Support * **Runfiles Propagation**: Re-implemented runfiles collection using the repository's standard `builders.RunfilesBuilder` to support runtime assets (`data` attribute) and dynamic library dependency propagation. ### Verification & Testing * Added parity test cases in `dependency_graph_tests.bzl` to verify dynamic dependency chains and static sharing behavior. * Added runfiles validation in `py_extension_tests.bzl` to verify data asset propagation. * Updated limited API tests to match CSL output structure. * All 14 tests in `//tests/cc/py_extension/...` are compiling and passing. ────── TAG=agy CONV=23f8a5e8-2d99-401a-9903-1256b7d42b0e --------- Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
rsartor-cmd
force-pushed
the
py-extension
branch
from
July 21, 2026 02:51
549bc49 to
ae12049
Compare
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 PR introduces a new rule,
py_extension, used for building C extensions. For now, the macro and rule are sufficiently developed forpy_extension_testto build and pass, though work remains to be done for them to be production-ready.bazel-contrib#3283