perf: Making UV default installer in pixi-build-python#5669
perf: Making UV default installer in pixi-build-python#5669suleman1412 wants to merge 3 commits intoprefix-dev:mainfrom
pixi-build-python#5669Conversation
| ) -> Installer { | ||
| // Check all dependency names for "uv" package | ||
| let has_uv = package_names.any(|name| name == UV); | ||
| let has_pip = package_names.any(|name| name == PIP); |
There was a problem hiding this comment.
This does not make sense to me. We would implicitly fall back to pip if it would be there.
I think we should have an explicit config for this which defaults to uv
There was a problem hiding this comment.
This would require changes in PythonBackendConfig struct, yes?
https://github.com/prefix-dev/pixi/blob/main/crates/pixi_build_python/src/config.rs#L8
There was a problem hiding this comment.
So if my understanding is right, pip is ONLY used if the user has explicitly defined it, otherwise its always Uv
Explicitly defining it in the toml :
[package.build.config]
installer = "pip"
There was a problem hiding this comment.
@Hofer-Julian Hi! Just want to validate my understanding, is this the way the team is looking to implement this?
There was a problem hiding this comment.
Pull request overview
Updates pixi-build-python to use uv as the default Python installer (while still allowing pip when explicitly present), aligning with the discussion in the linked issue.
Changes:
- Switch default installer selection from
piptouvin installer-detection logic. - Update recipe expectations (insta snapshots) and an assertion to reflect
uvbeing auto-added to host requirements by default.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| crates/pixi_build_python/src/build_script.rs | Makes uv the default installer and changes installer detection to prefer pip only when explicitly included. |
| crates/pixi_build_python/src/main.rs | Updates test assertion/comments to expect uv in host requirements when auto-added. |
| crates/pixi_build_python/src/snapshots/pixi_build_python__tests__python_is_not_added_if_already_present.snap | Snapshot updated to expect uv instead of pip in host requirements. |
| crates/pixi_build_python/src/snapshots/pixi_build_python__tests__pip_is_in_host_requirements.snap | Snapshot updated to expect uv as the auto-added installer. |
| crates/pixi_build_python/src/snapshots/pixi_build_python__metadata__tests__generated_recipe_contains_pyproject_values.snap | Snapshot updated to expect uv instead of pip in host requirements. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| /// Determine the installer from an iterator of dependency package names. | ||
| /// Checks if "uv" is present in the package names. | ||
| pub fn determine_installer_from_names<'a>( | ||
| mut package_names: impl Iterator<Item = &'a str>, | ||
| ) -> Installer { | ||
| // Check all dependency names for "uv" package | ||
| let has_uv = package_names.any(|name| name == UV); | ||
| let has_pip = package_names.any(|name| name == PIP); |
| requirements: | ||
| build: [] | ||
| host: | ||
| - pip | ||
| - uv | ||
| - python |
pixi-build-pythonpixi-build-python
pixi-build-pythonpixi-build-python
Description
Makes uv the default installer as discussed here: https://discord.com/channels/1082332781146800168/1481753574836015174/1481953664343212073
Fixes #5666
How Has This Been Tested?
cargo test
cargo insta review
Checklist:
schema/model.py.