build(deps-user): Bump the "user-facing" group with 1 update across multiple ecosystems (#4345) Bumps the user-facing group with 2 updates in the /tools directory: [pycparser](https://github.com/eliben/pycparser) and [zipp](https://github.com/jaraco/zipp). Bumps the user-facing group with 2 updates in the /tools/publish directory: [pycparser](https://github.com/eliben/pycparser) and [zipp](https://github.com/jaraco/zipp). Updates `pycparser` from 3.11 to 3.12 <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/eliben/pycparser/releases">pycparser's releases</a>.</em></p> <blockquote> <h2>release_v3.12</h2> <h2>What's Changed</h2> <ul> <li>Emit one type definition for declarators that share it by <a href="https://github.com/Cherith1222"><code>@Cherith1222</code></a> in <a href="https://redirect.github.com/eliben/pycparser/pull/621">eliben/pycparser#621</a></li> <li>raise ParseError for _Atomic applied to array or function type by <a href="https://github.com/arfa-21"><code>@arfa-21</code></a> in <a href="https://redirect.github.com/eliben/pycparser/pull/623">eliben/pycparser#623</a></li> <li>Fix code generation for the _Pragma operator by <a href="https://github.com/hulkbig"><code>@hulkbig</code></a> in <a href="https://redirect.github.com/eliben/pycparser/pull/625">eliben/pycparser#625</a></li> <li>Parse GNU statement expressions as primary expressions by <a href="https://github.com/hulkbig"><code>@hulkbig</code></a> in <a href="https://redirect.github.com/eliben/pycparser/pull/628">eliben/pycparser#628</a></li> <li>Fix shared type declarations in switch cases by <a href="https://github.com/hulkbig"><code>@hulkbig</code></a> in <a href="https://redirect.github.com/eliben/pycparser/pull/630">eliben/pycparser#630</a></li> <li>raise ParseError for typedef in a parameter declaration by <a href="https://github.com/arfa-21"><code>@arfa-21</code></a> in <a href="https://redirect.github.com/eliben/pycparser/pull/631">eliben/pycparser#631</a></li> <li>Scope for loop init declarations to the loop by <a href="https://github.com/arfa-21"><code>@arfa-21</code></a> in <a href="https://redirect.github.com/eliben/pycparser/pull/634">eliben/pycparser#634</a></li> </ul> <p><strong>Full Changelog</strong>: <a href="https://github.com/eliben/pycparser/compare/release_v3.11...release_v3.12">https://github.com/eliben/pycparser/compare/release_v3.11...release_v3.12</a></p> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/eliben/pycparser/commit/3ec766b7cd94724cba714296509604597ea4ce4e"><code>3ec766b</code></a> Tweak build</li> <li><a href="https://github.com/eliben/pycparser/commit/1771cbfba8e2f3263cf7b71680ae08ae1d221ddb"><code>1771cbf</code></a> Prepare to release 3.12</li> <li><a href="https://github.com/eliben/pycparser/commit/51715bf94082db03718632fffe4dc0dad04ab1bd"><code>51715bf</code></a> Add documentation on using methods of ast node</li> <li><a href="https://github.com/eliben/pycparser/commit/878c289076330178393ea49726d7cd0aba00dbac"><code>878c289</code></a> Support va_arg properly</li> <li><a href="https://github.com/eliben/pycparser/commit/840fe55e46df0d8ba956057a286526b107a694ec"><code>840fe55</code></a> Add some Linux kernel headers to benchmark</li> <li><a href="https://github.com/eliben/pycparser/commit/8fd2299bef4c23f47430e0f48773f231ccc44b69"><code>8fd2299</code></a> Add ArrayDesignator AST node to distinguish array indices in designators</li> <li><a href="https://github.com/eliben/pycparser/commit/aa32af5fb29f0a1df7266be1203afc6c283c1c3a"><code>aa32af5</code></a> Fix crashes in generator with empty case bodies</li> <li><a href="https://github.com/eliben/pycparser/commit/f29e8ef2bc74b714c41afaccc883b9f86d7bc877"><code>f29e8ef</code></a> Regression test for <a href="https://redirect.github.com/eliben/pycparser/issues/215">#215</a></li> <li><a href="https://github.com/eliben/pycparser/commit/a74aa748e751dc3d804055cbbbec7473c8b87492"><code>a74aa74</code></a> Support form feed and vertical tabs as whitespace</li> <li><a href="https://github.com/eliben/pycparser/commit/02380d0a208498e8be52c14669dd227a6473b588"><code>02380d0</code></a> Comment fixes</li> <li>Additional commits viewable in <a href="https://github.com/eliben/pycparser/compare/release_v3.11...release_v3.12">compare view</a></li> </ul> </details> <br /> Updates `zipp` from 4.1.1 to 4.1.2 <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/jaraco/zipp/blob/main/NEWS.rst">zipp's changelog</a>.</em></p> <blockquote> <h1>v4.1.2</h1> <p>No significant changes.</p> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/jaraco/zipp/commit/7dff8866814185a7e0161f83768247e4339f5da1"><code>7dff886</code></a> Finalize</li> <li><a href="https://github.com/jaraco/zipp/commit/450ce6d66ab5b51e17433eb1145020a315de2f60"><code>450ce6d</code></a> Merge pull request <a href="https://redirect.github.com/jaraco/zipp/issues/165">#165</a> from jaraco/debt/port-cpython-test-changes</li> <li><a href="https://github.com/jaraco/zipp/commit/7a877ce845fe549574efef86e7aedbc7571c3c15"><code>7a877ce</code></a> Add an enterContext shim for Python 3.10.</li> <li><a href="https://github.com/jaraco/zipp/commit/b710a370065f9d52ee2251deb1933c84065a29cb"><code>b710a37</code></a> <a href="https://redirect.github.com/jaraco/zipp/issues/81954">gh-81954</a>: Warn when ZipFile is closed with unwritten data (<a href="https://redirect.github.com/jaraco/zipp/issues/152354">#152354</a>)</li> <li><a href="https://github.com/jaraco/zipp/commit/f59d511d0cdc1236fe4dfce1e556133d927a87b9"><code>f59d511</code></a> <a href="https://redirect.github.com/jaraco/zipp/issues/137589">gh-137589</a>: Zipfile tests: close file objects (<a href="https://redirect.github.com/jaraco/zipp/issues/138080">GH-138080</a>)</li> <li><a href="https://github.com/jaraco/zipp/commit/45585fcc03224c2beb0ce25dd9b7e5ccb337090e"><code>45585fc</code></a> Doc: More duplicate word fixes (<a href="https://redirect.github.com/jaraco/zipp/issues/136299">GH-136299</a>)</li> <li>See full diff in <a href="https://github.com/jaraco/zipp/compare/v4.1.1...v4.1.2">compare view</a></li> </ul> </details> <br /> Updates `pycparser` from 3.11 to 3.12 <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/eliben/pycparser/releases">pycparser's releases</a>.</em></p> <blockquote> <h2>release_v3.12</h2> <h2>What's Changed</h2> <ul> <li>Emit one type definition for declarators that share it by <a href="https://github.com/Cherith1222"><code>@Cherith1222</code></a> in <a href="https://redirect.github.com/eliben/pycparser/pull/621">eliben/pycparser#621</a></li> <li>raise ParseError for _Atomic applied to array or function type by <a href="https://github.com/arfa-21"><code>@arfa-21</code></a> in <a href="https://redirect.github.com/eliben/pycparser/pull/623">eliben/pycparser#623</a></li> <li>Fix code generation for the _Pragma operator by <a href="https://github.com/hulkbig"><code>@hulkbig</code></a> in <a href="https://redirect.github.com/eliben/pycparser/pull/625">eliben/pycparser#625</a></li> <li>Parse GNU statement expressions as primary expressions by <a href="https://github.com/hulkbig"><code>@hulkbig</code></a> in <a href="https://redirect.github.com/eliben/pycparser/pull/628">eliben/pycparser#628</a></li> <li>Fix shared type declarations in switch cases by <a href="https://github.com/hulkbig"><code>@hulkbig</code></a> in <a href="https://redirect.github.com/eliben/pycparser/pull/630">eliben/pycparser#630</a></li> <li>raise ParseError for typedef in a parameter declaration by <a href="https://github.com/arfa-21"><code>@arfa-21</code></a> in <a href="https://redirect.github.com/eliben/pycparser/pull/631">eliben/pycparser#631</a></li> <li>Scope for loop init declarations to the loop by <a href="https://github.com/arfa-21"><code>@arfa-21</code></a> in <a href="https://redirect.github.com/eliben/pycparser/pull/634">eliben/pycparser#634</a></li> </ul> <p><strong>Full Changelog</strong>: <a href="https://github.com/eliben/pycparser/compare/release_v3.11...release_v3.12">https://github.com/eliben/pycparser/compare/release_v3.11...release_v3.12</a></p> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/eliben/pycparser/commit/3ec766b7cd94724cba714296509604597ea4ce4e"><code>3ec766b</code></a> Tweak build</li> <li><a href="https://github.com/eliben/pycparser/commit/1771cbfba8e2f3263cf7b71680ae08ae1d221ddb"><code>1771cbf</code></a> Prepare to release 3.12</li> <li><a href="https://github.com/eliben/pycparser/commit/51715bf94082db03718632fffe4dc0dad04ab1bd"><code>51715bf</code></a> Add documentation on using methods of ast node</li> <li><a href="https://github.com/eliben/pycparser/commit/878c289076330178393ea49726d7cd0aba00dbac"><code>878c289</code></a> Support va_arg properly</li> <li><a href="https://github.com/eliben/pycparser/commit/840fe55e46df0d8ba956057a286526b107a694ec"><code>840fe55</code></a> Add some Linux kernel headers to benchmark</li> <li><a href="https://github.com/eliben/pycparser/commit/8fd2299bef4c23f47430e0f48773f231ccc44b69"><code>8fd2299</code></a> Add ArrayDesignator AST node to distinguish array indices in designators</li> <li><a href="https://github.com/eliben/pycparser/commit/aa32af5fb29f0a1df7266be1203afc6c283c1c3a"><code>aa32af5</code></a> Fix crashes in generator with empty case bodies</li> <li><a href="https://github.com/eliben/pycparser/commit/f29e8ef2bc74b714c41afaccc883b9f86d7bc877"><code>f29e8ef</code></a> Regression test for <a href="https://redirect.github.com/eliben/pycparser/issues/215">#215</a></li> <li><a href="https://github.com/eliben/pycparser/commit/a74aa748e751dc3d804055cbbbec7473c8b87492"><code>a74aa74</code></a> Support form feed and vertical tabs as whitespace</li> <li><a href="https://github.com/eliben/pycparser/commit/02380d0a208498e8be52c14669dd227a6473b588"><code>02380d0</code></a> Comment fixes</li> <li>Additional commits viewable in <a href="https://github.com/eliben/pycparser/compare/release_v3.11...release_v3.12">compare view</a></li> </ul> </details> <br /> Updates `zipp` from 4.1.1 to 4.1.2 <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/jaraco/zipp/blob/main/NEWS.rst">zipp's changelog</a>.</em></p> <blockquote> <h1>v4.1.2</h1> <p>No significant changes.</p> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/jaraco/zipp/commit/7dff8866814185a7e0161f83768247e4339f5da1"><code>7dff886</code></a> Finalize</li> <li><a href="https://github.com/jaraco/zipp/commit/450ce6d66ab5b51e17433eb1145020a315de2f60"><code>450ce6d</code></a> Merge pull request <a href="https://redirect.github.com/jaraco/zipp/issues/165">#165</a> from jaraco/debt/port-cpython-test-changes</li> <li><a href="https://github.com/jaraco/zipp/commit/7a877ce845fe549574efef86e7aedbc7571c3c15"><code>7a877ce</code></a> Add an enterContext shim for Python 3.10.</li> <li><a href="https://github.com/jaraco/zipp/commit/b710a370065f9d52ee2251deb1933c84065a29cb"><code>b710a37</code></a> <a href="https://redirect.github.com/jaraco/zipp/issues/81954">gh-81954</a>: Warn when ZipFile is closed with unwritten data (<a href="https://redirect.github.com/jaraco/zipp/issues/152354">#152354</a>)</li> <li><a href="https://github.com/jaraco/zipp/commit/f59d511d0cdc1236fe4dfce1e556133d927a87b9"><code>f59d511</code></a> <a href="https://redirect.github.com/jaraco/zipp/issues/137589">gh-137589</a>: Zipfile tests: close file objects (<a href="https://redirect.github.com/jaraco/zipp/issues/138080">GH-138080</a>)</li> <li><a href="https://github.com/jaraco/zipp/commit/45585fcc03224c2beb0ce25dd9b7e5ccb337090e"><code>45585fc</code></a> Doc: More duplicate word fixes (<a href="https://redirect.github.com/jaraco/zipp/issues/136299">GH-136299</a>)</li> <li>See full diff in <a href="https://github.com/jaraco/zipp/compare/v4.1.1...v4.1.2">compare view</a></li> </ul> </details> <br /> 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 <dependency name> major version` will close this group update PR and stop Dependabot creating any more for the specific dependency's major version (unless you unignore this specific dependency's major version or upgrade to it yourself) - `@dependabot ignore <dependency name> minor version` will close this group update PR and stop Dependabot creating any more for the specific dependency's minor version (unless you unignore this specific dependency's minor version or upgrade to it yourself) - `@dependabot ignore <dependency name>` will close this group update PR and stop Dependabot creating any more for the specific dependency (unless you unignore this specific dependency or upgrade to it yourself) - `@dependabot unignore <dependency name>` will remove all of the ignore conditions of the specified dependency - `@dependabot unignore <dependency name> <ignore condition>` will remove the ignore condition of the specified dependency and ignore conditions </details> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
This repository is the home of the core Python rules -- py_library, py_binary, py_test, and related symbols that provide the basis for Python support in Bazel. It also contains package installation rules for integrating with PyPI and other indices.
Documentation for rules_python is at https://rules-python.readthedocs.io and in the Bazel Build Encyclopedia.
Examples live in the examples directory.
The core rules are stable. Their implementation is subject to Bazel's backward compatibility policy. This repository aims to follow semantic versioning.
The Bazel community maintains this repository. Neither Google nor the Bazel team provides support for the code. However, this repository is part of the test suite used to vet new Bazel releases. See How to contribute page for information on our development workflow.
requirements.txt is how users have been defining dependencies for a long time. We support this to support legacy usecases or package managers that we don't support directly. Any additional information that we need will be retrieved from the SimpleAPI during the bzlmod extension evaluation phase. Then it will be written to the MODULE.bazel.lock file for future reuse. We have plans to support uv.lock file directly. uv is recommended for generating a fully locked requirements.txt file and we do provide a rule for it.py_binary, py_test rules should scale to large monorepos and we work hard to minimize the work done during analysis and build phase. What is more, the space requirements for should be minimal, so we strive to use symlinks rather than extracting wheels at build time. This means that for different configurations of the same build, we are not extracting the wheel multiple times thus scaling better over the time. From 2.0 onwards we are creating a virtual env for each target by creating an actual minimal virtual environment using symlinks. We plan on creating the traditional site-packages layout in the future by default.rules_python and this has resulted in a few PEPs supported within pure starlark - PEP440, PEP509.Common misconceptions:
rules_python has to keep backwards compatibility with google3. Whilst this might have been true in the past, rules_python is an open source project and any compatibility needs should come from the community - we have no requirement to keep this compatibility and are allowed to make our decisions. However, we do want to keep backwards compatibility as long as possible to not upset users with never ending migrations.rules_python is not caching pip downloads. With 2.0, we use Bazel's downloader by default and rely on bazel to provide the repository caching mechanisms. This means that for simpler setups this should result in transparent and scalable caching with the most recent bazel versions unless there are issues in the bazel itself.For detailed documentation, see https://rules-python.readthedocs.io
See Bzlmod support for more details.