Skip to content

Releases: bazel-contrib/rules_python

1.9.0

04 Mar 04:01
bac5494

Choose a tag to compare

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")

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 = "098ba13578e796c00c853a2161f382647f32eb9a77099e1c88bc5299333d0d6e",
    strip_prefix = "rules_python-1.9.0",
    url = "https://github.com/bazel-contrib/rules_python/releases/download/1.9.0/rules_python-1.9.0.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 = "098ba13578e796c00c853a2161f382647f32eb9a77099e1c88bc5299333d0d6e",
    strip_prefix = "rules_python-1.9.0/gazelle",
    url = "https://github.com/bazel-contrib/rules_python/releases/download/1.9.0/rules_python-1.9.0.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

  • docs: add steps for creating release candidates by @rickeylev in #2687
  • fix(toolchain): no chmod on windows when downloading hermetic toolchain by @aignas in #2693
  • fix: correctly find runfiles root for symlinks by @lpulley in #2665
  • feat: add riscv64 linux support by @kxxt in #2694
  • build(deps): bump urllib3 from 2.2.3 to 2.3.0 in /docs by @dependabot[bot] in #2698
  • build(deps): bump urllib3 from 2.2.3 to 2.3.0 in /tools/publish by @dependabot[bot] in #2699
  • build(deps): bump babel from 2.16.0 to 2.17.0 in /docs by @dependabot[bot] in #2696
  • build(deps): bump keyring from 25.4.1 to 25.5.0 in /tools/publish by @dependabot[bot] in #2355
  • build(deps): bump django from 4.2.17 to 4.2.20 in /examples/bzlmod_build_file_generation by @dependabot[bot] in #2689
  • fix: Correctly resolve macOS SDK paths by @shs96c in #2478
  • chore: remove old versions of Python 3.8 by @aignas in #2700
  • feat: uv lock rule instead of genrule by @aignas in #2657
  • feat(python.toolchain): support file-based default Python version by @vonschultz in #2588
  • fix(pypi): output only necessary target_platforms by @aignas in #2710
  • refactor(pypi): implement PEP508 compliant marker evaluation by @aignas in #2692
  • fix(docs): CHANGELOG "astral" typo by @lpulley in #2715
  • build(deps): bump sphinx-reredirects from 0.1.5 to 0.1.6 in /docs by @dependabot[bot] in #2716
  • build(deps): bump certifi from 2024.8.30 to 2025.1.31 in /docs by @dependabot[bot] in #2718
  • build(deps): bump certifi from 2024.8.30 to 2025.1.31 in /tools/publish by @dependabot[bot] in #2719
  • build(deps): bump pygments from 2.18.0 to 2.19.1 in /docs by @dependabot[bot] in #2720
  • fix: Fix Python 3.4.x compatibilty with bootstrap (#2709) by @armandomontanez in #2714
  • build(deps): bump packaging from 24.1 to 24.2 in /docs by @dependabot[bot] in #2721
  • chore: remove semantics.bzl by @rickeylev in #2725
  • chore: remove defunct comment about py2 compatibility by @rickeylev in #2724
  • feat(pypi/parse_requirements): get dists by version when no hash provied by @Yanpei-Wang in #2695
  • fix(toolchains): correctly order the toolchains by @aignas in #2735
  • fix: allow warn logging to be disabled via RULES_PYTHON_REPO_DEBUG_VERBOSITY by @mattem in #2737
  • fix: run check on interpreter in isolated mode by @mattem in #2738
  • fix(pypi): correctly fallback to pip for git direct URLs by @aignas in #2732
  • fix: support gazelle generation_mode:update_only by @jbedard in #2708
  • fix(pypi): mark the extension reproducible by @aignas in #2730
  • feat: allow populating binary's venv site-packages with symlinks by @rickeylev in #2617
  • docs: fix a few xrefs by @rickeylev in #2740
  • fix: treat ignore_root_user_error either ignored or warning by @mattem in #2739
  • fix: Ensure temporary .pyc & .pyo files are excluded from the interpreters repository files by @mattem in #2743
  • chore: remove unnecessary DEFAULT_BOOTSTRAP_TEMPLATE global by @rickeylev in #2744
  • build(deps): bump jinja2 from 3.1.4 to 3.1.6 in /docs by @dependabot[bot] in #2750
  • build(deps): bump absl-py from 2.1.0 to 2.2.2 in /docs by @dependabot[bot] in #2751
  • build(deps): bump charset-normalizer from 3.4.0 to 3.4.1 in /docs by @dependabot[bot] in #2752
  • build(deps): bump charset-normalizer from 3.4.0 to 3.4.1 in /tools/publish by @dependabot[bot] in #2753
  • build(deps): bump jinja2 from 3.1.4 to 3.1.6 in /examples/pip_parse by @dependabot[bot] in #2754
  • build(deps): bump cryptography from 43.0.3 to 44.0.1 in /tools/publish by @dependabot[bot] in #2756
  • feat(toolchains): create toolchains from locally installed python by @rickeylev in #2742
  • fix: run python version call in isolated mode by @mattem in #2761
  • fix(pypi): fixes to the marker evaluation and utils by @aignas in #2767
  • fix: Prevent absolute path creation in uv lock template by @asa in #2769
  • fix: Resolve incorrect platform specific dependency by @ewianda in #2766
  • fix(rules): make the srcs trully optional by @aignas in #2768
  • refactor(pypi): translate wheel METADATA parsing to starlark by @aignas in #2629
  • fix: replace string with modern providers in tests by @comius in #2773
  • feat(toolchain): Add new make vars for Python interpreter path compliant with --no_legacy_external_runfiles by @FrankPortman in #2772
  • fix(packaging): Format METADATA correctly if given empty requires_file by @FrankPortman in #2771
  • build(deps): bump typing-extensions from 4.12.2 to 4.13.2 in /docs by @dependabot[bot] in #2776
  • build(deps): bump urllib3 from 2.3.0 to 2.4.0 in /tools/publish by @dependabot[bot] in #2775
  • build(deps): bump urllib3 from 2.3.0 to 2.4.0 in /docs by @dependabot[bot] in #2774
  • refactor(bzlmod): stop using 'repo' attr in whl_library by @aignas in #2779
  • perf: lazily load gazelle manifest files by @mattem in #2746
  • fix(ci): use ubuntu-latest for mypy action by @aignas in #2784
  • doc: better document supported platform tiers by @aignas in #2783
  • fix(rules): copy_propagating_kwargs() now also copies target_compatible_with by @dws in #2788
  • release: 1.4.0 release prep by @rickeylev in #2789
  • fi...
Read more

1.9.0-rc1

23 Feb 16:40
bac5494

Choose a tag to compare

1.9.0-rc1 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 = "1.9.0-rc1")

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 = "f4e65a01b6eca51f107d285c8d60869f42cbf4eac32711530399c704e9ba417a",
    strip_prefix = "rules_python-1.9.0-rc1",
    url = "https://github.com/bazel-contrib/rules_python/releases/download/1.9.0-rc1/rules_python-1.9.0-rc1.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 = "f4e65a01b6eca51f107d285c8d60869f42cbf4eac32711530399c704e9ba417a",
    strip_prefix = "rules_python-1.9.0-rc1/gazelle",
    url = "https://github.com/bazel-contrib/rules_python/releases/download/1.9.0-rc1/rules_python-1.9.0-rc1.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

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

1.9.0-rc0

23 Feb 01:13

Choose a tag to compare

1.9.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 = "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 ...
Read more

1.8.5

23 Feb 00:56

Choose a tag to compare

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.8.5")

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 = "8964aa1e7525fea5244ba737458694a057ada1be96a92998a41caa1983562d00",
    strip_prefix = "rules_python-1.8.5",
    url = "https://github.com/bazel-contrib/rules_python/releases/download/1.8.5/rules_python-1.8.5.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 = "8964aa1e7525fea5244ba737458694a057ada1be96a92998a41caa1983562d00",
    strip_prefix = "rules_python-1.8.5/gazelle",
    url = "https://github.com/bazel-contrib/rules_python/releases/download/1.8.5/rules_python-1.8.5.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()

Full Changelog: 1.8.4...1.8.5

1.8.4

11 Feb 12:17

Choose a tag to compare

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.8.4")

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 = "c85d5db38d3eac06167a13b10c9dba54b003a986cd4f1ebc00806b74e7c12f06",
    strip_prefix = "rules_python-1.8.4",
    url = "https://github.com/bazel-contrib/rules_python/releases/download/1.8.4/rules_python-1.8.4.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 = "c85d5db38d3eac06167a13b10c9dba54b003a986cd4f1ebc00806b74e7c12f06",
    strip_prefix = "rules_python-1.8.4/gazelle",
    url = "https://github.com/bazel-contrib/rules_python/releases/download/1.8.4/rules_python-1.8.4.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()

Full Changelog: 1.8.3...1.8.4

1.8.3

28 Jan 02:21

Choose a tag to compare

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.8.3")

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 = "94a2b4c5d9c45323a9737f8de8f841923bb628cace1e8e51fec5525ed9ccfb2d",
    strip_prefix = "rules_python-1.8.3",
    url = "https://github.com/bazel-contrib/rules_python/releases/download/1.8.3/rules_python-1.8.3.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 = "94a2b4c5d9c45323a9737f8de8f841923bb628cace1e8e51fec5525ed9ccfb2d",
    strip_prefix = "rules_python-1.8.3/gazelle",
    url = "https://github.com/bazel-contrib/rules_python/releases/download/1.8.3/rules_python-1.8.3.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()

Full Changelog: 1.8.2...1.8.3

1.8.2

25 Jan 03:31

Choose a tag to compare

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.8.2")

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 = "6810ff4b137b62e86ce3cedfebeeb2c988d8c5a16c4fc8081da21ad8f998a141",
    strip_prefix = "rules_python-1.8.2",
    url = "https://github.com/bazel-contrib/rules_python/releases/download/1.8.2/rules_python-1.8.2.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 = "6810ff4b137b62e86ce3cedfebeeb2c988d8c5a16c4fc8081da21ad8f998a141",
    strip_prefix = "rules_python-1.8.2/gazelle",
    url = "https://github.com/bazel-contrib/rules_python/releases/download/1.8.2/rules_python-1.8.2.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()

Full Changelog: 1.8.1...1.8.2

1.8.1

21 Jan 01:07

Choose a tag to compare

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.8.1")

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 = "7ae25c0d3b52124fffe199a34520f43e496f4027d59452df70184eced23b96ef",
    strip_prefix = "rules_python-1.8.1",
    url = "https://github.com/bazel-contrib/rules_python/releases/download/1.8.1/rules_python-1.8.1.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 = "7ae25c0d3b52124fffe199a34520f43e496f4027d59452df70184eced23b96ef",
    strip_prefix = "rules_python-1.8.1/gazelle",
    url = "https://github.com/bazel-contrib/rules_python/releases/download/1.8.1/rules_python-1.8.1.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()

Full Changelog: 1.8.0...1.8.1

1.8.0

16 Jan 17:17

Choose a tag to compare

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.8.0")

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 = "0558021abbd244f3e2b51120a7ec4bded37c6cb02c372aaa188da9ba375560d8",
    strip_prefix = "rules_python-1.8.0",
    url = "https://github.com/bazel-contrib/rules_python/releases/download/1.8.0/rules_python-1.8.0.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 = "0558021abbd244f3e2b51120a7ec4bded37c6cb02c372aaa188da9ba375560d8",
    strip_prefix = "rules_python-1.8.0/gazelle",
    url = "https://github.com/bazel-contrib/rules_python/releases/download/1.8.0/rules_python-1.8.0.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: remove bcr app settings by @rickeylev in #3370
  • chore: make pypi release workflow perform checkout by @rickeylev in #3371
  • fix(gazelle) Delete python targets with invalid srcs by @yushan26 in #3046
  • revert(pypi): revert the default for pipstar by @aignas in #3373
  • fix: Add linux_riscv64 to _pip_repository_impl by @kxxt in #3350
  • feat: Add libpython QNX platform support by @lalten in #3372
  • build: change gazelle rules_python override to use bazelrc by @rickeylev in #3382
  • gazelle: set min rules_python version as 1.4 by @rickeylev in #3383
  • chore(toolchain): drop all but the latest 3.9 toolchain by @aignas in #3377
  • fix: make CI pass with the next version of Bazel (9.0.0rc1) by @jsing-canva in #3393
  • Add batch_commands to presubmit.yml by @meteorcloudy in #3389
  • fix(runfiles): correct Python runfiles path assumption by @jsing-canva in #3086
  • chore: Bazel 9 is rc now by @alexeagle in #3394
  • chore: update to latest buildifier by @aignas in #3386
  • chore: switch bcr to 8.x instead of last_rc by @aignas in #3395
  • fix(local): Fix local_runtime use with free-threaded python by @laramiel in #3399
  • refactor: defer zip manifest building to execution phase to improve analysis phase performance by @tobyh-canva in #3381
  • fix(pip): allow for different extras for different target platforms by @aignas in #3385
  • chore: make doc building use bootstrap script and venv site packages by @rickeylev in #3403
  • fix: use runfiles symlinks for venv symlink creation to reduce action count by @rickeylev in #3402
  • fix(gazelle): correct runfiles path handling in gazelle_python_manifest test by @timfallmk in #3398
  • tests: set --windows_enable_symlinks in bzlmod example by @rickeylev in #3409
  • docs: Explain why the lock rule has no implicit test target by @martis42 in #3411
  • refactor(gazelle): Generate a modules map per wheel, then merge by @thejcannon in #3415
  • docs: fix markdown by @dizzy57 in #3417
  • feat(toolchain): drop 3.8 and print info level messages about it by @aignas in #3387
  • fix: Avoid C++ toolchain requirement if possible by @fmeum in #2919
  • doc: add documentation to the changelog about the removal of 3.8 by @aignas in #3418
  • fix: make python_headers targets compatible with layering checks by @keith in #3420
  • fix(local) Add api3 targets and additional defines. by @laramiel in #3408
  • chore: start cleaning up 3.9 usage from examples by @aignas in #3419
  • chore: enable disk cache for faster local builds by @rickeylev in #3424
  • chore(bazelrc): fix the update-deleted-packages script by @aignas in #3425
  • chore(toolchain): remove chmod and disable ignore_root_error by @aignas in #3421
  • ci: switch our jobs to mac arm64 by @aignas in #3426
  • docs: enable pipstar for doc building by @rickeylev in #3427
  • fix: add runfiles root for system_python bootstrap by @rickeylev in #3423
  • refactor(pypi): parse entry_points without Python by @aignas in #3429
  • chore: enable pipstar for experimental_index_url users by @aignas in #3428
  • fix(pip): do not add a pip-fallback when there is no sdist by @aignas in #3432
  • build(deps): bump actions/checkout from 5 to 6 by @dependabot[bot] in #3433
  • refactor(pypi): extract the wheel without python by @aignas in #3430
  • chore: remove extraneous dep from sys_path_order test by @rickeylev in #3435
  • refactor: remove gazelle plugin as dev dependency by @rickeylev in #3436
  • ci: add ci config to test 7 and 8 for bcr like setup by @aignas in #3404
  • feat(pip.parse): limit the target platforms we parse requirements for by @aignas in #3441
  • refactor(core): get_zip_runfiles_path should call startswith less by @aignas in #3442
  • ci: start testing BCR tests with bazel 9 by @aignas in #3443
  • doc: target_platforms by @aignas in #3445
  • chore(bzlmod): assume that we can always mark the extension as reproducible by @aignas in #3444
  • refactor: avoid conflict merging when shared libraries are present by @rickeylev in #3448
  • refactor: add mnemonics to some gazelle and sphinxdocs actions by @tyler-french in #3449
  • fix(pip): Only directly extract .whl files in Bazel >9 by @armandomontanez in #3452
  • feat(toolchains): Add 3.13.10, 3.13.11, 3.14.1, 3.14.2, 3.15.0a2 by @pjjw in #3451
  • chore(pip): Check for whl extract compatibility in internal_config_repo.bzl by @armandomontanez in #3456
  • fix(pip): set better defaults for the new target_platforms attr by @aignas in #3447
  • fix: correctly merge conflicting paths when files (instead of dirs) are being linked by @rickeylev in #3458
  • refactor(repo_utils): create a helper for extracting files by @aignas in #3459
  • refactor: optimize venv building for namespace packages by @rickeylev in #3454
  • chore: add missing py_internal dep to venv_runfiles by @rickeylev in #3462
  • fix: allow pypi packages with empty data attribute by @rickeylev in #3463
  • docs: Fix broken links to bzlmod build_file_generation example by @willstranton in https://github.com/bazel-contrib...
Read more

1.8.0-rc4

15 Jan 06:20

Choose a tag to compare

1.8.0-rc4 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 = "1.8.0-rc4")

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 = "fd9317dfb618a822b65ed348e70d4fdc792a0a517d83e4b187a6e44114f00764",
    strip_prefix = "rules_python-1.8.0-rc4",
    url = "https://github.com/bazel-contrib/rules_python/releases/download/1.8.0-rc4/rules_python-1.8.0-rc4.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 = "fd9317dfb618a822b65ed348e70d4fdc792a0a517d83e4b187a6e44114f00764",
    strip_prefix = "rules_python-1.8.0-rc4/gazelle",
    url = "https://github.com/bazel-contrib/rules_python/releases/download/1.8.0-rc4/rules_python-1.8.0-rc4.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()

Full Changelog: 1.8.0-rc3...1.8.0-rc4