Skip to content

Commit

Permalink
Remove animated spinner when resolving dependencies
Browse files Browse the repository at this point in the history
The animation shadows any interactive authentication prompt which may
occur when resolving dependencies of private repos.

Fixes astral-sh#5107.
  • Loading branch information
piegamesde committed Feb 24, 2025
1 parent 878497a commit 48610a6
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 6 deletions.
7 changes: 1 addition & 6 deletions crates/uv/src/commands/reporters.rs
Original file line number Diff line number Diff line change
Expand Up @@ -389,12 +389,7 @@ impl From<Printer> for ResolverReporter {
fn from(printer: Printer) -> Self {
let multi_progress = MultiProgress::with_draw_target(printer.target());
let root = multi_progress.add(ProgressBar::with_draw_target(None, printer.target()));
root.enable_steady_tick(Duration::from_millis(200));
root.set_style(
ProgressStyle::with_template("{spinner:.white} {wide_msg:.dim}")
.unwrap()
.tick_strings(&["⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"]),
);
root.set_style(ProgressStyle::with_template("{wide_msg:.dim}").unwrap());
root.set_message("Resolving dependencies...");

let reporter = ProgressReporter::new(root, multi_progress, printer);
Expand Down
31 changes: 31 additions & 0 deletions crates/uv/tests/it/pip_install.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2174,6 +2174,37 @@ fn install_github_artifact_private_https_multiple_pat() {
context.assert_installed("uv_private_pypackage", "0.1.0");
}

/// Install a package from a private GitHub repository using interactive authentication
/// Regression test for <https://github.com/astral-sh/uv/issues/5107>
#[test]
#[cfg(feature = "git")]
fn install_git_private_https_interactive() {
let context = TestContext::new("3.8");
let token = decode_token(common::READ_ONLY_GITHUB_TOKEN);

let filters: Vec<_> = [(token.as_str(), "***")]
.into_iter()
.chain(context.filters())
.collect();

let package = "uv-private-pypackage@ git+https://github.com/astral-test/uv-private-pypackage";

uv_snapshot!(filters, context.pip_install().arg(package)
, @r###"
success: true
exit_code: 0
----- stdout -----
----- stderr -----
Resolved 1 package in [TIME]
Prepared 1 package in [TIME]
Installed 1 package in [TIME]
+ uv-private-pypackage==0.1.0 (from git+https://***@github.com/astral-test/uv-private-pypackage@d780faf0ac91257d4d5a4f0c5a0e4509608c0071)
"###);

context.assert_installed("uv_private_pypackage", "0.1.0");
}

/// Install a package without using pre-built wheels.
#[test]
fn reinstall_no_binary() {
Expand Down

0 comments on commit 48610a6

Please sign in to comment.