-vvv option).$ rm -rf .venv && mkdir .venv$ poetry install ⚠️ At a minimum, we need an assertion to prevent this, but it would be nice if Poetry could turn an empty directory into a virtual environment.
And perhaps "empty" should mean that "bin/python" is absent.
Does it mean it has to be if env.is_venv() and env.is_sane() in https://github.com/sdispater/poetry/blob/master/poetry/utils/env.py#L209
To add a realistic situation where this can happen: We do our development in Docker containers and mount a volume in the container at /app/.venv – meaning an empty .venv directory just as described will exist and break poetry.
For now, we just mount the volume at $HOME/.cache/pypoetry/virtualenvs and let poetry handle virtualenvs there to avoid this issue, but we'd prefer to keep using settings.virtualenvs.in-project.
This is still an issue in 1.0.0b5
Another use case is creating it with a placeholder file in code repository, that way poetry automatically uses it without having to explicitly set poetry settings.
I'm also running into this issue with poetry 1.0.0 (stable). in my case, .venv is a docker volume so it has already been mounted and therefore the folder is empty. This means that poetry installs its dependencies globally instead of in the volume. This is annoying because whenever the docker container gets destroyed, i have to reinstall all the dependencies since I cant install them in the volume.
Most helpful comment
This is still an issue in 1.0.0b5
Another use case is creating it with a placeholder file in code repository, that way poetry automatically uses it without having to explicitly set poetry settings.