Skip to content
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

Use return codes from poetry_venv to disabiguate causes of returns. #22

Merged
merged 4 commits into from
Nov 21, 2024

Conversation

chris-lingwood-korelabs-co
Copy link

@chris-lingwood-korelabs-co chris-lingwood-korelabs-co commented Nov 20, 2024

The issue is that setup_virtualenv in exec-env can't tell why poetry_venv has exited. There are three reasons to return:

  1. if pyproject is not set, venv installation should not happen
  2. else if the file doesn't exist venv installation should not happen
  3. else if poetry can't show a venv path (it doesn't exist) venv installation should happen if MISE_POETRY_AUTO_INSTALL is set
  • I've set cases 1 and 2 to return 1 for detection and graceful exit.
  • Case 3 attempts to install if MISE_POETRY_AUTO_INSTALL is set.

The handling of cases 1 and 2 are fixed here to fix #21

Copy link

@simonpercivall simonpercivall left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

I'm not getting an error message without setting the pyproject.toml path in mise.toml, and I do get it when it is set.

@chris-lingwood-korelabs-co chris-lingwood-korelabs-co marked this pull request as ready for review November 20, 2024 14:04
@jdx jdx merged commit daaaab6 into mise-plugins:main Nov 21, 2024
2 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

every new shell results in mise-poetry: Virtualenv does not exist at . Execute poetry install to create one.
3 participants