-
Notifications
You must be signed in to change notification settings - Fork 544
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
Added setup_py_script
macro to pip_parse
and pip_install
.
#575
Conversation
2063ce7
to
f6a00a5
Compare
@alexeagle I think you mentioned at one point needing to write a wrapper for what I think (based on my recollection) were these |
Friendly ping on this PR 😅 |
@alexeagle another friendly ping 😅 |
This PR has been rebased on top of #589 to save myself from running into conflicts. |
427ee26
to
cb135ea
Compare
This has now been rebased on #598 |
It seems the Would be nice to get this in too so there are options for all pip install-able executables. |
Up to you @UebelAndre, but you may want to wait for this? #715
Note: if you urgently need this, don't let that block. It can always be explored at some later date. |
@groodt I definitely do want the ability to use setup.py generated scripts but I don’t care what the plumbing behind the scenes looks like. Are you saying this functionality might already be supported after that PR? |
Try this with one of your wheels and you might see what I mean.
If you take a look at https://github.com/bazelbuild/rules_python/pull/715/files#diff-0e793dde90299011d8b9034e303b0d029270c36f27c55dbd900a5835ccf2fa25R76 you are able to define where the scripts are installed (i.e. ./bin). This includes entry_point console scripts and legacy scripts (like those in this PR). It does so in a PEP compliant manner. This hopefully means we can stop with so much custom code dealing with wheels as zip files and so much fiddling with locations on the filesystem where we unzip things in a non-standards-compliant manner. All we then need to do is point Bazel rules at the right locations once the wheels are unpacked. |
This is still very much a desired feature but I no longer have bandwidth to continue working on it. Closing this out in hopes that someone else can contribute the functionality. |
PR Checklist
Please check if your PR fulfills the following requirements:
.par
files. See CONTRIBUTING.md for infoPR Type
What kind of change does this PR introduce?
What is the current behavior?
Some python packages provide executable scripts that are not tracked as entry points in the wheel. These come from setup.py and are only created once the package is installed (
setup.py
runs). I'm trying to find a way to use those scripts in other Bazel rules I've written.Issue Number: N/A
What is the new behavior?
The changes here introduce a
setup_py_script
macro topip_parse
andpip_install
that are similar toentry_point
but specifically access scripts that created bysetup.py
scripts. This change saves users from having to write their own workaround by accessing the wheel or the output*.data
directory contents directly.Does this PR introduce a breaking change?
Other information