diff --git a/dvc/remote/azure.py b/dvc/remote/azure.py index c8dcd9777..2527b66ba 100644 --- a/dvc/remote/azure.py +++ b/dvc/remote/azure.py @@ -115,7 +115,9 @@ class RemoteAZURE(RemoteBASE): def _upload( self, from_file, to_info, name=None, no_progress_bar=False, **_kwargs ): - with Tqdm(desc_truncate=name, disable=no_progress_bar) as pbar: + with Tqdm( + desc_truncate=name, disable=no_progress_bar, bytes=True + ) as pbar: self.blob_service.create_blob_from_path( to_info.bucket, to_info.path, @@ -126,7 +128,9 @@ class RemoteAZURE(RemoteBASE): def _download( self, from_info, to_file, name=None, no_progress_bar=False, **_kwargs ): - with Tqdm(desc_truncate=name, disable=no_progress_bar) as pbar: + with Tqdm( + desc_truncate=name, disable=no_progress_bar, bytes=True + ) as pbar: self.blob_service.get_blob_to_path( from_info.bucket, from_info.path, diff --git a/dvc/remote/base.py b/dvc/remote/base.py index b73e24b89..6790a9a65 100644 --- a/dvc/remote/base.py +++ b/dvc/remote/base.py @@ -632,7 +632,7 @@ class RemoteBASE(object): if not self.no_traverse: return list(set(checksums) & set(self.all())) - with Tqdm(total=len(checksums)) as pbar: + with Tqdm(total=len(checksums), unit="md5") as pbar: def exists_with_progress(path_info): ret = self.exists(path_info) diff --git a/dvc/remote/local/__init__.py b/dvc/remote/local/__init__.py index e0e0cb3d6..3c22cbda9 100644 --- a/dvc/remote/local/__init__.py +++ b/dvc/remote/local/__init__.py @@ -348,7 +348,9 @@ class RemoteLOCAL(RemoteBASE): cache = [] path_infos = [] names = [] - for md5, info in Tqdm(status_info.items(), desc="Analysing status"): + for md5, info in Tqdm( + status_info.items(), desc="Analysing status", unit="file" + ): if info["status"] == status: cache.append(self.checksum_to_path_info(md5)) path_infos.append(remote.checksum_to_path_info(md5)) @@ -539,7 +541,7 @@ class RemoteLOCAL(RemoteBASE): def _create_unpacked_dir(self, checksum, dir_info, unpacked_dir_info): self.makedirs(unpacked_dir_info) - for entry in Tqdm(dir_info, desc="Created unpacked dir"): + for entry in Tqdm(dir_info, desc="Creating unpacked dir", unit="dir"): entry_cache_info = self.checksum_to_path_info( entry[self.PARAM_CHECKSUM] ) diff --git a/dvc/remote/ssh/__init__.py b/dvc/remote/ssh/__init__.py index 826a68591..2e18c5f5e 100644 --- a/dvc/remote/ssh/__init__.py +++ b/dvc/remote/ssh/__init__.py @@ -251,7 +251,7 @@ class RemoteSSH(RemoteBASE): if not self.no_traverse: return list(set(checksums) & set(self.all())) - with Tqdm(total=len(checksums)) as pbar: + with Tqdm(total=len(checksums), unit="md5") as pbar: def exists_with_progress(chunks): return self.batch_exists(chunks, callback=pbar.update_desc) diff --git a/dvc/remote/ssh/connection.py b/dvc/remote/ssh/connection.py index 7243b694f..fbb0c2b7b 100644 --- a/dvc/remote/ssh/connection.py +++ b/dvc/remote/ssh/connection.py @@ -171,6 +171,7 @@ class SSHConnection: with Tqdm( desc_truncate=progress_title or os.path.basename(src), disable=no_progress_bar, + bytes=True, ) as pbar: self.sftp.get(src, dest, callback=pbar.update_to) @@ -185,7 +186,7 @@ class SSHConnection: progress_title = posixpath.basename(dest) with Tqdm( - desc_truncate=progress_title, disable=no_progress_bar + desc_truncate=progress_title, disable=no_progress_bar, bytes=True ) as pbar: self.sftp.put(src, tmp_file, callback=pbar.update_to) diff --git a/dvc/repo/checkout.py b/dvc/repo/checkout.py index 0ddbfc4d7..2b4d036aa 100644 --- a/dvc/repo/checkout.py +++ b/dvc/repo/checkout.py @@ -37,7 +37,7 @@ def checkout(self, target=None, with_deps=False, force=False, recursive=False): with self.state: _cleanup_unused_links(self, all_stages) - with Tqdm(total=get_all_files_numbers(stages)) as pbar: + with Tqdm(total=get_all_files_numbers(stages), unit="file") as pbar: for stage in stages: if stage.locked: logger.warning(