-
Notifications
You must be signed in to change notification settings - Fork 168
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
Fixes to support PREFIX containing spaces #449
Conversation
On Windows, add quotes to correctly invoke conda in path with spaces. On Linux/macOS, print a clear error until conda/constructor#449 is fixed.
@chenghlee @mcg1969 If there is anything that is necessary or helpful (such as specific tests) to merge this PR, feel free to let me know, I am quite interested in this, thanks! |
Sorry for the delay in reviewing. But I can't seem to get this to work on a Mac. For one thing, it seems that the changes were attempted only for the case where the prefix is offered on the command line; that is, Furthermore, on the Mac, the Here's the good news. I modifying the header so that it skips the space checking for interactive input—basically collapsed that entire case statement to |
On Windows, add quotes to correctly invoke conda in path with spaces. On Linux/macOS, print a clear error until conda/constructor#449 is fixed.
@mcg1969 Thanks for the review, and sorry for the delay in coming back to this!
I didn't have a Mac to test, but I believe the issue is that
Thanks for tip, I've adopted it in the rebase. I've now tested both the batch and interactive mode, and both works with this updated patch. N.B: The installed conda environment have issues with the #!/bin/sh
'''exec' "/tmp/venv with spaces/bin/python" "$0" "$@"
' ''' But that's for another day and repository. |
xref conda/conda#186 |
Right now, This doesn't work:
This does work:
However, once you need to run an entry point executable (or any script with a shebang), problems arise, as expected:
I'll see if I can get your virtualenv-inspired solution on upstream conda. |
conda/conda#11676 hasn't landed yet but I am tidying up here and making sure I understand the changes. Sorry about the getopt[s] noise 😬 |
@jaimergp Thanks for pushing this forward here and on the conda repo, I've added a small follow-up commit. |
I just realized that spaces might break a properly initialized
However this PR would allow spaces in prefix for apps that only want to deploy something without |
@kenodegard I think there's a Github UI bug and I can't see anymore what changes you were requesting, but I am guessing they are now addressed (hopefully! 😂). See last comment for a summary, but happy to answer any other questions. |
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.
Otherwise 🚀
Looks like it was not needed after all :D |
Oh our dear PR, your time has come! You can now join |
Thank you @nsoranzo and sorry for the longest review ever :D |
Thank @jaimergp and all contributors for the work on this! 🎉 |
Awesome work everyone! |
{ info added by @jaimergp; original description was empty }
I'll discuss the main points @nsoranzo and I are addressing here. There are two parts: the implementation itself, and then how we managed to test this reliably.
Implementation:
PREFIX
or derivatives might need quoting to escape spaces in all the installer types.conda/conda
level. I submitted Better support prefixes with spaces conda#11676 as a result. Note this has hasn't been merged yet, and we should possibly consider it a release blocker (but not a merge blocker), which requires updating the minimumconda-standalone
to a version not yet released (4.15?).check_path_spaces
(defaults toTrue
) was a Windows-only keyword to change this behaviour. We have now extended this key to all platforms and installers, with a default value ofTrue
. That means that spaces will not be allowed by default, but a user can opt in by setting it toFalse
.Tests:
Moved to #560
This would close ContinuumIO/anaconda-issues#716