Skip to content

Commit

Permalink
Add .venv when it exists
Browse files Browse the repository at this point in the history
  • Loading branch information
frostming committed Dec 31, 2019
1 parent 8397ed2 commit 5e6e0e6
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions poetry/utils/env.py
Expand Up @@ -372,12 +372,13 @@ def list(self, name=None): # type: (Optional[str]) -> List[VirtualEnv]
for p in sorted(venv_path.glob("{}-py*".format(venv_name)))
]

current_env = self.get()
venv = self._poetry.file.parent / ".venv"
if (
self._poetry.config.get("virtualenvs.in-project")
and current_env not in env_list
and venv.exists()
and venv.is_dir()
):
env_list.insert(0, current_env)
env_list.insert(0, VirtualEnv(venv))
return env_list

def remove(self, python): # type: (str) -> Env
Expand Down

0 comments on commit 5e6e0e6

Please sign in to comment.