Skip to content
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

Lock all packages in workspace #4016

Merged
merged 9 commits into from
Jun 6, 2024

Conversation

konstin
Copy link
Member

@konstin konstin commented Jun 4, 2024

When creating a lockfile, lock the combined dependencies for all packages in a workspace. This make the lockfile independent of where you are in the workspace.

Fixes #3983

@konstin konstin added the preview Experimental behavior label Jun 4, 2024
(
project_path.clone(),
ToolUvWorkspace::default(),
PyProjectToml::default(),
Copy link
Member

Choose a reason for hiding this comment

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

What's the motivation for this change? Why doesn't it return pyproject_toml?

Copy link
Member Author

Choose a reason for hiding this comment

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

An oversight, fixed now

Copy link
Member

Choose a reason for hiding this comment

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

But what does it mean? What case is this?

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh you meant the branch not the line, this is for supporting implicit workspace roots, i've added a comment now.

@charliermarsh
Copy link
Member

I think we need to find some solution to Requires-Python now. What is the Requires-Python of the workspace?

@konstin konstin force-pushed the konsti/lock-all-packages-in-workspace branch from 386d348 to 18d4528 Compare June 5, 2024 08:34
@konstin
Copy link
Member Author

konstin commented Jun 5, 2024

I can either be the intersection or the union of the python requirement of the constituent packages. We could also force them to identical but that seems to strict.

Let's say A has python >= 3.9 and B python >=3.10.
Union: We require the workspace to be compatible with >= 3.9. This means we can install A alone on 3.9, but requires all dependencies of B to be compatible with 3.9 too (unless you go for marker tricks)
Intersection: We require the workspace to be compatible with >=3.10. This means you can't test with A on 3.9, but B only gets resolved on >=3.10 only.

From that, the union seems slightly better.

@konstin
Copy link
Member Author

konstin commented Jun 5, 2024

Created #4041 that solves this properly

When creating a lockfile, lock the combined dependencies for all packages in a workspace. This make the lockfile independent of where you are in the workspace.

Fixes #3983
@konstin konstin force-pushed the konsti/lock-all-packages-in-workspace branch from 4794cd6 to bbfa5f4 Compare June 6, 2024 09:27
@charliermarsh
Copy link
Member

I will review and merge today when I'm out of meetings.

@charliermarsh charliermarsh enabled auto-merge (squash) June 6, 2024 19:03
@charliermarsh charliermarsh merged commit a6f53e2 into main Jun 6, 2024
46 checks passed
@charliermarsh charliermarsh deleted the konsti/lock-all-packages-in-workspace branch June 6, 2024 19:09
charliermarsh pushed a commit that referenced this pull request Jun 6, 2024
Follow-up to #4016.

This exposes `Range` and `PubGrubSpecifier` from outside the resolver to
use pubgrub's union creating a dependency edge we don't really want.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
preview Experimental behavior
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Locking in a workspace should lock the entire workspace
2 participants