Commit 1c894ea
committed
fix(pypi): include RECORD file in installed wheel targets
Currently, `importlib.metadata.files()` returns `None` for packages installed via `rules_python`'s wheel rules. This happens because the `RECORD` file in the `.dist-info` directory is explicitly excluded from the `data` attribute of the generated `py_library` targets.
To fix this, remove `**/*.dist-info/RECORD` from the `_data_exclude` list in `whl_library_targets.bzl`. This ensures that the `RECORD` file is preserved in the runfiles and available at runtime, enabling `importlib.metadata.files()` to correctly list the files in the package.1 parent ee7c54b commit 1c894ea
3 files changed
Lines changed: 38 additions & 4 deletions
File tree
- python/private/pypi
- tests/venv_site_packages_libs
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
374 | 374 | | |
375 | 375 | | |
376 | 376 | | |
377 | | - | |
378 | | - | |
379 | | - | |
380 | | - | |
381 | 377 | | |
382 | 378 | | |
383 | 379 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
0 commit comments