Skip to content

Commit

Permalink
Use "Prepared" instead of "Downloaded" in logs (#4394)
Browse files Browse the repository at this point in the history
We download, build, and unzip packages in this stage. The current name
is very misleading.

Closes #4011
  • Loading branch information
zanieb authored Jun 18, 2024
1 parent e486eb8 commit b22ee82
Show file tree
Hide file tree
Showing 14 changed files with 324 additions and 324 deletions.
2 changes: 1 addition & 1 deletion crates/uv/src/commands/pip/operations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ pub(crate) async fn install(
printer.stderr(),
"{}",
format!(
"Downloaded {} in {}",
"Prepared {} in {}",
format!("{} package{}", wheels.len(), s).bold(),
elapsed(start.elapsed())
)
Expand Down
4 changes: 2 additions & 2 deletions crates/uv/src/commands/reporters.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ impl ProgressReporter {
state.sizes.insert(position, size.unwrap_or(0));

let progress = multi_progress.insert(
// Make sure not to reorder the initial "Downloading..." bar, or any previous bars.
// Make sure not to reorder the initial "Preparing..." bar, or any previous bars.
position + 1 + state.headers,
ProgressBar::with_draw_target(size, self.printer.target()),
);
Expand Down Expand Up @@ -243,7 +243,7 @@ impl From<Printer> for DownloadReporter {
.unwrap()
.tick_strings(&["⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"]),
);
root.set_message("Downloading packages...");
root.set_message("Preparing packages...");

let reporter = ProgressReporter::new(root, multi_progress, printer);
Self { reporter }
Expand Down
4 changes: 2 additions & 2 deletions crates/uv/tests/common/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -800,10 +800,10 @@ pub fn run_and_format<T: AsRef<str>>(
for i in 1..20 {
for verb in match windows_filters {
WindowsFilters::Platform => {
["Resolved", "Downloaded", "Installed", "Uninstalled"].iter()
["Resolved", "Prepared", "Installed", "Uninstalled"].iter()
}
WindowsFilters::Universal => {
["Downloaded", "Installed", "Uninstalled"].iter()
["Prepared", "Installed", "Uninstalled"].iter()
}
} {
snapshot = snapshot.replace(
Expand Down
28 changes: 14 additions & 14 deletions crates/uv/tests/edit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ fn add_registry() -> Result<()> {
----- stderr -----
warning: `uv add` is experimental and may change without warning.
Resolved 4 packages in [TIME]
Downloaded 4 packages in [TIME]
Prepared 4 packages in [TIME]
Installed 4 packages in [TIME]
+ anyio==3.7.0
+ idna==3.7
Expand Down Expand Up @@ -159,7 +159,7 @@ fn add_git() -> Result<()> {
----- stderr -----
warning: `uv sync` is experimental and may change without warning.
Downloaded 4 packages in [TIME]
Prepared 4 packages in [TIME]
Installed 4 packages in [TIME]
+ anyio==3.7.0
+ idna==3.6
Expand All @@ -175,7 +175,7 @@ fn add_git() -> Result<()> {
----- stderr -----
warning: `uv add` is experimental and may change without warning.
Resolved 5 packages in [TIME]
Downloaded 2 packages in [TIME]
Prepared 2 packages in [TIME]
Uninstalled 1 package in [TIME]
Installed 2 packages in [TIME]
- project==0.1.0 (from file://[TEMP_DIR]/)
Expand Down Expand Up @@ -305,7 +305,7 @@ fn add_unnamed() -> Result<()> {
----- stderr -----
warning: `uv add` is experimental and may change without warning.
Resolved 2 packages in [TIME]
Downloaded 2 packages in [TIME]
Prepared 2 packages in [TIME]
Installed 2 packages in [TIME]
+ project==0.1.0 (from file://[TEMP_DIR]/)
+ uv-public-pypackage==0.1.0 (from git+https://github.com/astral-test/uv-public-pypackage@0dacfd662c64cb4ceb16e6cf65a157a8b715b979?rev=0.0.1#0dacfd662c64cb4ceb16e6cf65a157a8b715b979)
Expand Down Expand Up @@ -396,7 +396,7 @@ fn add_remove_dev() -> Result<()> {
----- stderr -----
warning: `uv add` is experimental and may change without warning.
Resolved 4 packages in [TIME]
Downloaded 4 packages in [TIME]
Prepared 4 packages in [TIME]
Installed 4 packages in [TIME]
+ anyio==3.7.0
+ idna==3.7
Expand Down Expand Up @@ -515,7 +515,7 @@ fn add_remove_dev() -> Result<()> {
----- stderr -----
warning: `uv remove` is experimental and may change without warning.
Resolved 1 package in [TIME]
Downloaded 1 package in [TIME]
Prepared 1 package in [TIME]
Uninstalled 4 packages in [TIME]
Installed 1 package in [TIME]
- anyio==3.7.0
Expand Down Expand Up @@ -620,7 +620,7 @@ fn add_remove_workspace() -> Result<()> {
----- stderr -----
Resolved 2 packages in [TIME]
Downloaded 2 packages in [TIME]
Prepared 2 packages in [TIME]
Installed 2 packages in [TIME]
+ child1==0.1.0 (from file://[TEMP_DIR]/child1)
+ child2==0.1.0 (from file://[TEMP_DIR]/child2)
Expand Down Expand Up @@ -698,7 +698,7 @@ fn add_remove_workspace() -> Result<()> {
----- stderr -----
warning: `uv remove` is experimental and may change without warning.
Resolved 2 packages in [TIME]
Downloaded 1 package in [TIME]
Prepared 1 package in [TIME]
Uninstalled 2 packages in [TIME]
Installed 1 package in [TIME]
- child1==0.1.0 (from file://[TEMP_DIR]/child1)
Expand Down Expand Up @@ -797,7 +797,7 @@ fn update_registry() -> Result<()> {
----- stderr -----
warning: `uv sync` is experimental and may change without warning.
Downloaded 4 packages in [TIME]
Prepared 4 packages in [TIME]
Installed 4 packages in [TIME]
+ anyio==3.7.0
+ idna==3.6
Expand All @@ -813,7 +813,7 @@ fn update_registry() -> Result<()> {
----- stderr -----
warning: `uv add` is experimental and may change without warning.
Resolved 4 packages in [TIME]
Downloaded 2 packages in [TIME]
Prepared 2 packages in [TIME]
Uninstalled 2 packages in [TIME]
Installed 2 packages in [TIME]
- anyio==3.7.0
Expand Down Expand Up @@ -942,7 +942,7 @@ fn add_no_clean() -> Result<()> {
----- stderr -----
warning: `uv sync` is experimental and may change without warning.
Downloaded 4 packages in [TIME]
Prepared 4 packages in [TIME]
Installed 4 packages in [TIME]
+ anyio==3.7.0
+ idna==3.6
Expand All @@ -967,7 +967,7 @@ fn add_no_clean() -> Result<()> {
----- stderr -----
warning: `uv add` is experimental and may change without warning.
Resolved 2 packages in [TIME]
Downloaded 2 packages in [TIME]
Prepared 2 packages in [TIME]
Uninstalled 1 package in [TIME]
Installed 2 packages in [TIME]
+ iniconfig==2.0.0
Expand Down Expand Up @@ -1083,7 +1083,7 @@ fn remove_registry() -> Result<()> {
----- stderr -----
warning: `uv sync` is experimental and may change without warning.
Downloaded 4 packages in [TIME]
Prepared 4 packages in [TIME]
Installed 4 packages in [TIME]
+ anyio==3.7.0
+ idna==3.6
Expand All @@ -1099,7 +1099,7 @@ fn remove_registry() -> Result<()> {
----- stderr -----
warning: `uv remove` is experimental and may change without warning.
Resolved 1 package in [TIME]
Downloaded 1 package in [TIME]
Prepared 1 package in [TIME]
Uninstalled 4 packages in [TIME]
Installed 1 package in [TIME]
- anyio==3.7.0
Expand Down
22 changes: 11 additions & 11 deletions crates/uv/tests/lock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ fn lock_wheel_registry() -> Result<()> {
----- stderr -----
warning: `uv sync` is experimental and may change without warning.
Downloaded 4 packages in [TIME]
Prepared 4 packages in [TIME]
Installed 4 packages in [TIME]
+ anyio==3.7.0
+ idna==3.6
Expand Down Expand Up @@ -173,7 +173,7 @@ fn lock_sdist_registry() -> Result<()> {
----- stderr -----
warning: `uv sync` is experimental and may change without warning.
Downloaded 2 packages in [TIME]
Prepared 2 packages in [TIME]
Installed 2 packages in [TIME]
+ project==0.1.0 (from file://[TEMP_DIR]/)
+ source-distribution==0.0.1
Expand Down Expand Up @@ -246,7 +246,7 @@ fn lock_sdist_git() -> Result<()> {
----- stderr -----
warning: `uv sync` is experimental and may change without warning.
Downloaded 2 packages in [TIME]
Prepared 2 packages in [TIME]
Installed 2 packages in [TIME]
+ project==0.1.0 (from file://[TEMP_DIR]/)
+ uv-public-pypackage==0.1.0 (from git+https://github.com/astral-test/uv-public-pypackage@0dacfd662c64cb4ceb16e6cf65a157a8b715b979)
Expand Down Expand Up @@ -343,7 +343,7 @@ fn lock_wheel_url() -> Result<()> {
----- stderr -----
warning: `uv sync` is experimental and may change without warning.
Downloaded 3 packages in [TIME]
Prepared 3 packages in [TIME]
Installed 4 packages in [TIME]
+ anyio==4.3.0 (from https://files.pythonhosted.org/packages/14/fd/2f20c40b45e4fb4324834aea24bd4afdf1143390242c0b33774da0e2e34f/anyio-4.3.0-py3-none-any.whl)
+ idna==3.6
Expand Down Expand Up @@ -442,7 +442,7 @@ fn lock_sdist_url() -> Result<()> {
----- stderr -----
warning: `uv sync` is experimental and may change without warning.
Downloaded 4 packages in [TIME]
Prepared 4 packages in [TIME]
Installed 4 packages in [TIME]
+ anyio==4.3.0 (from https://files.pythonhosted.org/packages/db/4d/3970183622f0330d3c23d9b8a5f52e365e50381fd484d08e3285104333d3/anyio-4.3.0.tar.gz)
+ idna==3.6
Expand Down Expand Up @@ -559,7 +559,7 @@ fn lock_project_extra() -> Result<()> {
----- stderr -----
warning: `uv sync` is experimental and may change without warning.
Downloaded 4 packages in [TIME]
Prepared 4 packages in [TIME]
Installed 4 packages in [TIME]
+ anyio==3.7.0
+ idna==3.6
Expand All @@ -575,7 +575,7 @@ fn lock_project_extra() -> Result<()> {
----- stderr -----
warning: `uv sync` is experimental and may change without warning.
Downloaded 1 package in [TIME]
Prepared 1 package in [TIME]
Installed 1 package in [TIME]
+ iniconfig==2.0.0
"###);
Expand Down Expand Up @@ -818,7 +818,7 @@ fn lock_dependency_extra() -> Result<()> {
----- stderr -----
warning: `uv sync` is experimental and may change without warning.
Downloaded 9 packages in [TIME]
Prepared 9 packages in [TIME]
Installed 9 packages in [TIME]
+ blinker==1.7.0
+ click==8.1.7
Expand Down Expand Up @@ -1060,7 +1060,7 @@ fn lock_conditional_dependency_extra() -> Result<()> {
----- stderr -----
warning: `uv sync` is experimental and may change without warning.
Downloaded 6 packages in [TIME]
Prepared 6 packages in [TIME]
Installed 6 packages in [TIME]
+ certifi==2024.2.2
+ charset-normalizer==3.0.1
Expand All @@ -1084,7 +1084,7 @@ fn lock_conditional_dependency_extra() -> Result<()> {
----- stderr -----
warning: `uv sync` is experimental and may change without warning.
Downloaded 7 packages in [TIME]
Prepared 7 packages in [TIME]
Installed 7 packages in [TIME]
+ certifi==2024.2.2
+ charset-normalizer==3.0.1
Expand Down Expand Up @@ -2269,7 +2269,7 @@ fn lock_dev() -> Result<()> {
----- stderr -----
warning: `uv sync` is experimental and may change without warning.
Downloaded 2 packages in [TIME]
Prepared 2 packages in [TIME]
Installed 2 packages in [TIME]
+ iniconfig==2.0.0
+ project==0.1.0 (from file://[TEMP_DIR]/)
Expand Down
10 changes: 5 additions & 5 deletions crates/uv/tests/pip_check.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ fn check_compatible_packages() -> Result<()> {
----- stderr -----
Resolved 5 packages in [TIME]
Downloaded 5 packages in [TIME]
Prepared 5 packages in [TIME]
Installed 5 packages in [TIME]
+ certifi==2024.2.2
+ charset-normalizer==3.3.2
Expand Down Expand Up @@ -108,7 +108,7 @@ fn check_incompatible_packages() -> Result<()> {
----- stderr -----
Resolved 5 packages in [TIME]
Downloaded 5 packages in [TIME]
Prepared 5 packages in [TIME]
Installed 5 packages in [TIME]
+ certifi==2024.2.2
+ charset-normalizer==3.3.2
Expand All @@ -131,7 +131,7 @@ fn check_incompatible_packages() -> Result<()> {
----- stderr -----
Resolved 1 package in [TIME]
Downloaded 1 package in [TIME]
Prepared 1 package in [TIME]
Uninstalled 1 package in [TIME]
Installed 1 package in [TIME]
- idna==3.6
Expand Down Expand Up @@ -175,7 +175,7 @@ fn check_multiple_incompatible_packages() -> Result<()> {
----- stderr -----
Resolved 5 packages in [TIME]
Downloaded 5 packages in [TIME]
Prepared 5 packages in [TIME]
Installed 5 packages in [TIME]
+ certifi==2024.2.2
+ charset-normalizer==3.3.2
Expand All @@ -198,7 +198,7 @@ fn check_multiple_incompatible_packages() -> Result<()> {
----- stderr -----
Resolved 2 packages in [TIME]
Downloaded 2 packages in [TIME]
Prepared 2 packages in [TIME]
Uninstalled 2 packages in [TIME]
Installed 2 packages in [TIME]
- idna==3.6
Expand Down
2 changes: 1 addition & 1 deletion crates/uv/tests/pip_compile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7998,7 +7998,7 @@ fn local_version_of_remote_package() -> Result<()> {
----- stderr -----
Resolved 1 package in [TIME]
Downloaded 1 package in [TIME]
Prepared 1 package in [TIME]
Installed 1 package in [TIME]
+ anyio==4.3.0+foo (from file://[WORKSPACE]/scripts/packages/anyio_local)
"###
Expand Down
Loading

0 comments on commit b22ee82

Please sign in to comment.