-
Notifications
You must be signed in to change notification settings - Fork 430
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
$PIPX_HOME on macOS since release 1.3.0 breaks many scripts #1198
Comments
Since 1.3, pipx bases the I personally think it makes sense to stick to the platform specific convention. For an immediate fix to your problem you could symlink the binary you want to use in a shebang to a directory without spaces in the path. You can then safely use that in the shebang. We should definitely add this as a warning on the docs for mac though IMO. |
Thanks for the explanation. I've updated the title to be more precise. |
I found quite a lengthy discussion (tox-dev/platformdirs#4) on the platformdirs repo about suporting XDG, which is essentially what you're asking for. They ended up not supporting it for macOS. There was an interesting comment though on symlinking @gaborbernat as maintainer of platformdirs, do you have any other insight here? |
Nothing besides what was already discussed in that issue 🤔 |
I would suggest adding a note to the mac installation docs, in regards to symlinking |
Well this only happens for awscli, no? |
Any application one would use in a shebang I guess. Not that I could think of another example to be fair. |
You are welcome to put in a PR to be added to some FAQ section. |
Based on this comment, I propose this issue should be re-opened. |
It seems to happen for lots of projects: I suspect it affects any project not using "console scripts" for their console scripts, but instead providing explicit scripts.
|
It is currently being worked on reverting the Besides, probably this issue should be reported at the |
I see Gitznik in this comment proposed that the issue be solved with in pip or the packages themselves. Personally, I'd prefer to see the issue solved at the core and add support for spaces in shebangs. Let's stop exposing this broken behavior on downstream workarounds. The symlink workaround is terrible and should be avoided. |
That's too bad, because other Unix users are affected too, except that they avoid having spaces in their directory names and perpetuate the expectation that spaces are invalid. |
I was mistaken. I thought I'd installed pipx using pipx, but I see on this machine I have pipx installed using homebrew, so it was a bad example. The reason console scripts aren't affected by the shebang in console scripts is because pip provides a workaround for those scripts:
|
This is about making sure the default pipx behavior is robust. We can't really prevent users from setting their pipx home to a path containing spaces. I may extend my PR to print a warning if a space is found in the pipx home. I don't think this project is the right place to discuss whether spaces should or should not be allowed in shebangs. |
Today I learned that the shell I use actually supports spaces in pathnames in shebangs. Since it uses |
Yes, this is intended to warn users that having a pipx_home path with spaces in it can lead to a lot of problems. See this discussion for more details. To solve this you can
|
I will actually close this issue, as with version 1.5, this is no longer an issue in the default pipx behavior. |
Thank you. So I just did Where I was personally confused (and possibility others who aren't pipx experts will be too) is that I was reading in to this some kind of implication that I, as a user, had made the choice to use |
Gotcha. If you have an idea how to word this more clearly, you're welcome to open a PR :) The warning is generated here: Lines 114 to 116 in 8fbc085
|
It appears that since release 1.3.0, when installing pipx on macOS Ventura, it chooses to set
$PIPX_HOME
to~/Library/Application Support/pipx
, which creates a problem for scripts likeawscli
where the directory forms part of the shebang, because shebangs are not allowed to have spaces in it.As recent as release 1.2.1, $PIPX_HOME on macOS Ventura is set to be
~/.local/pipx
which doesn't cause problems.How to reproduce
I was using Python 3.8 installed using pyenv.
It prints the below:
Expected behavior
$PIPX_HOME
should be/Users/test3/.local/pipx
The text was updated successfully, but these errors were encountered: