Skip to content

Conversation

@BrandonLWhite
Copy link
Contributor

@BrandonLWhite BrandonLWhite commented Jun 13, 2024

Resolves: #76

This PR alters the VenvBundle virtual environment creation to leverage Poetry's ability to select the "best" Python version to use based upon the pyproject's python dependency specification.

  • A subclass of EnvManager is used to override the "in_project_venv" methods as a way to leverage the Poetry behavior we need to (re)create a venv at an arbitrary location.
  • All checking of existing venv is now done in Poetry, and so code related to that is removed from VenvBundle
  • InvalidCurrentPythonVersionError exception handling is used to deal with existing venv that is incompatible. Poetry raises an exception in this case, so the solution I implemented to support this use case is to call create_venv again with force=True

@BrandonLWhite BrandonLWhite marked this pull request as ready for review June 14, 2024 14:07
Copy link
Member

@radoering radoering left a comment

Choose a reason for hiding this comment

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

LGTM. 👍

Just updated the readme + some minor coding style changes.

@radoering radoering merged commit 1796ad2 into python-poetry:main Jul 23, 2024
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.

Poetry bundle uses wrong Python while preparing venv bundle

2 participants