# python: Add recognition of worktree \-\> venv links \(\#26759\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/ac5a2b2122f5e092923e1529c6634917d0dce771)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: ac5a2b2122f5e092923e1529c6634917d0dce771

Requested commit: ac5a2b2122f5e092923e1529c6634917d0dce771

Commit: ac5a2b2122f5e092923e1529c6634917d0dce771

Tree: 4851ea8256859ea089ada01de93f2a024a7ace4c

Author: Elvis Pranskevichus

Committer: GitHub

## Message

```
python: Add recognition of worktree -> venv links (#26759)

Python envs created with virtualenvwrapper have the ability to link to
the project directory (via the `.project` file in the virtualenv).
`python-environment-tools` supports this and reports the project path.

Additionally, some tools (e.g virtualfish) recognize special
"environment activation" files in project directories (`.venv` by
default)
[1].

Use the above information to sort reported Python toolchains so that the
correct env for a given worktree is at the top.

[1]
https://virtualfish.readthedocs.io/en/latest/plugins.html#auto-activation-auto-activation

Release Notes:

- python: Improved detection of virtualenvwrapper environments in work
trees
```

## Parents

- [ada8b0f8222d1d151679148fc708838cb2bf7115](https://git.cafe/gitcafe/zed/commit/ada8b0f8222d1d151679148fc708838cb2bf7115?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/ac5a2b2122f5e092923e1529c6634917d0dce771?format=markdown)
