-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Description
I'm considering migrating some of my projects from pipenv to poetry. I would like to be able to tell poetry to create virtual environments at ./.venv/ to support Makefile target dependencies, CI build caching, and automatic IDE support.
I added a feature to pipenv to detect and use virtual environments located at ./.venv/ based on the mere presence of a directory of that name. It looks like poetry nearly has the same behavior:
but I noticed that if .venv is an empty directory (in order to let the tool populate it) poetry seems to install dependencies into my global Python instead.
Would you consider a PR to add another case to this logic to create virtual environments in the root of a project? This should allow poetry to handle all of the following scenarios:
- Use the currently activated virtual environment (
$VIRTUAL_ENVset) - Use the exiting local virtual environment (
./.venv/<bin>/pythonexists) - [NEW] Create a new local virtual environment (
./.venv/is empty) - Use the previously cached virtual environment
- Create a new cached virtual environment