Repository navigation
2.4.0-rc0
Pre-release
Pre-release
For more detailed setup instructions, see https://rules-python.readthedocs.io/en/latest/getting-started.html
For the user-facing changelog see here
Using Bzlmod
Add to your MODULE.bazel file:
bazel_dep(name = "rules_python", version = "2.4.0-rc0")
python = use_extension("@rules_python//python/extensions:python.bzl", "python")
python.toolchain(
python_version = "3.14",
)
pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip")
pip.parse(
hub_name = "pypi",
python_version = "3.14",
requirements_lock = "//:requirements_lock.txt",
)
use_repo(pip, "pypi")Using WORKSPACE
Paste this snippet into your WORKSPACE file:
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "rules_python",
sha256 = "2e600c6842f47e21fcc2d7df32c5a6430c54bd7f5489e40408bc11903eeb11ce",
strip_prefix = "rules_python-2.4.0-rc0",
url = "https://github.com/bazel-contrib/rules_python/releases/download/2.4.0-rc0/rules_python-2.4.0-rc0.tar.gz",
)
load("@rules_python//python:repositories.bzl", "py_repositories")
py_repositories()Gazelle plugin
Paste this snippet into your WORKSPACE file:
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "rules_python_gazelle_plugin",
sha256 = "2e600c6842f47e21fcc2d7df32c5a6430c54bd7f5489e40408bc11903eeb11ce",
strip_prefix = "rules_python-2.4.0-rc0/gazelle",
url = "https://github.com/bazel-contrib/rules_python/releases/download/2.4.0-rc0/rules_python-2.4.0-rc0.tar.gz",
)
# To compile the rules_python gazelle extension from source,
# we must fetch some third-party go dependencies that it uses.
load("@rules_python_gazelle_plugin//:deps.bzl", _py_gazelle_deps = "gazelle_deps")
_py_gazelle_deps()What's Changed
- chore(release): add release-prepared label to prepare PRs by @rickeylev in #4015
- refactor(tests): convert legacy py_extension in local_toolchains to official rule by @rickeylev in #3988
- chore(release): support manual dispatch and /prepare-complete for complete prepare workflow by @rickeylev in #4016
- chore(release): invoke create release branch from prepare complete and support /create-release-branch by @rickeylev in #4017
- agents: optimize rules and clarify create-pr subagent requirements by @rickeylev in #4018
- agents: document Windows machine normalization and SOABI support by @rickeylev in #4019
- build(deps): bump cryptography from 49.0.0 to 50.0.0 in /tools/publish by @dependabot[bot] in #3995
- agents: add merge queue CI monitoring and lockfile sync rules by @rickeylev in #4021
- agents(rules): document linking external objects in TypedDict docstrings by @rickeylev in #4022
- agents: rename pre-review-audit to review-code and add news file checks by @rickeylev in #4027
- feat(runfiles): add CreateOrRaise API by @rickeylev in #4028
- build(dev): bump dev requirements python version to 3.10 by @rickeylev in #4024
- agents(rules): document git push -u guardrail and delegating function docstrings by @rickeylev in #4030
- agents: document dev python version bump and merge queue fields by @rickeylev in #4031
- build(deps): bump packaging from 26.2 to 26.3 in /tools/publish by @dependabot[bot] in #4032
- build(deps): bump cffi from 2.1.0 to 2.1.1 in /tools/publish by @dependabot[bot] in #4033
- build(pyrefly): enable Pyrefly static type checking across Python targets by @rickeylev in #4020
- fix: preserve arguments with spaces by @stanbot8 in #4026
- agents(rules): update python rules with typing and runfiles conventions by @rickeylev in #4035
- feat(bzlmod): make init.py generation configurable module-wide by @armandomontanez in #3997
- build(ci): remove legacy mypy type checking workflow and comments by @rickeylev in #4036
- agents(analyze-ci-failure): enhance network reset and macOS sandbox flake detection by @rickeylev in #4037
- fix(pypi): rewrite RECORD file entries for extracted .data contents by @rickeylev in #4025
- fix(pypi): resolve self-referencing extras to a real fixed point by @muravev-vasilii in #4039
- agents(rules): add Starlark dict union and Pyrefly PackagePath conventions by @rickeylev in #4038
- fix(pypi): do not return rctx.metadata for pip_archive by @aignas in #4043
- refactor(release): move on_comment workflow logic into Python script by @rickeylev in #4045
- workflows: auto-create patch release tracking issue on /backport by @rickeylev in #4046
- agents(rules): update github_actions_workflows rule with python script and testing conventions by @rickeylev in #4047
- agents(review-code): export review results artifact and factor report format by @rickeylev in #4048
- workflows(release): support /backport comment on release tracking issue and pr by @rickeylev in #4050
- workflows(release): remove non-patch release tasks from patch release issues by @rickeylev in #4051
- tests: use runfiles.CreateOrRaise in release_test_helper by @rickeylev in #4052
- agents: clarify commit and PR type conventions in pr.md by @rickeylev in #4055
- workflow(release): surface subprocess output and improve error handling in backport operations by @rickeylev in #4056
- agents: add workflow type convention and python exception rules by @rickeylev in #4057
- refactor: split code into multiple files by @aignas in #4044
- chore(release): sync changelog and version markers for 2.3 backports by @rickeylev in #4058
- feat(sphinxdocs): make SphinxDocsLibraryInfo provider public by @JoHoenk in #4041
- agents(starlark): document depset element immutability and provider conventions by @rickeylev in #4060
- build(release): add process-news command with PR and version marker support by @rickeylev in #4062
- agents: refine commit type definitions and interface docstring rules by @rickeylev in #4063
- agents: update review-code skill to initialize and update artifact on responses by @rickeylev in #4066
- test(pytest): support python_versions in pytest_test macro by @rickeylev in #4064
- agents: add native.test_suite API tag invariant rule by @rickeylev in #4068
- build(release): separate sync changelog into standalone workflow and CLI tool by @rickeylev in #4067
- agents: update CI soft-fail handling and GHA event parsing rules by @rickeylev in #4069
- tests(runfiles): migrate runfiles tests to pytest_test by @rickeylev in #4061
- workflows: make on_pr_closed.py executable and add permissions test by @rickeylev in #4076
- build(deps): bump astral-sh/setup-uv from 9.0.0 to 10.0.1 by @dependabot[bot] in #4072
- build(deps): bump actions/setup-python from 5 to 7 by @dependabot[bot] in #4074
- build(deps): bump charset-normalizer from 3.4.9 to 3.5.0 in /tools/publish by @dependabot[bot] in #4073
- build(deps): bump bazel-contrib/publish-to-bcr/.github/workflows/publish.yaml from 1.4.2 to 1.5.0 by @dependabot[bot] in #4075
- agents: document rf.root() path navigation and Runfiles.CreateOrRaise() in python rules by @rickeylev in #4078
- fix(py_test): fix Windows crash in
py_testmain validation by @rdesgroppes in #4079 - agents: document direct integration test execution in testing rules by @rickeylev in #4080
- workflows: grant pull-requests write to release_process_backports by @rickeylev in #4081
- fix(pypi): drop unsupported args in the whl_library macro by @aignas in #4083
- fix(toolchain): fix crash on Windows when precompiling is enabled by @rdesgroppes in #4082
- fix(pypi): handle revisions in uv.lock Git sources by @henriquejsza in #4086
- fix(windows): use extended paths in Python bootstraps by @belitskiy in #4071
- fix(pypi): support source-less wheels with dependencies by @hartikainen in #4054
- chore: cherry-pick 2.3.2 changelog prep by @aignas in #4090
- agents: document Windows extended path rules and test organization by @rickeylev in #4092
- build(release): remove patch release template and streamline backport workflow by @rickeylev in #4093
- agents: specify docs and build(release) commit types by @rickeylev in #4095
- build: upgrade Python 3.9 usages across dev tools, examples, and tests by @rickeylev in #4094
- chore: remove unused rules in whl_library_targets by @aignas in #4087
- build(deps): bump the pip group across 3 directories with 7 updates by @dependabot[bot] in #4096
- build(deps): bump the pip group across 5 directories with 5 updates by @dependabot[bot] in #4097
- build(deps): bump the uv group across 5 directories with 5 updates by @dependabot[bot] in #4098
- agents: add lockfile and dependency bump rule by @rickeylev in #4103
- refactor(pypi): split whl_library_targets by @aignas in #4101
- chore: migrate requirements.in files to pyproject.toml by @rickeylev in #4099
- fix(runfiles): update Path method signatures for Python 3.14 compatibility and fix match() by @rickeylev in #4100
- build(deps): bump the pip group across 1 directory with 3 updates by @dependabot[bot] in #4102
- agents: add constraint synchronization rule for dependency bumps by @rickeylev in #4107
- agents: document runtime version checks and multi-version pytest_test bzlmod rules by @rickeylev in #4108
- agents: add Windows lockfile migration and Gazelle manifest rules by @rickeylev in #4109
- fix: various fixes for the deps library by @aignas in #4106
- agents: add external PR push guidance, refactor commit type, and fix news frontmatter by @rickeylev in #4112
- feat(pypi): allow defining deps in through pkg_aliases macro by @aignas in #4105
- fix(precompile): skip precompilation for directory and pyc inputs in srcs by @rickeylev in #4113
- agents: add VERSION_NEXT_PATCH docs rule and Strunk & White PR guidelines by @rickeylev in #4116
- fix(pypi): append .bat extension for rewritten shebang scripts in RECORD on Windows by @rickeylev in #4114
- agents: add Windows shebang RECORD rewriting and PR metadata discrepancy rules by @rickeylev in #4118
- feat(gazelle): support generic manifest lockfiles by @anisayakmitra-in in #4117
- feat: Update CPython 3.15.0 from -a8 to -rc1. by @hawkinsp in #4122
- fix(zipapp): guard against null runtime files by @rickeylev in #4119
- fix: generate publish wheels for target platforms by @tomatotomata in #4007
- agents: add sync-git-branch-continuously skill by @rickeylev in #4126
- agents: remove _bzl suffix requirement for bzl_library targets by @rickeylev in #4131
- fix(venv_shebang_rewriter): avoid depending on host coreutils by @nicdumz in #4125
- docs(support): document nix as a tier 2 platform by @rickeylev in #4130
- refactor(config_settings): remove unused private distribution target by @rickeylev in #4129
- fix(gazelle): fix module map for old-style namespaces by @gholms in #4135
- agents: update news and PR conventions by @rickeylev in #4138
- chore: update default Python version to 3.14 by @rickeylev in #4023
- refactor: move tools/private/zipapp to tools/zipapp by @rickeylev in #4127
- build: configure repository cache in .bazelrc by @rickeylev in #4137
- feat(uv): add --directory support for locking by @aignas in #4029
- build(deps): bump pip from 26.1.2 to 26.2 in /examples/wheel in the pip group across 1 directory by @dependabot[bot] in #4136
- build(deps): bump pip from 26.1.2 to 26.2 in /examples/wheel in the uv group across 1 directory by @dependabot[bot] in #4140
- build(tools): remove reviewbot tool and workflow by @rickeylev in #4142
- feat: Add win32 versions by @rsartor-cmd in #4141
- build: move requirements update multirun from //private to //dev by @rickeylev in #4143
- fix(bootstrap): remap stdlib sys.path entries to runfiles during site init by @rickeylev in #4104
- build(dev): remove unused requirements update aliases by @rickeylev in #4144
- build(release): allow process-news to create missing release sections by @rickeylev in #4145
- docs(release): document sync-changelog command in template and guide by @rickeylev in #4148
- chore(release): sync changelog for v2.3.3 backports by @github-actions[bot] in #4147
- agents: add conversation-done skill by @rickeylev in #4150
- build(dev): move internal dev tools from //tools/private to //dev by @rickeylev in #4149
- refactor: introduce helper for defining distribution filegroups by @rickeylev in #4152
- build(dev): move release management tooling from //tools/private to //dev by @rickeylev in #4153
- fix(bzlmod): convert coverage_tool Label to string by @kocolosk in #4157
- refactor(zipapp): implement rust exe_zip_maker program by @rickeylev in #4151
- refactor(toolchains): share Python version config settings by @dzbarsky in #4159
- fix(stamping): skip build data spawn when --stamp=false by @alloveras in #4160
- fix(cc): include toolchain libraries in cc_shared_library by @dzbarsky in #4166
- build(release): fetch PR body in get_pr_info and grant PR read permissions by @rickeylev in #4177
- Prepare release v2.4.0 by @github-actions[bot] in #4176
- build(release): exclude devguide.md from version marker checks by @rickeylev in #4185
New Contributors
- @stanbot8 made their first contribution in #4026
- @muravev-vasilii made their first contribution in #4039
- @JoHoenk made their first contribution in #4041
- @henriquejsza made their first contribution in #4086
- @belitskiy made their first contribution in #4071
- @anisayakmitra-in made their first contribution in #4117
- @hawkinsp made their first contribution in #4122
- @tomatotomata made their first contribution in #4007
- @nicdumz made their first contribution in #4125
- @kocolosk made their first contribution in #4157
- @alloveras made their first contribution in #4160
Full Changelog: 2.3.0-rc0...2.4.0-rc0