-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Add first-class support for virtual projects #6511
Description
A lot of users don't want to structure their projects as valid Python packages -- perhaps they're creating a web application, or a collection of scripts, etc. These all can be structured as valid Python packages, but users tend not to do this. Requiring that projects are valid Python packages makes it harder for existing users to adopt uv.
Today, we allow "virtual projects" (i.e., without a build system) for workspace roots, but only for workspace roots.
This has several issues...
- It has to be a workspace, you need
[tool.uv.workspace]which is confusing for users. - It only supports dev dependencies, also confusing for users.
- There's no way to define project metadata which is confusing for users since they expect a
[project]table. For example, there's no way to define a required python version in a "virtual project" (i.e., a virtual workspace root with no members). - There's (easy) no way to transition between the two. To convert a non-virtual
pyproject.tomlto virtual, you have to remove basically everything, move things around, etc.
What I want to do is, allow users to set:
[tool.uv]
virtual = trueIf set, they can have a [project] table, they don't need a workspace definition, etc. And in this case, we don't build or install the project, just like a virtual workspace root today.
In the future, we'd like to write our own build system that handles these cases better by default. But for now, this will help a lot of users.