Code refactor proposal: Major change in rehash hook #3152
Unanswered
ChristianFredrikJohnsen
asked this question in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I was looking at optimizing rehash, and noticed that a bunch of time was spent sourcing the scripts:
conda.bash
andsource.bash
, both inpyenv.d/exec
.I have done some slight optimizations in
conda.bash
, but I don't know about thesource.bash
file.It was created in this pull request which says
source.bash
is a temporary fix for something. But as you can see further down the line, the problem seems to not even be solved with this merge (talking about the gettext.sh). I have not been able to reproduce that problem.In any case, I am questioning whether these source scripts are even being used. They don't work at all for me, partly because I am using
zsh
, and there is no shebang in the prototype shim:So it's trying to use
BASH_SOURCE
, but of course, it returns "" (empty string), because I am not using bash.Second, the activate function (as an example)
Doesn't even work. Well, first you need to make sure that you do init of
virtualenv
before init ofpyenv
in~/.zshrc
, since if not, you will use theactivate
function of virtualenv, which I guess this setup is trying to override.But even if I try this activate which is generated by
pyenv.d/rehash
source.bash`, I just get this output:And the python version does not change. The entire setup is extremely messy.
I don't see the use of this activate command at all, and I am wondering if it can be removed entirely.
Beta Was this translation helpful? Give feedback.
All reactions