mirror of
https://github.com/astral-sh/uv.git
synced 2025-07-07 21:35:00 +00:00
uv-resolver: only serialize sdist for registry sourced distributions
This fixes an issue in the lock file where, in cases where we had a non-registry sdist, the information in the sdist was strictly redundant with the information in the source. This was born out in the code already where the `sdist` field was only ever used to build a source distribution type when the source was a registry. In all other cases, the source distribution data can be materialized from the `source` field.
This commit is contained in:
parent
4899612619
commit
86c2a9b0b2
1 changed files with 6 additions and 1 deletions
|
@ -421,7 +421,12 @@ impl Lock {
|
||||||
table.insert("source", value(dist.id.source.to_string()));
|
table.insert("source", value(dist.id.source.to_string()));
|
||||||
|
|
||||||
if let Some(ref sdist) = dist.sdist {
|
if let Some(ref sdist) = dist.sdist {
|
||||||
table.insert("sdist", value(sdist.to_toml()?));
|
// An actual sdist entry in the lock file is only required when
|
||||||
|
// it's from a registry. Otherwise, it's strictly redundant
|
||||||
|
// with the information in all other kinds of `source`.
|
||||||
|
if matches!(dist.id.source, Source::Registry(_)) {
|
||||||
|
table.insert("sdist", value(sdist.to_toml()?));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if !dist.dependencies.is_empty() {
|
if !dist.dependencies.is_empty() {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue