You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have searched the issues of this repo and believe that this is not a duplicate.
If an exception occurs when executing a command, I executed it again in debug mode (-vvv option).
OS version and name: Windows 10 x64
Poetry version: Reproduced in 1.1.14 and 1.2.0b3
Issue
Windows drive mappings are not resolved when hashing the current working directory to generate a virtual environment name.
This means that a virtual environment that was created when working under a mapped drive is not re-used when working under the real un-mapped directory.
I'll explain the problem this has caused me. I work under a mapped drive and installed git pre-commit hooks that run commands such as pylint from the development environment using poetry run. When the hooks were automatically run by git, the current working directory was always the "real" directory. Poetry would automatically create and use a new empty environment that did not contain the necessary executables, leading to very confusing errors.
It can be fixed with a single call to os.path.realpath() in EnvManager.generate_env_name(). I will create a pull request.
I've checked in Linux, and could not reproduce the same problem using symbolic links.
Example:
cd c:\parent\my_project
poetry install
poetry env list # Poetry-managed virtual environment listed
subst z: c:\parent
cd z:\my_project
poetry env list # No environments listed. "poetry run" commands will fail.
The text was updated successfully, but these errors were encountered:
-vvv
option).Issue
Windows drive mappings are not resolved when hashing the current working directory to generate a virtual environment name.
This means that a virtual environment that was created when working under a mapped drive is not re-used when working under the real un-mapped directory.
I'll explain the problem this has caused me. I work under a mapped drive and installed git pre-commit hooks that run commands such as
pylint
from the development environment usingpoetry run
. When the hooks were automatically run by git, the current working directory was always the "real" directory. Poetry would automatically create and use a new empty environment that did not contain the necessary executables, leading to very confusing errors.It can be fixed with a single call to
os.path.realpath()
inEnvManager.generate_env_name()
. I will create a pull request.I've checked in Linux, and could not reproduce the same problem using symbolic links.
Example:
The text was updated successfully, but these errors were encountered: