-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a non-package-mode #10204
Comments
isn't it possible with dependency groups? # pyproject.toml
[dependency-groups]
dev = [
"mkdocs>=1.6.1",
] You can use this in combination of |
@T-256 Using your
|
If you add |
Thanks @charliermarsh! Is Reading the workspace docs, it seems like more of a multi-project feature rather than a "single project but I don't need the wheel project metadata" feature? I ask because I was trying to think through how I would explain this to someone else using single Django or FastAPI application and wanting to avoid the boilerplate of extra Also, when I run this way, even with a
And it seems that |
When I also have some environment usages where only need declared dependencies. Rye's virtual project:
|
@T-256 Oh nice. I haven't used Rye before, but that looks like it's filling the exact use case I'm referring that and the same use case as Poetry's |
Yeah we might improve it over time, but right now it is recommended that you create a [project]
requires-python = ">=3.12"
dependencies = [
"mkdocs>=1.6.1",
] The standard declares that you must have at least a package name and a version (or a dynamic version) -- this isn't a uv thing, it's a standards thing. |
You can run with
|
I was curious how Rye handled this. When passing [project]
dependencies = [
"mkdocs<1.5",
]
requires-python = ">= 3.8"
[tool.rye]
managed = true
virtual = true
dev-dependencies = []
Poetry gets around the issue (currently) because it hasn't released a version that supports [tool.poetry]
package-mode = false
[tool.poetry.dependencies]
python = "^3.11"
mkdocs = "*" I haven't tested Poetry 2.0 which supports In any case, I definitely appreciate the challenge of making this work smoothly given the current standards. |
I feel like the pyproject.toml spec is more restrictive than it should be (given it states I wonder if upstream would be open to revising the spec to state that Adjusting the spec in that way would actually be in keeping with other parts of the spec, which already state things like:
(from here) |
@edmorley I agree with you, to make a workaround for this standard limitation, I think we can use a clone of |
For reference, Poetry 2.0.1 also took the same stance as |
Proposal
For projects that will not be published as wheels but simply want to track/lock their dependencies with
uv
, it would be nice to be able to omit the following lines frompyproject.toml
:Poetry has this feature:
Configuration Example
A straw-man proposal for how this could be configured in uv:
Motivation
A long thread about motivation for this is in the original Poetry issue
There are many types of Projects where specifying an extra version, name, description, etc is unnecessary and extra boilerplate. For example:
uvicorn main:app
orpython runserver
where no package/wheel is installedAn example referencing the boilerplate in the wild:
It would also be impossible to publish a non-package-mode project, which helps with the motivation for
Otherwise, someone also needs to add the
Private :: Do Not Upload
classifier to be extra safe.Challenges
The complication I see with
uv
as compared to Poetry is that perhaps it's not technically legal to omit certain fields from the[project]
field? But if a project isn't actually defining a true package/wheel perhaps that doesn't matter?Currently if you run
uv sync
without these[project]
fields, you get an error:The text was updated successfully, but these errors were encountered: