@@ -54,16 +54,14 @@ http_archive(
54
54
)
55
55
```
56
56
57
- To register a hermetic Python toolchain (please refer to
58
- [ this link] ( https://python-build-standalone.readthedocs.io/en/latest/quirks.html ) for the list of
59
- quirks you may find while using the toolchain), you can add to the ` WORKSPACE ` file:
57
+ To register a hermetic Python toolchain rather than rely on whatever is already on the machine, you can add to the ` WORKSPACE ` file:
60
58
61
59
``` python
62
60
load(" @rules_python//python:repositories.bzl" , " python_register_toolchains" )
63
61
64
- # Multiple versions are available in the @rules_python//python:versions.bzl file.
65
62
python_register_toolchains(
66
63
name = " python310" ,
64
+ # Available versions are listed in @rules_python//python:versions.bzl.
67
65
python_version = " 3.10" ,
68
66
)
69
67
@@ -78,6 +76,9 @@ pip_parse(
78
76
)
79
77
```
80
78
79
+ > You may find some quirks while using this toolchain.
80
+ > Please refer to [ this link] ( https://python-build-standalone.readthedocs.io/en/latest/quirks.html ) for details.
81
+
81
82
Once you've imported the rule set into your ` WORKSPACE ` using any of these
82
83
methods, you can then load the core rules in your ` BUILD ` files with:
83
84
@@ -133,8 +134,8 @@ one another, and may result in downloading the same wheels multiple times.
133
134
134
135
As with any repository rule, if you would like to ensure that ` pip_install ` is
135
136
re-executed in order to pick up a non-hermetic change to your environment (e.g.,
136
- updating your system ` python ` interpreter), you can completely flush out your
137
- repo cache with ` bazel clean --expunge ` .
137
+ updating your system ` python ` interpreter), you can force it to re-execute by running
138
+ ` bazel sync --only [pip_install name] ` .
138
139
139
140
### Fetch ` pip ` dependencies lazily
140
141
0 commit comments