You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: Handle single-file module pypi-deps in py_pex_binary (#392)
Addresses the bug in
#391.
Single-file modules such as `six` and `typing-extensions` does not work
with the current `py_pex_binary` rule, since it's assumed that there
exist a sub-directory within `site-packages` that is not dist-info.
An example of what a single-file module pypi-dep looks like:
```
ls bazel-reppro_pex_err/external/rules_python~~pip~pypi_311_six/site-packages/
__init__.py six-1.16.0.dist-info six.py
```
Since `Distribution.load(..)` takes in the `site-packages` directory, we
only emit this part of the path, and let `uniquify=True` handle
deduplication after `_map_srcs` is applied.
---
### Changes are visible to end-users: no
### Test plan
<!-- Delete any which do not apply -->
- Manual testing; please provide instructions so we can reproduce:
Add `six` to requirements and `"@pypi_six//:pkg"` as a dep to the
py_pex_binary example; then import `six` in py_pex_binary's `say.py`.
Printing the module or `cowsay.cow(f"{six}")` shows that the previous
example and single-files modules now also work.
0 commit comments