My question: How does the Python tool Poetry know the path of the virtual environment of a project?
Explanation: When I run poetry init inside a directory, a new project is created. Then I run poetry install and a new virtual environment is created. HOWEVER, neither the path nor the hash of that virtual environment are stored in pyproject.toml or poetry.lock as I expected. How does Poetry then know the location of the virtual environment when I run poetry env info -p?
Besides wanting to know what is going on, I need to know this for 2 reasons:
- How can I move a directory with a Poetry project without breaking the link to its virtual environment?
- How to know which of Poetry's virtual environments are unused and can thus be deleted?
Possible solution: Looking into the source code of Poetry, it seemed to me that a file envs.toml may include a mapping from filesystem directories to virtual environment hashes, but on my Mac OS 11.1 I can't find such a file.