Skip to content

Handle missing virtualenv in shell command#60

Open
bubaizhanshen wants to merge 1 commit into
python-poetry:mainfrom
bubaizhanshen:fix-non-venv-shell-error
Open

Handle missing virtualenv in shell command#60
bubaizhanshen wants to merge 1 commit into
python-poetry:mainfrom
bubaizhanshen:fix-non-venv-shell-error

Conversation

@bubaizhanshen
Copy link
Copy Markdown

Summary

  • replace the internal assertion when poetry shell is run without a virtualenv with a user-facing error
  • avoid printing the misleading Spawning shell within ... line before the environment type is validated
  • add regression coverage for non-virtualenv environments

Fixes #30.

Tests

  • .venv/bin/python -m pytest -q
  • .venv/bin/python -m ruff check src/poetry_plugin_shell/command.py tests/test_shell_command.py
  • .venv/bin/python -m mypy src/poetry_plugin_shell/command.py tests/test_shell_command.py

Note: full mypy currently reports an existing tests/conftest.py override mismatch against Poetry 2.4.1, outside this change.

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.

AssertionError when spawning shell with "virtualenvs.create" set to false

1 participant