We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
-vvv
I recently switched back to tcsh from bash and found that poetry shell now fails to activate the python virtual environment.
tcsh
bash
poetry shell
ejo@ufo:blynclight -> poetry --version Poetry version 1.0.9 ejo@ufo:blynclight -> poetry shell Spawning shell within /Users/ejo/Library/Caches/pypoetry/virtualenvs/blynclight-JhnzrnPE-py3.7 ejo@ufo:blynclight -> . /Users/ejo/Library/Caches/pypoetry/virtualenvs/blynclight-JhnzrnPE-py3.7/bin/activate /usr/bin/.: Permission denied. ejo@ufo:blynclight -> echo $shlvl 2
The $shlvl variable indicates that a new shell was invoked, but the errors indicate that the virtual environment was not properly activated.
It appears that poetry shell is attempting to use the bash method of activating the virtual environment which does not work for tcsh (as expected).
Inspection of the two methods:
poetry.utils.shell.Shell._get_activate_script
poetry.utils.shell.Shell._get_source_command
show explicit checks for csh and fish but not tcsh.
When the user's shell is tcsh, both of those methods will mis-identify the shell as bash and it all ends badly.
I submitted PR #2583 which expands the explicit checking done in those methods to include tcsh and lumps handling for csh and tcsh together.
The text was updated successfully, but these errors were encountered:
My workaround until the PR is integrated is to add this to my $HOME/.tcshrc file:
if ( ${?POETRY_ACTIVE} != '0' ) then source `poetry env info -p`/bin/activate.csh endif
This detects a shell with POETRY_ACTIVE and does the right thing.
$ poetry shell .... $ # good to go
Sorry, something went wrong.
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Successfully merging a pull request may close this issue.
-vvv
option).Issue
I recently switched back to
tcsh
frombash
and found thatpoetry shell
now fails to activate the python virtual environment.The $shlvl variable indicates that a new shell was invoked, but the errors indicate that the virtual environment was not properly activated.
It appears that
poetry shell
is attempting to use the bash method of activating the virtual environment which does not work for tcsh (as expected).Inspection of the two methods:
poetry.utils.shell.Shell._get_activate_script
poetry.utils.shell.Shell._get_source_command
show explicit checks for csh and fish but not tcsh.
When the user's shell is tcsh, both of those methods will mis-identify the shell as bash and it all ends badly.
I submitted PR #2583 which expands the explicit checking done in those methods to include tcsh and lumps handling for csh and tcsh together.
The text was updated successfully, but these errors were encountered: