Skip to content

perf: Making UV default installer in pixi-build-python#5669

Closed
suleman1412 wants to merge 3 commits intoprefix-dev:mainfrom
suleman1412:uv-default
Closed

perf: Making UV default installer in pixi-build-python#5669
suleman1412 wants to merge 3 commits intoprefix-dev:mainfrom
suleman1412:uv-default

Conversation

@suleman1412
Copy link
Contributor

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:

  • [ x ] I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added sufficient tests to cover my changes.
  • I have verified that changes that would impact the JSON schema have been made in schema/model.py.

) -> 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);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Contributor Author

@suleman1412 suleman1412 Mar 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would require changes in PythonBackendConfig struct, yes?
https://github.com/prefix-dev/pixi/blob/main/crates/pixi_build_python/src/config.rs#L8

Copy link
Contributor Author

@suleman1412 suleman1412 Mar 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Hofer-Julian Hi! Just want to validate my understanding, is this the way the team is looking to implement this?

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 pip to uv in installer-detection logic.
  • Update recipe expectations (insta snapshots) and an assertion to reflect uv being 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.

Comment on lines 32 to +38
/// 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);
Comment on lines 13 to 17
requirements:
build: []
host:
- pip
- uv
- python
@suleman1412 suleman1412 changed the title Making UV default installer in pixi-build-python perf/Making UV default installer in pixi-build-python Mar 13, 2026
@suleman1412 suleman1412 changed the title perf/Making UV default installer in pixi-build-python perf: Making UV default installer in pixi-build-python Mar 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make uv the default for pixi-build-python

3 participants