Repository navigation
Remove extra duplication from lockfile #4888
Copy link
Copy link
Closed
Labels
previewExperimental behaviorExperimental behavior
Description
Activity
Is this limited to the specific example shown here, or in general? In general, each of those dependency entries can have other fields on them that are different. For example, markers. In theory, I think, other fields could be different too, such as version and source. Or at least, that's what our data model supports. But I think the markers really could be different?
This should only collapse entries with the same markers. Say we have
dependencies = [ "pandas[excel,html]; python_version == '3.13'", "pandas[excel,plot]", ]
we currently get
dependencies = [ { name = "pandas" }, { name = "pandas", extra = "excel" }, { name = "pandas", extra = "html", marker = "python_version == '3.13'" }, { name = "pandas", extra = "plot" }, ]
which we could collapse to
dependencies = [ { name = "pandas", extras = ["excel", "plot"] }, { name = "pandas", extras = ["html"], marker = "python_version == '3.13'" }, ]
Reacted by T-256Right, okay. I think this LGTM. Although I don't totally mind our existing format, I am very sympathetic to the fact that it leaks our "virtual package" abstraction. So I think I would on balance favor your suggestion here to the status quo.
- added a commit that references this issue
on Jul 18, 2024 - added a commit that references this issue
on Jul 18, 2024
Metadata
Metadata
Assignees
Labels
previewExperimental behaviorExperimental behavior
Type
Projects
- StatusShow more project fieldsDone
When declaring a dependency
pandas[excel,html,plot], the lockfile shows:We should collapse those entries:
This makes more sense to the user (we don't install pandas four times, we install it once and then those extra packages, that's our internal abstraction into virtual packages leaking) and makes the lockfile more concise.