From 448a474c7a948d1b4a0db23b3993312a2d88f473 Mon Sep 17 00:00:00 2001 From: Jonathon Belotti Date: Tue, 10 May 2022 17:29:37 +1000 Subject: [PATCH 1/2] Add caveat about `python_register_toolchains` rule's hermeticity. --- README.md | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 6b5297e1ea..1828656491 100644 --- a/README.md +++ b/README.md @@ -54,7 +54,9 @@ http_archive( ) ``` -To register a hermetic Python toolchain rather than rely on whatever is already on the machine, you can add to the `WORKSPACE` file: +### Toolchain registration + +To register a hermetic Python toolchain rather than rely on a system-install interpreter for runtime execution, you can add to the `WORKSPACE` file: ```python load("@rules_python//python:repositories.bzl", "python_register_toolchains") @@ -77,8 +79,11 @@ pip_parse( ) ``` -> You may find some quirks while using this toolchain. -> Please refer to [this link](https://python-build-standalone.readthedocs.io/en/latest/quirks.html) for details. +After registration, your Python targets will use the toolchain's interpreter during execution, but a system-installed interpreter +is still required to 'boostrap' Python targets (see https://github.com/bazelbuild/rules_python/issues/691). +You may also find some quirks while using this toolchain. Please refer to [python-build-standalone documentation's _Quirks_ section](https://python-build-standalone.readthedocs.io/en/latest/quirks.html) for details. + +### "Hello World" Once you've imported the rule set into your `WORKSPACE` using any of these methods, you can then load the core rules in your `BUILD` files with: From 201eae655476f78c3ce6de323aff8f1aa3f26911 Mon Sep 17 00:00:00 2001 From: Jonathon Belotti Date: Tue, 10 May 2022 17:32:35 +1000 Subject: [PATCH 2/2] Fix typos and grammar --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 1828656491..0055b6d36a 100644 --- a/README.md +++ b/README.md @@ -56,7 +56,7 @@ http_archive( ### Toolchain registration -To register a hermetic Python toolchain rather than rely on a system-install interpreter for runtime execution, you can add to the `WORKSPACE` file: +To register a hermetic Python toolchain rather than rely on a system-installed interpreter for runtime execution, you can add to the `WORKSPACE` file: ```python load("@rules_python//python:repositories.bzl", "python_register_toolchains") @@ -80,7 +80,7 @@ pip_parse( ``` After registration, your Python targets will use the toolchain's interpreter during execution, but a system-installed interpreter -is still required to 'boostrap' Python targets (see https://github.com/bazelbuild/rules_python/issues/691). +is still used to 'bootstrap' Python targets (see https://github.com/bazelbuild/rules_python/issues/691). You may also find some quirks while using this toolchain. Please refer to [python-build-standalone documentation's _Quirks_ section](https://python-build-standalone.readthedocs.io/en/latest/quirks.html) for details. ### "Hello World"