Skip to content

Commit bff5ce1

Browse files
committed
document the target_platforms attribute
1 parent 2a2e136 commit bff5ce1

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

docs/pypi/download.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,21 @@ This will not work for sdists with C extensions, but pure Python sdists may stil
113113
approach.
114114
:::
115115

116+
By default we select the host `{os}_{arch}` platform defined in the `rules_python` `MODULE.bazel`
117+
file. This means that `rules_python` by default does not come with cross-platform building support
118+
because some packages have very large wheels and users should be able to use `bazel query` with
119+
minimal overhead. As a result, we think that it is up to the user to configure the `pip.parse`
120+
calls and select which platforms they want to target via
121+
{obj}`pip.parse.target_platforms` attribute:
122+
```starlark
123+
# Enable free threaded and non-freethreaded switching on the host platform
124+
target_platforms = ["{os}_{arch}", "{os}_{arch}_freethreaded"],
125+
126+
# Enable building for `linux_x86_64` containers and the host platform.
127+
target_platforms = ["{os}_{arch}", "linux_x86_64"],
128+
)
129+
```
130+
116131
### Using `download_only` attribute
117132

118133
Let's say you have two requirements files:

0 commit comments

Comments
 (0)