-
-
Notifications
You must be signed in to change notification settings - Fork 30k
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
bpo-35003: bin/activate should always be present #18083
Conversation
The Scripts/bin thing is not specific to venv - for whatever reason, the original Windows implementation chose to use "Scripts" rather than "bin" for the executables directory under Windows, and I don't think it can be changed now without affecting backward compatibility. The venv code just fits into the existing, wider theme. My guess is you would need to propose a PEP to move everything over from "Scripts" to "bin" in the Windows Python world, and show that it would not break any existing code anywhere - seems like a tall order. This issue was already rejected before you added your PR so I'm not sure why you went to the trouble of creating a PR. Thanks for trying to help, but I think this PR should be closed for the above reasons. |
IMHO we should not copy, that would just be confusing. If anything we should make the bin folder a junction for the Scripts. |
I don't think we don't want to junction "all" the files, only those that are bash-shell-related... otherwise we'd have to change the PEP and we're back to all the reasons why it was rejected in the first place. A soft-link (if available) to Plus, junctions are not always available on all systems, although that's not my primary concern. The primary issue is the thousands of developers around the world using bash in CI that have had to solve this rather absurd problem in thousands of different ways ( The rest of Scripts/ belongs where it is. |
IMO, It's a platform difference. If you're developing on both Windows and Unix, you need to be aware of platform differences (even if you try to use some sort of Unix-lookalike that provides bash, it still can't hide the fact that you're not on Unix totally) and Scripts vs bin is just one of many such differences. Yes, it's an absurd and annoying difference, but the reasons it exists are historical, and changing it now is (as @vsajip said) likely to be way too big an exercise. Patching over just one part of the problem may help some specific cases, but overall will be more confusing, not less. (Why is |
I thought we only target here Windows, that always has junctions.
Soft links don't work always on Windows so that can't be.
Sounds to me like a bad assumption, and should be fixed in the documentation. The only way I can see for us to improve on this is to generate the bin, but that mirrors and is always whatever Script is (aka Windows NTFS junction). |
I'm closing this, as having things in |
it is not a "platform difference", the platform in this case is |
Not in general. Python uses |
Could we please revisit this? |
Nothing has changed since the original analysis of this. |
But I don't understand we can't create both bin/activate: # This file must be used with "source bin/activate" *from bash*
# you cannot run it directly
scriptdir=`dirname "$BASH_SOURCE"`
. $scriptdir/../Scripts/activate |
Like it or not, the convention is to use
|
I guess you can argue if running bash (msys/git-bash/whatever) on Windows is POSIX or Windows ;) Just so the original problem statement is understood, read the original post in: pypa/virtualenv#1418 Sorry for being so persistent, I just think it's silly to not make this small and simple fix. |
I would like to challenge the status quo and kindly ask that we revisit this issue. I opened pypa/virtualenv#2404 to this effect. A previous pypa/virtualenv#1418 was closed after the issue was closed here. |
One of the key issue is CI automation where Windows needs to be special cased making this a PITA. @vsajip I would return your quote from the Zen of Python ;) :
Therefore I see no reason to make a special case for Windows. |
Look, it wasn't my original decision, and
|
Agreed. Changing this would have far more implications than being a simple change to venv/virtualenv. Like it or not, code that special cases the layouts for Windows vs Unix is widespread, and changing the layout would cause significant disruption. It's not impossible, but the benefits would have to be equally significant at this point. If you want to address this, the best way would probably be to start with introducing APIs somewhere that "hide" the difference, so that things like the CI automation you mention can be written in a platform agnostic way. We can then promote those APIs and hope that over time, existing code will migrate to them. Once sufficient time has passed, we could change the scheme and tell any remaining users hard coding the locations to use the APIs. Of course, at this point, the main justification for changing the scheme has beel lost, as the APIs enable platform-agnostic code anyway 🙂 Also, if you want to proceed with this, remember to consider what tools like I completely agree that having different layouts is an annoying wart. But I think you're hugely underestimating the amount of work to change things at this point. |
Ensures that the common
bin/activate
, used by shell scripts on all platforms, is always present on all platforms.Possibly this should be an option, but that seems like overkill.
https://bugs.python.org/issue35003