Skip to content

Support uv lock on a pyproject.toml that only contains dependency-groups#19087

Merged
Gankra merged 4 commits intomainfrom
gankra/testvirt
Apr 21, 2026
Merged

Support uv lock on a pyproject.toml that only contains dependency-groups#19087
Gankra merged 4 commits intomainfrom
gankra/testvirt

Conversation

@Gankra
Copy link
Copy Markdown
Contributor

@Gankra Gankra commented Apr 20, 2026

Summary

These special kinds of pyproject.tomls are blessed by the standards gods. Initially we only supported it in uv pip install but at some point uv sync started supporting it. However uv lock would still hard error which is definitely "everything is wrong".

Test Plan

Included is 3 tests:

  • showing sync always worked
  • showing lock was broken and now works
  • showing that conflicts currently doesn't work (because internally we always expect a Conflict to include a PackageName)

@Gankra Gankra added the bug Something isn't working label Apr 20, 2026
@Gankra
Copy link
Copy Markdown
Contributor Author

Gankra commented Apr 20, 2026

Should probably do a pass over all the uses of Workspace::discover for if they're still the right choice. Like, uv audit maybe also wants to be changed to work here?

@konstin konstin requested a review from charliermarsh April 21, 2026 13:37
@charliermarsh charliermarsh self-assigned this Apr 21, 2026
Comment on lines -133 to +135
Workspace::discover(project_dir, &DiscoveryOptions::default(), workspace_cache).await?;
LockTarget::Workspace(&workspace)
VirtualProject::discover(project_dir, &DiscoveryOptions::default(), workspace_cache)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems like we should restructure and rename these types at some point? A virtual project is now a valid workspace.

@Gankra Gankra merged commit 732ecd8 into main Apr 21, 2026
55 checks passed
@Gankra Gankra deleted the gankra/testvirt branch April 21, 2026 17:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants