se-jaeger / zsh-activate-py-environment

ZSH plugin that automagically detects and activates your python environments (poetry, virtualenv, conda) while traversing directories.
Apache License 2.0
26 stars 5 forks source link

feat: create a poetry virtual environment if it doesn't exist #4

Closed tapyu closed 9 months ago

tapyu commented 9 months ago

When entering in a Poetry Python project, zsh-activate-py-environment tries to activate a new shell without checking if poetry env info --path returns an error. This is the case when the virtual environment has not been created: image

This PR first check if poetry env info --path return success, indicating that there exists a virtual environment. If not, zsh-activate-py-environment creates a new virtual environment and then activates it.

tapyu commented 9 months ago

Please, squash this PR, I stupidly pushed .vscode/ in the first commit.

tapyu commented 9 months ago

Now it is fully functional

Screencast from 19-12-2023 20:35:30.webm

se-jaeger commented 9 months ago

Hi thanks a lot for your contributions!