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:
https://github.com/sdispater/poetry/blob/87c4aaf9cadbbb6c5657101d715b5a4e1a8d9a05/poetry/utils/venv.py#L55-L59
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_ENV set)
- Use the exiting local virtual environment (
./.venv/<bin>/python exists)
- [NEW] Create a new local virtual environment (
./.venv/ is empty)
- Use the previously cached virtual environment
- Create a new cached virtual environment
I'm considering migrating some of my projects from
pipenvtopoetry. I would like to be able to tellpoetryto create virtual environments at./.venv/to supportMakefiletarget dependencies, CI build caching, and automatic IDE support.I added a feature to
pipenvto detect and use virtual environments located at./.venv/based on the mere presence of a directory of that name. It looks likepoetrynearly has the same behavior:https://github.com/sdispater/poetry/blob/87c4aaf9cadbbb6c5657101d715b5a4e1a8d9a05/poetry/utils/venv.py#L55-L59
but I noticed that if
.venvis an empty directory (in order to let the tool populate it)poetryseems 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
poetryto handle all of the following scenarios:$VIRTUAL_ENVset)./.venv/<bin>/pythonexists)./.venv/is empty)