-
-
Notifications
You must be signed in to change notification settings - Fork 31k
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
Add py --activate
command
#114881
Labels
Comments
zooba
added a commit
to zooba/cpython
that referenced
this issue
Feb 14, 2024
…uncher. These will create additional aliases alongside the launcher for a particular Python install.
zooba
added a commit
to zooba/cpython
that referenced
this issue
Feb 26, 2024
zooba
added a commit
to zooba/cpython
that referenced
this issue
Feb 26, 2024
zooba
added a commit
to zooba/cpython
that referenced
this issue
Feb 28, 2024
zooba
added a commit
to zooba/cpython
that referenced
this issue
Mar 20, 2024
zooba
added a commit
to zooba/cpython
that referenced
this issue
Aug 27, 2024
zooba
added a commit
to zooba/cpython
that referenced
this issue
Aug 27, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Feature or enhancement
For a per-user install of the launcher (the current default), we have a user-writable directory on PATH. We could use this in combination with the launcher to support an "activate" command that reliably puts a selected version of Python on PATH for you without adding the actual install directory.
For example (note that this is hypothetical and fake right now):
My thinking here is that we add a new section to
py.ini
that converts the launcherargv[0]
into a Company/Tag value (equivalent of passing-V:
). We need a new section to avoid conflicting with existing shebang commands, but should be able to write it from the launcher call easily enough. We'd get to decide whether to use this new mapping to override shebang lines and environment variables (gut feel is to ignore shebangs but honour env vars).An alternative to the
py.ini
section would be apython.exe.ini
adjacent to the executable and specific to it, so we create a few more files, but have a much simpler time handling them.We should also have a
py --deactivate
option to remove the files.py --activate
would activate the interpreter that is launched for justpy
(that is, with--activate
we do the normal search but instead of launching it, we write it into a config file and ensure the global names exist).Per-machine installs would require admin privileges to do this, as they're in a per-machine directory. I think that's okay - we can have a helpful error message.
Linked PRs
The text was updated successfully, but these errors were encountered: