Closed estyxx closed 5 years ago
ahh, good catch. I'll have to hunt down an osx machine to test with.
But the name of the poetry venv does not appear anyway...
could you elaborate a bit on this please? does it fail to activate? is VIRTUAL_ENV
set/unset in a poetry project directory?
No, The $VIRTUAL_ENV variable is empty, who should set it?
I was inside a directory with pyproject.toml
, I fixed locally the petry.zsh file (as I mentioned above) to be able to run your tool...
And [maybe I did not understand the purpose of this tool... sorry if I did...] I was expecting to visualize the name of the activate poetry environment in the prompt element with powerlevel9k like anaconda does... Maybe it's a feature :)
or print something at least...
VIRTUAL_ENV
should be set automatically after cd
ing to a directory with a pyproject.toml file, if this plugin worked correctly and sourced the poetry bin/activate
script. if it's not, then I'm guessing something went wrong with that...
this plugin doesn't actually output anything, but poetry+virtualenv itself should update your prompt when activated. I'm a powerlevel user too (👊), and the virtualenv prompt segment picks up my venv correctly, on Linux at least.
could you try maybe putting some echo statements to show the value of $venv
after your modifications above? I'm curious if ${venv}/bin/activate
exists? also what's your poetry version?
Ok, I understood the problems:
venv=$(command poetry debug:info 2>/dev/null | sed -n "s/\ *\* Path:\ *\(.*\)/\1/p")
ahh, cool. thanks for the fix!
The grep installed on osx doesn't have the "-P" (Perl regex) option.
Using
sed
here instead of grep should fix it:But the name of the poetry venv does not appear anyway...