-
Notifications
You must be signed in to change notification settings - Fork 8
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
every new shell results in mise-poetry: Virtualenv does not exist at . Execute
poetry install to create one.
#21
Comments
So to me, there are two separate things here:
|
I did wonder if I would live to regret that PR.... While we work out in what way this is wrong you can comment out line 17 in ~/.local/share/mise/plugins/poetry/bin/exec-env to stop it being annoying. Do you have something like this? I'm begining to wonder if the poetry behaviour I saw was a different issue. |
:) We all have those PRs. I don't have the And thanks for the comment out tip. In case someone else also wants this, and with convenience, this is a quickfix:
|
Which is fair enough. OK so my issue is that (in a test repo before th venv has been created):
It just returns nothing with a exit code of 1. In the code i patched it would just nothing because it checked if the string was empty, which happens for the reasons you have. This broke auto install. Once How about replace:
with
It avoids conflating checking the venv location with whether it shoudl be managing the venv at all. That checks for the presence of pyproject= in the toml (which I have and you don't). |
Nope, scatch that, it ignores another failure mode... (whatever file pyproject points at being missing). |
Hmm, unclear if I fully understand. But, perhaps that doesn't matter :) So, what I wonder is: For your and my needs at least, if I.e.: diff --git a/bin/exec-env b/bin/exec-env
index 89dca31..b66839e 100755
--- a/bin/exec-env
+++ b/bin/exec-env
@@ -14,7 +14,6 @@ setup_virtualenv() {
VIRTUAL_ENV="$(poetry_venv)"
if [[ -z "$VIRTUAL_ENV" ]] || [[ ! -d "$VIRTUAL_ENV" ]]; then
if [[ "${MISE_POETRY_AUTO_INSTALL:-}" != "true" ]] && [[ "${MISE_POETRY_AUTO_INSTALL:-}" != "1" ]]; then
- echoerr "mise-poetry: Virtualenv does not exist at $VIRTUAL_ENV. Execute \`poetry install\` to create one."
return
fi
echoerr "mise-poetry: No virtualenv exists. Executing \`poetry install\` to create one." |
@simonpercivall I've got a pr ready, could you have a go with it and see if it solves your issue? I've handled the various cases a bit better. I'm a bit reluctant to remove the message just because you shouldn't be hitting it anyway so its not really the bug. |
After #20, I now get warnings every first time I enter a mise-managed directory with
poetry
or a_.python.venv
directive.I have a venv at
.venv
next to thepyproject.toml
, and that's howpoetry
is configured.mise
also manages the Python install.The
poetry
install is defined in a.mise.toml
one level up from thepyproject.toml
, and the_.python.venv
directive is defined in next to thepyproject.toml
.The text was updated successfully, but these errors were encountered: