Skip to content
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

Allow pip install --executable=/path to set #! path in scripts. #12088

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

riastradh
Copy link

This is useful for cross-compiling, when the path to the Python executable that is being used to run pip, available at sys.executable, is not the same as the path to the Python executable that the installed product in a cross-compiled system needs to run.

For example, if your toolchain lives at /build/aarch64--netbsd but you're building software to be installed at /opt/pkg, then sys.executable might be /build/aarch64--netbsd/bin/python3.10 but the shebang line of any scripts installed must /opt/pkg/bin/python3.10. With this change, you can accomplish that with:

/build/aarch64--netbsd/bin/python3.10 -m pip install --executable=/opt/pkg/bin/python3.10 ...

fix #12087

This is useful for cross-compiling, when the path to the Python
executable that is being used to run pip, available at
sys.executable, is not the same as the path to the Python executable
that the installed product in a cross-compiled system needs to run.

For example, if your toolchain lives at /build/aarch64--netbsd but
you're building software to be installed at /opt/pkg, then
sys.executable might be /build/aarch64--netbsd/bin/python3.10 but the
shebang line of any scripts installed must /opt/pkg/bin/python3.10.
With this change, you can accomplish that with:

/build/aarch64--netbsd/bin/python3.10 -m pip install --executable=/opt/pkg/bin/python3.10 ...

fix pypa#12087
@riastradh
Copy link
Author

Are these magic instructions for a github bot, or should I be responding to these comments somehow, or...?

@pfmoore
Copy link
Member

pfmoore commented Jul 20, 2023

I'm assuming it's a spammer. I don't know how to block them, unfortunately.

@pypa pypa deleted a comment Jul 20, 2023
@pypa pypa deleted a comment Jul 20, 2023
@pypa pypa deleted a comment Jul 20, 2023
@pypa pypa deleted a comment Jul 20, 2023
@pypa pypa deleted a comment Jul 20, 2023
@pypa pypa deleted a comment Jul 20, 2023
@pypa pypa deleted a comment Jul 20, 2023
@pypa pypa deleted a comment Jul 20, 2023
@pypa pypa deleted a comment Jul 20, 2023
@pypa pypa deleted a comment Jul 20, 2023
@cosmicexplorer
Copy link
Contributor

Adding a test case would be really helpful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Provide option to pip install to set #! line in scripts
4 participants