mamba-org / rattler

Rust crates to work with the Conda ecosystem.
BSD 3-Clause "New" or "Revised" License
226 stars 42 forks source link

fix: lock file stability issues with PyPI types #761

Closed Hofer-Julian closed 5 days ago

Hofer-Julian commented 6 days ago

Fixes https://github.com/prefix-dev/pixi/issues/1535

Hofer-Julian commented 5 days ago

While browsing the code, I found this function. If I understand it correctly, conda packages should always come before PyPI ones. Looking at the produced lockfile this doesn't seem to be the case. Maybe more is amiss here.

https://github.com/mamba-org/rattler/blob/76867ed9b45fee40687164f92d5edb29aad41119/crates/rattler_lock/src/parse/serialize.rs#L103-L136

baszalmstra commented 5 days ago

While browsing the code, I found this function. If I understand it correctly, conda packages should always come before PyPI ones. Looking at the produced lockfile this doesn't seem to be the case. Maybe more is amiss here.

https://github.com/mamba-org/rattler/blob/76867ed9b45fee40687164f92d5edb29aad41119/crates/rattler_lock/src/parse/serialize.rs#L103-L136

That part is to sort the references to the packages found in the environments section. Not the package metadata at the end of the file.

Hofer-Julian commented 5 days ago

While browsing the code, I found this function. If I understand it correctly, conda packages should always come before PyPI ones. Looking at the produced lockfile this doesn't seem to be the case. Maybe more is amiss here. https://github.com/mamba-org/rattler/blob/76867ed9b45fee40687164f92d5edb29aad41119/crates/rattler_lock/src/parse/serialize.rs#L103-L136

That part is to sort the references to the packages found in the environments section. Not the package metadata at the end of the file.

I see, thanks for the clarification @baszalmstra!

baszalmstra commented 5 days ago

Nice @Hofer-Julian !

wolfv commented 5 days ago

Nice fix!