-
-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Handle single-file module pypi-deps in py_pex_binary #392
fix: Handle single-file module pypi-deps in py_pex_binary #392
Conversation
Thanks! Would you be able to turn the manual test case into an automated one? @thesayyn Can you take a look? |
Looks to be a bit more work than just adding a test case, as I don't see any tests for the py-pex-binary rule. I'll leave test automation up to you guys if that's okay |
Could you also add a test for this? |
e1c3618
to
a11b203
Compare
Gave it a shot in a11b203 |
@ekfeet could you rebase this? |
it seems to be failing due to host not having a specific version of python, could we just remove the interpreter constraints so it works with any version of python? |
Let uniquify handle deduplication.
a11b203
to
08aef3b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! @thesayyn says this is good to go
Addresses the bug in #391.
Single-file modules such as
six
andtyping-extensions
does not work with the currentpy_pex_binary
rule, since it's assumed that there exist a sub-directory withinsite-packages
that is not dist-info.An example of what a single-file module pypi-dep looks like:
Since
Distribution.load(..)
takes in thesite-packages
directory, we only emit this part of the path, and letuniquify=True
handle deduplication after_map_srcs
is applied.Changes are visible to end-users: no
Test plan
Add
six
to requirements and"@pypi_six//:pkg"
as a dep to the py_pex_binary example; then importsix
in py_pex_binary'ssay.py
. Printing the module orcowsay.cow(f"{six}")
shows that the previous example and single-files modules now also work.