Skip to content

1.9.0-rc0

Pre-release
Pre-release

Choose a tag to compare

@github-actions github-actions released this 23 Feb 01:13
· 32 commits to main since this 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 = "1.9.0-rc0")

python = use_extension("@rules_python//python/extensions:python.bzl", "python")
python.toolchain(
    python_version = "3.13",
)

pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip")
pip.parse(
    hub_name = "pypi",
    python_version = "3.13",
    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 = "e7159a7365501365469ec9e812b14b3c5933587b7993fea26e63d395f01daa1a",
    strip_prefix = "rules_python-1.9.0-rc0",
    url = "https://github.com/bazel-contrib/rules_python/releases/download/1.9.0-rc0/rules_python-1.9.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 = "e7159a7365501365469ec9e812b14b3c5933587b7993fea26e63d395f01daa1a",
    strip_prefix = "rules_python-1.9.0-rc0/gazelle",
    url = "https://github.com/bazel-contrib/rules_python/releases/download/1.9.0-rc0/rules_python-1.9.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

  • refactor: remove most of semantics by @rickeylev in #3475
  • feat: add --debugger flag by @rickeylev in #3478
  • fix(--debugger): Ensure that imports or venv_site_package files are propagated for debugger target by @shayanhoshyari in #3483
  • build: Export runtime_env_toolchain_interpreter.sh file by @hofbi in #3471
  • fix(coverage): Disable certain coverage warnings. by @phst in #3191
  • feat: basic build data with stamping by @rickeylev in #3484
  • fix: prevent a 404 error when serving Sphinx docs and Bazel is configured with a --symlink_prefix option by @laurenshobert in #3492
  • build: Enable incompatible_no_implicit_file_export in bazelrc by @hofbi in #3477
  • fix(pipstar): correctly handle platlib and purelib in .data by @aignas in #3501
  • doc: Add a snippet on how people can use 3.8 now onwards by @aignas in #3502
  • refactor(pypi): print a better error message for duplicate repos by @aignas in #3487
  • chore: create bcr prs as non-draft so bazel-io processes the bot-created PRs by @rickeylev in #3504
  • fix (venv_site_packages): Fix wrong runfiles.symlinks when py_binary is not in root module by @shayanhoshyari in #3505
  • test(whl_library): test a recent fix for pipstar by @aignas in #3469
  • feat(gazelle): Add ancestor conftest.py files by @thejcannon in #3498
  • fix(pipstar): Handle dep appearing in extra both conditionally and unconditionally by @thirtyseven in #3513
  • Add missing #3046 reference to 1.8.0 changelog by @dougthor42 in #3516
  • chore: remove unused which.bzl helper by @rickeylev in #3509
  • chore: remove py_proto_library from bzlmod example by @rickeylev in #3508
  • chore: remove defunct runtime distinction logic by @rickeylev in #3506
  • chore: make builtin build_python_zip flag optional for tests (bazel 10 compatibility) by @rickeylev in #3507
  • chore (py_internal): Remove roundtrip of putting py_internal in the config repo by @shayanhoshyari in #3522
  • chore: remove mention of py_proto_library from readme by @shayanhoshyari in #3525
  • fix: Quote all files if original RECORD had all files quoted by @lalten in #3515
  • fix(pipstar): correctly handle complex self deps by @aignas in #3527
  • doc: bazel downloader (#3519) by @romanofski in #3530
  • feat(python): add arm64e-apple-darwin platform support by @ma-oli in #3535
  • feat(gazelle): Add python_generate_pyi_srcs directive by @dougthor42 in #3356
  • fix: explicitly symlink all .so files, not just ones with lib prefix by @gfrankliu in #3538
  • fix: handle unsubstituted template placeholders for external native py_binary by @thomasdesr in #3495
  • refactor: rename files_to_build to default_outputs by @rickeylev in #3542
  • refactor: clarify %main% is runfiles-root-relative path by @rickeylev in #3537
  • fix: Mark internal config repo as reproducible for Bzlmod by @aaronsky in #3544
  • docs (debugger): Update using debuggers how to guide on using debugpy (e.g. vscode) by @shayanhoshyari in #3547
  • chore: remove workspace py_proto_library example by @rickeylev in #3546
  • chore: update rbe ci config to 8.x by @rickeylev in #3548
  • fix(pip): simply extract whl contents to the current directory by @aignas in #3549
  • fix: use powershell.exe instead of pwsh.exe for build_data_writer by @vadikmironov in #3553
  • fix: remove CONFIG_ID write from build_data_writer.ps1 by @vadikmironov in #3556
  • fix(pip): add read permissions when extracting wheels by @thirtyseven in #3555
  • feat: add py_zipapp_binary and test rules for zipapp support by @rickeylev in #3539
  • chore: remove defunct _py_toolchain_type py_binary attribute by @rickeylev in #3560
  • chore: add some type information about hub builder by @rickeylev in #3558
  • feat(zipapp): add windows support by @rickeylev in #3561
  • docs: doc the imports attribute as a target-relative path by @rickeylev in #3571
  • docs: mention PyRuntimeInfo in PyExecutableInfo by @rickeylev in #3573
  • feat(zipapp): Add python_zip_file output group for better compatibility by @rickeylev in #3574
  • chore(py_executable): print warning if build zip is enabled by @rickeylev in #3568
  • fix: fallback to /usr/bin/env if env is not in PATH by @rickeylev in #3577
  • fix: make imports attribute target-relative for venv mode by @rickeylev in #3572
  • feat: handle url req in wheelmaker by @martin4861 in #3569
  • fix(pip): preserve PEP 508 URL-based requirements when extract_url_srcs=False by @jsharpe in #3582
  • fix(pipstar): handle a corner case for compatible version evaluation by @aignas in #3583
  • fix(runfiles): assume main repository on Windows by @rdesgroppes in #3578
  • fix(pypi): normalize extras in requirement strings per PEP 685 by @kevinpark1217 in #3588
  • chore: print zipapp deprecation for non-windows platforms by @rickeylev in #3591
  • fix: Return repo_metadata from uv repository rule by @mortenmj in #3597
  • fix: Return repo_metadata from python repository rule by @mortenmj in #3598
  • perf(py_wheel): defer depset expansion to execution time by @bd-dstodolsky in #3599
  • feat(gazelle): Directive controlling pytest ancestor dependencies by @dougthor42 in #3596
  • docs: document current_py_cc_headers and related toolchain targets by @Saish-3 in #3602
  • test(gazelle): Update remove_invalid_(binary|library) gazelle tests. by @dougthor42 in #3601
  • chore: better build data error handling by @rickeylev in #3606
  • fix: build_data_writer.ps1 encoding and ACLs by @rickeylev in #3604
  • docs: Fix nearly all xref errors and other doc warnings by @rickeylev in #3615
  • fix: use forward slashes for initial Rlocation lookup of build data by @rickeylev in #3616
  • chore: ignore rmtree errors in wheel_installer_test by @rickeylev in #3607
  • test: add system_python_nodeps_test by @rickeylev in #3609
  • fix: use runfiles_root_path in stage2 bootstrap by @rickeylev in #3605
  • chore: better bootstrap logging by @rickeylev in #3608
  • build(deps): bump the pip group across 2 directories with 2 updates by @dependabot[bot] in #3617
  • feat: command_line_option transition support, default windows to enable_runfiles=true by @rickeylev in #3610
  • chore: prepare 1.9.0 release by @rickeylev in #3623
  • docs(gazelle): Add versionadded details to some Gazelle directives.md by @dougthor42 in #3624

New Contributors

Full Changelog: 1.8.0-rc1...1.9.0-rc0