fix: rebase workspace-export-from-lockfile onto rattler_lock 0.29#6028
Merged
baszalmstra merged 1 commit intoprefix-dev:mainfrom May 6, 2026
Merged
Conversation
…k 0.29 prefix-dev#5989 added the new `pixi workspace export --from-lockfile` path against an older rattler_lock API. While that PR was open, rattler_lock split `LockedPackageRef` into a single `LockedPackage` enum, turned `PypiPackageData` into a `Distribution`/`Source` enum with method accessors (`name()`, `location()`, `version()`), removed the `editable` field, dropped `package_record` from `CondaSourceData`, and changed `Environment::packages` to take `rattler_lock::Platform<''_>` instead of `rattler_conda_types::Platform`. The PR was merged without rebasing onto those changes, so `cargo check` failed on `main` with seven errors in `crates/pixi_cli/src/workspace/export/conda_environment.rs`. This rebases the new code onto the current API: - swap `LockedPackageRef`/`LockedPackageRef::Pypi(p, _)` for `LockedPackage`/`LockedPackage::Pypi(p)` - read pypi fields through the new methods (`pypi.name()`, `pypi.location().inner()`, `pypi.version()`) - look the package up in the manifest pypi-deps for this environment + platform to decide editability instead of inferring it from the lockfile shape (transitive source pypi deps must not get rendered with `-e`) - resolve `rattler_conda_types::Platform` to `rattler_lock::Platform<''_>` via `lockfile_env.platforms().find(|p| p.subdir() == *platform)` before calling `Environment::packages` - replace `source.package_record.name.as_source()` with `source.name().as_source()` for conda source packages
f595496 to
96a74b8
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
#5989 added
pixi workspace export --from-lockfileagainst an olderrattler_lockAPI. While that PR was open,rattler_lockshipped a refactor that:LockedPackageRefwith a singleLockedPackageenum (and dropped the second_env_datatuple slot on thePypivariant);PypiPackageDatainto aDistribution/Sourceenum with method accessors (name(),location().inner(),version()), and removed the standaloneeditablefield;package_recordfromCondaSourceData(usesource.name()instead);Environment::packagesto takerattler_lock::Platform<'lock>instead ofrattler_conda_types::Platform.#5989 was merged without rebasing onto those changes, so
mainnow failscargo checkwith seven errors incrates/pixi_cli/src/workspace/export/conda_environment.rs. This PR rebases that one new file onto the current API. Net diff is +29/-11 in a single file.A few notes on the editable handling, since the lockfile no longer exposes it directly: editability is a manifest concept (the workspace's
pixi.tomlsayseditable = true), not a property the resolver writes back. So the new code builds the editable set fromenvironment.pypi_dependencies(Some(*platform))filtered byspec.editable() == Some(true)and looks each locked pypi package up by name. Transitive pypi source deps that happen to bePypiPackageData::Sourceare no longer incorrectly rendered with-e.How Has This Been Tested?
Locally on Windows against the current
main@upstream:cargo check --workspace --all-targets— cleancargo check --workspace --all-targets --features slow_integration_tests,online_tests— cleancargo clippy --workspace --all-targets— cleancargo fmt --check— cleanAI Disclosure
Tools: Claude
Checklist: