-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
pyenv-rehash: look for python* #379
Conversation
@blueyed Could you explain the actual use case scenario of this? |
@yyuu |
Idealistically all |
So it's just for internal calls? |
Kind of internal call, or some kind of legacy code. I've just forgotten what that's for.... The PYENV_DIR will be read by ./libexec/pyenv and pyenv will once try to chdir to the directory if it is possible or not. However it will return to original cwd once it suceeded to chdir. So if I understand correctly it isn't so meaningful. |
Re-opening. See #404 for where this is relevant. |
dab4742
to
fd8af9f
Compare
This is required for the shims to handle `#!/usr/bin/env python3` in a shebang, just like `python` is handled currently: it will set `PYENV_DIR` to the root of the invoked script, which is required for a `.python-version` script to get picked up from there. This was rejected for rbenv, where it does not make much sense (rbenv/rbenv#735). Ref: pyenv#368 (comment)
`PYENV_FILE_ARG` is used here to make use of `abs_dirname` later in `libexec/pyenv`. Fixes pyenv#404
fd8af9f
to
493f036
Compare
Good catch 👍 I confirmed the behaviour reported on #404, and confirmed that this changes the behaviour to respect local version at symlink destination. I believe your changes seem to be reasonable and useful for most cases, though it changes current behaviour slightly. Please add tests for this feature, then I'll merge this. (and, I think it's worth to reopen PR on rbenv as well) |
I added tests in 438e828 and merged into master. Thanks for PR. |
This was rejected for rbenv, where it does not make much sense
(rbenv/rbenv#735).
Ref: #368 (comment)