Skip to content

Releases: bazel-contrib/rules_python

1.4.0-rc1

22 Apr 13:25
Compare
Choose a tag to compare
1.4.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.4.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 = "379a1a0f66b3af3946f8a99f7578759564f80004ebbda8960685d3619b71fb28",
    strip_prefix = "rules_python-1.4.0-rc1",
    url = "https://github.com/bazel-contrib/rules_python/releases/download/1.4.0-rc1/rules_python-1.4.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 = "379a1a0f66b3af3946f8a99f7578759564f80004ebbda8960685d3619b71fb28",
    strip_prefix = "rules_python-1.4.0-rc1/gazelle",
    url = "https://github.com/bazel-contrib/rules_python/releases/download/1.4.0-rc1/rules_python-1.4.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()

Full Changelog: 1.4.0-rc0...1.4.0-rc1

1.4.0-rc0

21 Apr 01:31
Compare
Choose a tag to compare
1.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 = "1.4.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 = "43071c4392c0e0c1bc95296b7e94e55328c760de9f805619861d7387fbc69257",
    strip_prefix = "rules_python-1.4.0-rc0",
    url = "https://github.com/bazel-contrib/rules_python/releases/download/1.4.0-rc0/rules_python-1.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 = "43071c4392c0e0c1bc95296b7e94e55328c760de9f805619861d7387fbc69257",
    strip_prefix = "rules_python-1.4.0-rc0/gazelle",
    url = "https://github.com/bazel-contrib/rules_python/releases/download/1.4.0-rc0/rules_python-1.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

  • 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 in #2698
  • build(deps): bump urllib3 from 2.2.3 to 2.3.0 in /tools/publish by @dependabot in #2699
  • build(deps): bump babel from 2.16.0 to 2.17.0 in /docs by @dependabot in #2696
  • build(deps): bump keyring from 25.4.1 to 25.5.0 in /tools/publish by @dependabot in #2355
  • build(deps): bump django from 4.2.17 to 4.2.20 in /examples/bzlmod_build_file_generation by @dependabot 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 in #2716
  • build(deps): bump certifi from 2024.8.30 to 2025.1.31 in /docs by @dependabot in #2718
  • build(deps): bump certifi from 2024.8.30 to 2025.1.31 in /tools/publish by @dependabot in #2719
  • build(deps): bump pygments from 2.18.0 to 2.19.1 in /docs by @dependabot 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 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 in #2750
  • build(deps): bump absl-py from 2.1.0 to 2.2.2 in /docs by @dependabot in #2751
  • build(deps): bump charset-normalizer from 3.4.0 to 3.4.1 in /docs by @dependabot in #2752
  • build(deps): bump charset-normalizer from 3.4.0 to 3.4.1 in /tools/publish by @dependabot in #2753
  • build(deps): bump jinja2 from 3.1.4 to 3.1.6 in /examples/pip_parse by @dependabot in #2754
  • build(deps): bump cryptography from 43.0.3 to 44.0.1 in /tools/publish by @dependabot 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 in #2776
  • build(deps): bump urllib3 from 2.3.0 to 2.4.0 in /tools/publish by @dependabot in #2775
  • build(deps): bump urllib3 from 2.3.0 to 2.4.0 in /docs by @dependabot 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

New Contributors

  • @kxxt made their first contribution in https...
Read more

1.3.0

27 Mar 18:32
dea960a
Compare
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.3.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 = "2cc26bbd53854ceb76dd42a834b1002cd4ba7f8df35440cf03482e045affc244",
    strip_prefix = "rules_python-1.3.0",
    url = "https://github.com/bazel-contrib/rules_python/releases/download/1.3.0/rules_python-1.3.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 = "2cc26bbd53854ceb76dd42a834b1002cd4ba7f8df35440cf03482e045affc244",
    strip_prefix = "rules_python-1.3.0/gazelle",
    url = "https://github.com/bazel-contrib/rules_python/releases/download/1.3.0/rules_python-1.3.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 horizontal spacers around filenames in custom toolchain guide by @nicholasjng in #2563
  • fix: Avoid creating URLs with empty path segments from index URLs in environment variables by @WillMorrison in #2557
  • docs: update gazelle README.md by @alexeagle in #2567
  • fix: Don't fail in override from a non-root module by @mailto-jonas in #2566
  • chore: remove internal usage of deprecated py_binary ad py_test by @aignas in #2569
  • fix: Fix encoding of runfiles manifest and repository mapping files. by @phst in #2568
  • fix: make coverage work with bootstrap=script by @rickeylev in #2574
  • doc: point users to our CHANGELOG at the top of the release note by @aignas in #2582
  • fix: Enable location expansion for sh_py_run_test by @philsc in #2583
  • fix(sphinxdocs): do not crash when tag_class does not have doc by @aignas in #2585
  • refactor(uv): move around uv implementation files by @aignas in #2580
  • revert: Updated pip and packaging versions to work with free-threading packages (#2514) by @aignas in #2584
  • docs: using python_version attribute for specifying python version by @JeroenSchmidt in #2589
  • fix: make plain zipapp work with bootstrap=script by @rickeylev in #2598
  • fix: add flag to use runtime venv creation when using bootstrap=script by @rickeylev in #2590
  • docs: Update URL in gazelle example by @hofbi in #2602
  • refactor: expose base rule construction via builders to allow customization for testing by @rickeylev in #2600
  • feat: Remove and redirect py_proto_library to protobuf by @comius in #2604
  • chore: updates for 1.2.0 release by @rickeylev in #2611
  • docs: update dev docs on how to pick next version by @rickeylev in #2612
  • docs: tell how to create branches for releases by @rickeylev in #2613
  • docs: split out release steps into separate doc by @rickeylev in #2615
  • feat: provide access to arbitrary interpreters by @philsc in #2507
  • docs: add changelog update for //python/bin by @rickeylev in #2616
  • refactor: cleanup now-unreferenced proto toolchain type by @alexeagle in #2620
  • docs: add some docs to help contributors get started by @rickeylev in #2623
  • ci: use Python 3.9 for mypy workflow to fix ci by @rickeylev in #2625
  • fix(pypi): correctly translate ppc64le to bazel platforms by @aignas in #2577
  • fix: Gazelle bug with merging py_binary targets in per-file mode and partial update by @jimmyt857 in #2619
  • refactor: stop using some deprecated Starlark APIs by @EdSchouten in #2626
  • docs: fix changelog header for 1.2.0 entry by @rickeylev in #2635
  • fix: Downgrade "running as root" error to a warning by default by @Wyverald in #2636
  • fix: spill module mapping args to a file by @mattem in #2644
  • Add error for pip.parse attrs that require other attrs by @keith in #2646
  • feat: Package pyi files in wheel by @Synss in #2609
  • chore: Remove *_build_test targets from sphinx_docs (#2645) by @255 in #2650
  • fix(pypi): use python -B for repo-phase invocations by @aignas in #2641
  • build: Update doublestar to a version that works with the latest Gazelle by @shs96c in #2480
  • fix: Add libdir to library search path by @shs96c in #2476
  • fix(gazelle): Include YAML 'docstart' in gazelle manifest file by @dougthor42 in #2656
  • feat(uv): parse the dist-manifest.json to not hardcode sha256 in rules_python by @aignas in #2578
  • fix(coverage): missing files in the coverage report if they have no tests by @BurnzZ in #2607
  • feat(pypi): support direct urls for wheels in bazel downloader by @chrisirhc in #2655
  • refactor: API for deriving customized versions of the base rules by @rickeylev in #2610
  • fix(gazelle): Explicitly call sys.exit in the modules_mapping generator by @samschlegel in #2662
  • feat(rules): allow deriving custom rules from core rules by @rickeylev in #2666
  • feat(binary/test): add interpreter_args attribute by @rickeylev in #2669
  • feat: env-var for additional interpreter args in bootstrap stage 1 by @andponlin-canva in #2654
  • Update source repo in BCR metadata.json by @meteorcloudy in #2672
  • build(deps): bump jinja2 from 3.1.4 to 3.1.6 in /examples/bzlmod by @dependabot in #2651
  • chore(docs): fix forward-ref to 1.0 by @alexeagle in #2673
  • chore: account for new GH org of standalone interpreter by @alexeagle in #2676
  • feat(rules): add main_module attribute to run a module name (python -m) by @rickeylev in #2671
  • fix: expose public attrb/ruleb bzl targets by @aignas in #2682
  • chore: update changelog and version markers for 1.3 release by @rickeylev in #2683
  • chore: ignore releasing.md for version string check by @rickeylev in #2684
  • chore: replace bazelbuild with bazel-contrib by @rickeylev in #2688
  • chore: update bcr metadata files to specify bazel-contrib by @rickeylev in #2686

New Contributors

Read more

1.3.0-rc1

21 Mar 15:37
dea960a
Compare
Choose a tag to compare
1.3.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.3.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 = "069b14defc462c1382d4d8f00c25eb59dc468e38d6c932471312d466fdf7700b",
    strip_prefix = "rules_python-1.3.0-rc1",
    url = "https://github.com/bazel-contrib/rules_python/releases/download/1.3.0-rc1/rules_python-1.3.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 = "069b14defc462c1382d4d8f00c25eb59dc468e38d6c932471312d466fdf7700b",
    strip_prefix = "rules_python-1.3.0-rc1/gazelle",
    url = "https://github.com/bazel-contrib/rules_python/releases/download/1.3.0-rc1/rules_python-1.3.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

  • docs: update dev docs on how to pick next version by @rickeylev in #2612
  • docs: tell how to create branches for releases by @rickeylev in #2613
  • docs: split out release steps into separate doc by @rickeylev in #2615
  • feat: provide access to arbitrary interpreters by @philsc in #2507
  • docs: add changelog update for //python/bin by @rickeylev in #2616
  • refactor: cleanup now-unreferenced proto toolchain type by @alexeagle in #2620
  • docs: add some docs to help contributors get started by @rickeylev in #2623
  • ci: use Python 3.9 for mypy workflow to fix ci by @rickeylev in #2625
  • fix(pypi): correctly translate ppc64le to bazel platforms by @aignas in #2577
  • fix: Gazelle bug with merging py_binary targets in per-file mode and partial update by @jimmyt857 in #2619
  • refactor: stop using some deprecated Starlark APIs by @EdSchouten in #2626
  • docs: fix changelog header for 1.2.0 entry by @rickeylev in #2635
  • fix: Downgrade "running as root" error to a warning by default by @Wyverald in #2636
  • fix: spill module mapping args to a file by @mattem in #2644
  • Add error for pip.parse attrs that require other attrs by @keith in #2646
  • feat: Package pyi files in wheel by @Synss in #2609
  • chore: Remove *_build_test targets from sphinx_docs (#2645) by @255 in #2650
  • fix(pypi): use python -B for repo-phase invocations by @aignas in #2641
  • build: Update doublestar to a version that works with the latest Gazelle by @shs96c in #2480
  • fix: Add libdir to library search path by @shs96c in #2476
  • fix(gazelle): Include YAML 'docstart' in gazelle manifest file by @dougthor42 in #2656
  • feat(uv): parse the dist-manifest.json to not hardcode sha256 in rules_python by @aignas in #2578
  • fix(coverage): missing files in the coverage report if they have no tests by @BurnzZ in #2607
  • feat(pypi): support direct urls for wheels in bazel downloader by @chrisirhc in #2655
  • refactor: API for deriving customized versions of the base rules by @rickeylev in #2610
  • fix(gazelle): Explicitly call sys.exit in the modules_mapping generator by @samschlegel in #2662
  • feat(rules): allow deriving custom rules from core rules by @rickeylev in #2666
  • feat(binary/test): add interpreter_args attribute by @rickeylev in #2669
  • feat: env-var for additional interpreter args in bootstrap stage 1 by @andponlin-canva in #2654
  • Update source repo in BCR metadata.json by @meteorcloudy in #2672
  • build(deps): bump jinja2 from 3.1.4 to 3.1.6 in /examples/bzlmod by @dependabot in #2651
  • chore(docs): fix forward-ref to 1.0 by @alexeagle in #2673
  • chore: account for new GH org of standalone interpreter by @alexeagle in #2676
  • feat(rules): add main_module attribute to run a module name (python -m) by @rickeylev in #2671
  • fix: expose public attrb/ruleb bzl targets by @aignas in #2682
  • chore: update changelog and version markers for 1.3 release by @rickeylev in #2683
  • chore: ignore releasing.md for version string check by @rickeylev in #2684
  • chore: replace bazelbuild with bazel-contrib by @rickeylev in #2688
  • chore: update bcr metadata files to specify bazel-contrib by @rickeylev in #2686

New Contributors

Full Changelog: 1.2.0-rc0...1.3.0-rc1

1.2.0

27 Feb 04:47
Compare
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.2.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 = "2ef40fdcd797e07f0b6abda446d1d84e2d9570d234fddf8fcd2aa262da852d1c",
    strip_prefix = "rules_python-1.2.0",
    url = "https://github.com/bazelbuild/rules_python/releases/download/1.2.0/rules_python-1.2.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 = "2ef40fdcd797e07f0b6abda446d1d84e2d9570d234fddf8fcd2aa262da852d1c",
    strip_prefix = "rules_python-1.2.0/gazelle",
    url = "https://github.com/bazelbuild/rules_python/releases/download/1.2.0/rules_python-1.2.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 horizontal spacers around filenames in custom toolchain guide by @nicholasjng in #2563
  • fix: Avoid creating URLs with empty path segments from index URLs in environment variables by @WillMorrison in #2557
  • docs: update gazelle README.md by @alexeagle in #2567
  • fix: Don't fail in override from a non-root module by @mailto-jonas in #2566
  • chore: remove internal usage of deprecated py_binary ad py_test by @aignas in #2569
  • fix: Fix encoding of runfiles manifest and repository mapping files. by @phst in #2568
  • fix: make coverage work with bootstrap=script by @rickeylev in #2574
  • doc: point users to our CHANGELOG at the top of the release note by @aignas in #2582
  • fix: Enable location expansion for sh_py_run_test by @philsc in #2583
  • fix(sphinxdocs): do not crash when tag_class does not have doc by @aignas in #2585
  • refactor(uv): move around uv implementation files by @aignas in #2580
  • revert: Updated pip and packaging versions to work with free-threading packages (#2514) by @aignas in #2584
  • docs: using python_version attribute for specifying python version by @JeroenSchmidt in #2589
  • fix: make plain zipapp work with bootstrap=script by @rickeylev in #2598
  • fix: add flag to use runtime venv creation when using bootstrap=script by @rickeylev in #2590
  • docs: Update URL in gazelle example by @hofbi in #2602
  • refactor: expose base rule construction via builders to allow customization for testing by @rickeylev in #2600
  • feat: Remove and redirect py_proto_library to protobuf by @comius in #2604
  • chore: updates for 1.2.0 release by @rickeylev in #2611

New Contributors

Full Changelog: 1.1.0...1.2.0

1.2.0-rc1

22 Feb 07:52
Compare
Choose a tag to compare
1.2.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.2.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 = "5d346cc5730b8fd08d4c044715550f1b41584844cbbca297390bb3abf4b7dea5",
    strip_prefix = "rules_python-1.2.0-rc1",
    url = "https://github.com/bazelbuild/rules_python/releases/download/1.2.0-rc1/rules_python-1.2.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 = "5d346cc5730b8fd08d4c044715550f1b41584844cbbca297390bb3abf4b7dea5",
    strip_prefix = "rules_python-1.2.0-rc1/gazelle",
    url = "https://github.com/bazelbuild/rules_python/releases/download/1.2.0-rc1/rules_python-1.2.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()

Full Changelog: 1.2.0-rc0...1.2.0-rc1

1.2.0-rc0

14 Feb 05:30
ae361c2
Compare
Choose a tag to compare
1.2.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.2.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 = "4d0f8a02a670e03696860d2b08d790eeeb13473cfa582bb579e252dd9e079ae2",
    strip_prefix = "rules_python-1.2.0-rc0",
    url = "https://github.com/bazelbuild/rules_python/releases/download/1.2.0-rc0/rules_python-1.2.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 = "4d0f8a02a670e03696860d2b08d790eeeb13473cfa582bb579e252dd9e079ae2",
    strip_prefix = "rules_python-1.2.0-rc0/gazelle",
    url = "https://github.com/bazelbuild/rules_python/releases/download/1.2.0-rc0/rules_python-1.2.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

  • docs: Add horizontal spacers around filenames in custom toolchain guide by @nicholasjng in #2563
  • fix: Avoid creating URLs with empty path segments from index URLs in environment variables by @WillMorrison in #2557
  • docs: update gazelle README.md by @alexeagle in #2567
  • fix: Don't fail in override from a non-root module by @mailto-jonas in #2566
  • chore: remove internal usage of deprecated py_binary ad py_test by @aignas in #2569
  • fix: Fix encoding of runfiles manifest and repository mapping files. by @phst in #2568
  • fix: make coverage work with bootstrap=script by @rickeylev in #2574
  • doc: point users to our CHANGELOG at the top of the release note by @aignas in #2582
  • fix: Enable location expansion for sh_py_run_test by @philsc in #2583
  • fix(sphinxdocs): do not crash when tag_class does not have doc by @aignas in #2585
  • refactor(uv): move around uv implementation files by @aignas in #2580
  • revert: Updated pip and packaging versions to work with free-threading packages (#2514) by @aignas in #2584
  • docs: using python_version attribute for specifying python version by @JeroenSchmidt in #2589
  • fix: make plain zipapp work with bootstrap=script by @rickeylev in #2598
  • fix: add flag to use runtime venv creation when using bootstrap=script by @rickeylev in #2590
  • docs: Update URL in gazelle example by @hofbi in #2602
  • refactor: expose base rule construction via builders to allow customization for testing by @rickeylev in #2600
  • feat: Remove and redirect py_proto_library to protobuf by @comius in #2604
  • chore: updates for 1.2.0 release by @rickeylev in #2611

New Contributors

Full Changelog: 1.1.0...1.2.0-rc0

1.1.0

17 Jan 00:12
1aa0d9f
Compare
Choose a tag to compare

For more detailed setup instructions, see https://rules-python.readthedocs.io/en/latest/getting-started.html

Using Bzlmod

Add to your MODULE.bazel file:

bazel_dep(name = "rules_python", version = "1.1.0")

pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip")

pip.parse(
    hub_name = "pip",
    python_version = "3.11",
    requirements_lock = "//:requirements_lock.txt",
)

use_repo(pip, "pip")

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 = "9c6e26911a79fbf510a8f06d8eedb40f412023cf7fa6d1461def27116bff022c",
    strip_prefix = "rules_python-1.1.0",
    url = "https://github.com/bazelbuild/rules_python/releases/download/1.1.0/rules_python-1.1.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 = "9c6e26911a79fbf510a8f06d8eedb40f412023cf7fa6d1461def27116bff022c",
    strip_prefix = "rules_python-1.1.0/gazelle",
    url = "https://github.com/bazelbuild/rules_python/releases/download/1.1.0/rules_python-1.1.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

  • tests: skip workspace-specific examples for bazel 9 by @rickeylev in #2471
  • chore: ignore examples/pip_repository_annotations bazel-bin symlink by @rickeylev in #2472
  • chore: use per-rule loads in pip_compile.bzl by @rickeylev in #2473
  • tests: make multi_python_versions pass with Bazel 9 workspace by @rickeylev in #2474
  • fix: normalize argv0 so runfiles root can be found on windows with bazel 9 by @rickeylev in #2481
  • chore: load specific bzl files instead of generic defs.bzl by @rickeylev in #2483
  • feat(pypi): support freethreaded in experimental_index_url by @aignas in #2460
  • fix: Make sure wheelmaker uses the default shell env by @shs96c in #2477
  • chore: remove find_requirements re-export from bazel_tools by @rickeylev in #2484
  • feat(gazelle): Include types/stubs packages by @ewianda in #2425
  • build(deps): bump django from 4.2.16 to 4.2.17 in /examples/bzlmod_build_file_generation by @dependabot in #2486
  • build(deps): bump rich from 13.9.3 to 13.9.4 in /tools/publish by @dependabot in #2371
  • fix: define rules_python_internal earlier so Bazel 9 doesn't try to use PyInfo et al builtins by @rickeylev in #2485
  • chore: replace rules_proto with com_google_protobuf by @rickeylev in #2487
  • doc: freethreaded support changelog by @aignas in #2497
  • ci: fix CI after bazel 8 release by @aignas in #2492
  • fix: Strip trailing slash for repo url by @amartani in #2495
  • fix(pypi): pass requirements without env markers to the whl_library by @aignas in #2488
  • fix: make bazel 9 workspace recognize rules_python as the main module by @rickeylev in #2501
  • fix(gazelle): Support parsing files that use Python3.12 PEP 695 (Type Parameter Syntax) by using dougthor42's fork of go-tree-sitter by @dougthor42 in #2496
  • fix(pypi): Fix use_hub_alias_dependencies with WORKSPACE by @gholms in #2504
  • build(deps): bump astroid from 3.3.5 to 3.3.6 in /docs by @dependabot in #2490
  • docs: Fix toolchain implementation file name by @nicholasjng in #2512
  • doc: correct toolchain usage in repository_rule context docs by @aignas in #2510
  • fix: py_proto_library: external runfiles by @tpudlik in #2516
  • refactor(pypi): A better error message when the wheel select hits no_match by @aignas in #2519
  • refactor: consolidate py_executable_bazel, common_bazel by @rickeylev in #2523
  • feat(toolchain): Add support for Python 3.13.1. by @okin in #2482
  • refactor: stop warning if we don't find anything via SimpleAPI by @aignas in #2532
  • feat(pypi): only query SimpleAPI for pkgs that have shas by @aignas in #2527
  • refactor(pypi): further cleanup of pip.parse code by @aignas in #2534
  • feat: add pyi attributes/fields, original source fields by @rickeylev in #2538
  • fix(gazelle): Don't ignore setup.py files when running Gazelle by @dougthor42 in #2536
  • fix(pypi): change the parallelisation scheme for querying SimpleAPI by @aignas in #2531
  • refactor: fold per-target python version into base rules by @rickeylev in #2541
  • fix(whl_library): track sources in whl_library by @aignas in #2526
  • Updated pip and packaging versions to work with free-threading packages by @vfdev-5 in #2514
  • chore: add check for version_next markers by @rickeylev in #2542
  • feat: Add feature to expose whether the native rules are used by @jsharpe in #2549
  • chore: update changelog for 1.1.0 by @rickeylev in #2547
  • chore: update version strings in docs. by @rickeylev in #2546
  • feat: make pypi-generated targets include pyi files by @rickeylev in #2545
  • fix: _which_unchecked: don't watch PATH if binary exists. by @Ubehebe in #2552
  • chore: update release check to ignore VERSION_NEXT substring in CONTRIBUTING.md by @rickeylev in #2553
  • fix(gazelle): Fix the requirements arg to the gazelle python manifest generator. by @sputt in #2533
  • docs: note direct_pyi_files/transitive_pyi_files are usually build-time only by @rickeylev in #2555
  • refactor(pypi): rename config settings and improve docs by @aignas in #2556
  • fix(pypi): include pyi files in data attribute by @rickeylev in #2558

New Contributors

Full Changelog: 1.0.0...1.1.0

1.1.0-rc1

13 Jan 02:21
1aa0d9f
Compare
Choose a tag to compare
1.1.0-rc1 Pre-release
Pre-release

For more detailed setup instructions, see https://rules-python.readthedocs.io/en/latest/getting-started.html

Using Bzlmod

Add to your MODULE.bazel file:

bazel_dep(name = "rules_python", version = "1.1.0-rc1")

pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip")

pip.parse(
    hub_name = "pip",
    python_version = "3.11",
    requirements_lock = "//:requirements_lock.txt",
)

use_repo(pip, "pip")

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 = "7cd31b2ae3ad922c63a863916f4f45a2ea7cf7c8abd3ee20bd5019deade8bcbb",
    strip_prefix = "rules_python-1.1.0-rc1",
    url = "https://github.com/bazelbuild/rules_python/releases/download/1.1.0-rc1/rules_python-1.1.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 = "7cd31b2ae3ad922c63a863916f4f45a2ea7cf7c8abd3ee20bd5019deade8bcbb",
    strip_prefix = "rules_python-1.1.0-rc1/gazelle",
    url = "https://github.com/bazelbuild/rules_python/releases/download/1.1.0-rc1/rules_python-1.1.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

  • fix(gazelle): Fix the requirements arg to the gazelle python manifest generator. by @sputt in #2533
  • docs: note direct_pyi_files/transitive_pyi_files are usually build-time only by @rickeylev in #2555
  • refactor(pypi): rename config settings and improve docs by @aignas in #2556
  • fix(pypi): include pyi files in data attribute by @rickeylev in #2558

New Contributors

Full Changelog: 1.1.0-rc0...1.1.0-rc1

1.1.0-rc0

09 Jan 21:34
38135f7
Compare
Choose a tag to compare
1.1.0-rc0 Pre-release
Pre-release

For more detailed setup instructions, see https://rules-python.readthedocs.io/en/latest/getting-started.html

Using Bzlmod

Add to your MODULE.bazel file:

bazel_dep(name = "rules_python", version = "1.1.0-rc0")

pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip")

pip.parse(
    hub_name = "pip",
    python_version = "3.11",
    requirements_lock = "//:requirements_lock.txt",
)

use_repo(pip, "pip")

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 = "0a158f883fc494724f25e2ce6a5c3d31fd52163a92d4b7180aef0ff9a0622f70",
    strip_prefix = "rules_python-1.1.0-rc0",
    url = "https://github.com/bazelbuild/rules_python/releases/download/1.1.0-rc0/rules_python-1.1.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 = "0a158f883fc494724f25e2ce6a5c3d31fd52163a92d4b7180aef0ff9a0622f70",
    strip_prefix = "rules_python-1.1.0-rc0/gazelle",
    url = "https://github.com/bazelbuild/rules_python/releases/download/1.1.0-rc0/rules_python-1.1.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

  • tests: skip workspace-specific examples for bazel 9 by @rickeylev in #2471
  • chore: ignore examples/pip_repository_annotations bazel-bin symlink by @rickeylev in #2472
  • chore: use per-rule loads in pip_compile.bzl by @rickeylev in #2473
  • tests: make multi_python_versions pass with Bazel 9 workspace by @rickeylev in #2474
  • fix: normalize argv0 so runfiles root can be found on windows with bazel 9 by @rickeylev in #2481
  • chore: load specific bzl files instead of generic defs.bzl by @rickeylev in #2483
  • feat(pypi): support freethreaded in experimental_index_url by @aignas in #2460
  • fix: Make sure wheelmaker uses the default shell env by @shs96c in #2477
  • chore: remove find_requirements re-export from bazel_tools by @rickeylev in #2484
  • feat(gazelle): Include types/stubs packages by @ewianda in #2425
  • build(deps): bump django from 4.2.16 to 4.2.17 in /examples/bzlmod_build_file_generation by @dependabot in #2486
  • build(deps): bump rich from 13.9.3 to 13.9.4 in /tools/publish by @dependabot in #2371
  • fix: define rules_python_internal earlier so Bazel 9 doesn't try to use PyInfo et al builtins by @rickeylev in #2485
  • chore: replace rules_proto with com_google_protobuf by @rickeylev in #2487
  • doc: freethreaded support changelog by @aignas in #2497
  • ci: fix CI after bazel 8 release by @aignas in #2492
  • fix: Strip trailing slash for repo url by @amartani in #2495
  • fix(pypi): pass requirements without env markers to the whl_library by @aignas in #2488
  • fix: make bazel 9 workspace recognize rules_python as the main module by @rickeylev in #2501
  • fix(gazelle): Support parsing files that use Python3.12 PEP 695 (Type Parameter Syntax) by using dougthor42's fork of go-tree-sitter by @dougthor42 in #2496
  • fix(pypi): Fix use_hub_alias_dependencies with WORKSPACE by @gholms in #2504
  • build(deps): bump astroid from 3.3.5 to 3.3.6 in /docs by @dependabot in #2490
  • docs: Fix toolchain implementation file name by @nicholasjng in #2512
  • doc: correct toolchain usage in repository_rule context docs by @aignas in #2510
  • fix: py_proto_library: external runfiles by @tpudlik in #2516
  • refactor(pypi): A better error message when the wheel select hits no_match by @aignas in #2519
  • refactor: consolidate py_executable_bazel, common_bazel by @rickeylev in #2523
  • feat(toolchain): Add support for Python 3.13.1. by @okin in #2482
  • refactor: stop warning if we don't find anything via SimpleAPI by @aignas in #2532
  • feat(pypi): only query SimpleAPI for pkgs that have shas by @aignas in #2527
  • refactor(pypi): further cleanup of pip.parse code by @aignas in #2534
  • feat: add pyi attributes/fields, original source fields by @rickeylev in #2538
  • fix(gazelle): Don't ignore setup.py files when running Gazelle by @dougthor42 in #2536
  • fix(pypi): change the parallelisation scheme for querying SimpleAPI by @aignas in #2531
  • refactor: fold per-target python version into base rules by @rickeylev in #2541
  • fix(whl_library): track sources in whl_library by @aignas in #2526
  • Updated pip and packaging versions to work with free-threading packages by @vfdev-5 in #2514
  • chore: add check for version_next markers by @rickeylev in #2542
  • feat: Add feature to expose whether the native rules are used by @jsharpe in #2549
  • chore: update changelog for 1.1.0 by @rickeylev in #2547
  • chore: update version strings in docs. by @rickeylev in #2546
  • feat: make pypi-generated targets include pyi files by @rickeylev in #2545
  • fix: _which_unchecked: don't watch PATH if binary exists. by @Ubehebe in #2552
  • chore: update release check to ignore VERSION_NEXT substring in CONTRIBUTING.md by @rickeylev in #2553

New Contributors

Full Changelog: 1.0.0...1.1.0-rc0