Skip to content

python: if a project with dependencies is opened without a venv, create and activate one #6965

@austin3dickey

Description

@austin3dickey

The idea comes from #6229 (comment) but could maybe be expanded a little more generally.

Users using uv projects with git will probably end up checking in these projects with files that declare dependencies (pyproject.toml in general, and perhaps uv.lock with specific versions). Upon opening these projects, if uv is installed, Positron could easily and quickly create a uv venv that adheres to these dependencies, and activate it.

This relates to #1529 and #5233. Perhaps we could expand this behavior to requirements.txt files in the workspace, and partially achieve that goal of "templates".

Another way to generalize this would be to make sure it also works with poetry-style projects, etc.

Note that the vscode-python-environments extension investigated in #6497 has code for finding projects with pyproject.toml, etc. and creating projects (with associated environments?) with them. Though today it seems a little buggy when I tried it.

Metadata

Metadata

Assignees

Labels

area: environmentIssues related to the Packages pane and surfacing runtime environment infolang: python
No fields configured for Enhancement.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions