vscode-python: Change venvFolders to no longer be anchored to the user's home directory
We discovered during our bug bash that venvFolders exists but isn’t documented. Either we leave it, document it, and potentially not make (at least) our pyenv support depend on .pyenv being in it, or we remove the setting and use the documented functionality of pyenv directly.
About this issue
- Original URL
- State: open
- Created 6 years ago
- Reactions: 20
- Comments: 19 (10 by maintainers)
I ran across this issue because I have the following use case:
Making venvFolders not relative to the user’s home dir would allow me to specify each subproject once and easily switch between the corresponding environments as I switch between projects. The current workaround is to update venvPath or pythonPath each time I switch.
What’s the current status of this?
venvFoldersandvenvPathstill exist, and are inconsistently documented:venvPathvenvFolders(but not the fact that it’s relative to your homedir)I thought the original plan, to make
venvPathsan array of entries likevenvPathworks today, and to get rid ofvenvFolders, made sense. It’s the least surprising (can be relative to${workspaceFolder}or not), and supporting multiple entries makes it work with many tools, other filesystems mounted outside one’s home directory or project root, etc. It could be overridden in.code-workspaceorsettings.jsonfiles for projects to provide good defaults in source.Did this ticket just get forgotten about? It would very much improve my company’s use cases to see this happen.
venvFoldersvenvPathswhich is an array of directories which contain virtual environmentsvenvFoldersandvenvPathHonestly, yes. We have been very focused in the interim time this issue was opened by completely rewriting the environment discovery code, iterating on the quick pick menu, and then getting an extension API for other extensions to use. Now that’s all finished, we can look to try and pick this up in 2023.
Any rule of thumb of how I should be using one or the other and both?
Since we now know how to patch a user’s setting we can actually drop venvPath and then change a user’s preexisting settings to append
~/to entries (or something along those lines).