Commit 1ebc93f
feat(pypi): enable pipstar by default (#3225)
Before this PR we were using our python helpers to parse the whl
METADATA for a
particular host (or experimentally - target) platform and the fixed
dependency
list would be written to the `BUILD.bazel` files materialized by the
`whl_library` repository rule.
This PR adds extra plumbing to leverage the Starlark implementation of
the
METADATA file parsing (a.k.a. pipstar) which moves the evaluation to
analysis
phase as we will get the target platform details via the
`env_marker_config_setting` from the `toolchain` used for the
dependencies.
Since users are normally working with a subset of platforms that the
METADATA
would pull in, we are writing the list of packages from the requirements
file to
a `bzl` file so that `pipstar` knows which packages to consider when
parsing the
METADATA. This will ensure that `bazel query` continues to work.
Since just passing the list of packages to the `whl_library` would cause
refetches of all of the `whl_library` dependencies when we add or remove
a
package, we pass a path where to load the symbol called `packages` from,
which
means that only the analysis phase will be affected because the macros
will be
re-evaluated if one adds or removes a package.
We still need to download the correct platform-specific wheels for the
right
platform in order to fully resolve the referenced tickets. With this PR
we are
deprecating the `experimental_target_platforms` attribute since it has
no longer
any effect.
Fixes #2949
Work towards #260
Work towards #2241
---------
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>1 parent 79f6546 commit 1ebc93f
File tree
24 files changed
+267
-134
lines changed- examples/pip_parse_vendored
- python
- pip_install
- private
- pypi
- tests
- implicit_namespace_packages/testdata
- ns-sub1/ns-sub1-1.0.dist-info
- ns-sub2/ns_sub2-1.0.dist-info
- pypi
- extension
- generate_whl_library_build_bazel
- hub_builder
- whl_library_targets
- whl_with_build_files/testdata/somepkg-1.0.dist-info
24 files changed
+267
-134
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
77 | 85 | | |
78 | 86 | | |
79 | 87 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| |||
91 | 91 | | |
92 | 92 | | |
93 | 93 | | |
94 | | - | |
95 | | - | |
96 | | - | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
97 | 97 | | |
98 | 98 | | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
99 | 103 | | |
| 104 | + | |
100 | 105 | | |
101 | 106 | | |
102 | 107 | | |
| |||
112 | 117 | | |
113 | 118 | | |
114 | 119 | | |
| 120 | + | |
115 | 121 | | |
116 | 122 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
26 | 25 | | |
27 | 26 | | |
| 27 | + | |
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
18 | 17 | | |
19 | 18 | | |
| 19 | + | |
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
| 23 | + | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
26 | 27 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
| 25 | + | |
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
157 | 157 | | |
158 | 158 | | |
159 | 159 | | |
160 | | - | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | | - | |
167 | | - | |
168 | 160 | | |
169 | 161 | | |
170 | 162 | | |
| |||
408 | 400 | | |
409 | 401 | | |
410 | 402 | | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
411 | 412 | | |
412 | 413 | | |
413 | 414 | | |
| |||
Lines changed: 1 addition & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
6 | | - | |
7 | 5 | | |
8 | 6 | | |
9 | | - | |
| 7 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
| 75 | + | |
75 | 76 | | |
76 | 77 | | |
77 | 78 | | |
| |||
82 | 83 | | |
83 | 84 | | |
84 | 85 | | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
96 | 93 | | |
97 | 94 | | |
98 | 95 | | |
| |||
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
451 | 451 | | |
452 | 452 | | |
453 | 453 | | |
| 454 | + | |
454 | 455 | | |
455 | 456 | | |
456 | 457 | | |
| |||
0 commit comments