diff --git a/crates/uv/src/commands/venv.rs b/crates/uv/src/commands/venv.rs index 31b826f79..72cbfc800 100644 --- a/crates/uv/src/commands/venv.rs +++ b/crates/uv/src/commands/venv.rs @@ -6,6 +6,7 @@ use std::vec; use anstream::eprint; use anyhow::Result; use chrono::{DateTime, Utc}; +use itertools::Itertools; use miette::{Diagnostic, IntoDiagnostic}; use owo_colors::OwoColorize; use thiserror::Error; @@ -184,7 +185,10 @@ async fn venv_impl( .await .map_err(VenvError::Seed)?; - for distribution in resolution.distributions() { + for distribution in resolution + .distributions() + .sorted_unstable_by(|a, b| a.name().cmp(b.name()).then(a.version().cmp(&b.version()))) + { writeln!( printer, " {} {}{}", diff --git a/crates/uv/tests/venv.rs b/crates/uv/tests/venv.rs index 1567d44d6..f2d9585f9 100644 --- a/crates/uv/tests/venv.rs +++ b/crates/uv/tests/venv.rs @@ -232,8 +232,8 @@ fn seed_older_python_version() -> Result<()> { ----- stderr ----- Using Python [VERSION] interpreter at [PATH] Creating virtualenv at: /home/ferris/project/.venv - + setuptools==68.2.2 + pip==23.3.1 + + setuptools==68.2.2 + wheel==0.41.3 Activate with: source /home/ferris/project/.venv/bin/activate "###