Skip to content

Commit

Permalink
Sort output when installing seed packages (#1822)
Browse files Browse the repository at this point in the history
This output is technically non-deterministic right now.
  • Loading branch information
charliermarsh authored Feb 21, 2024
1 parent 39ee396 commit b4bc406
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion crates/uv/src/commands/venv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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,
" {} {}{}",
Expand Down
2 changes: 1 addition & 1 deletion crates/uv/tests/venv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
"###
Expand Down

0 comments on commit b4bc406

Please sign in to comment.