dexverse-cli 0.1.3__tar.gz → 0.1.3.post1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {dexverse_cli-0.1.3 → dexverse_cli-0.1.3.post1}/PKG-INFO +1 -1
- {dexverse_cli-0.1.3 → dexverse_cli-0.1.3.post1}/pyproject.toml +1 -1
- dexverse_cli-0.1.3.post1/src/dexverse_cli/__init__.py +1 -0
- {dexverse_cli-0.1.3 → dexverse_cli-0.1.3.post1}/src/dexverse_cli/cli.py +15 -8
- {dexverse_cli-0.1.3 → dexverse_cli-0.1.3.post1}/src/dexverse_cli/download.py +19 -1
- {dexverse_cli-0.1.3 → dexverse_cli-0.1.3.post1}/uv.lock +1 -1
- dexverse_cli-0.1.3/src/dexverse_cli/__init__.py +0 -1
- {dexverse_cli-0.1.3 → dexverse_cli-0.1.3.post1}/.gitignore +0 -0
- {dexverse_cli-0.1.3 → dexverse_cli-0.1.3.post1}/.python-version +0 -0
- {dexverse_cli-0.1.3 → dexverse_cli-0.1.3.post1}/src/dexverse_cli/README.md +0 -0
- {dexverse_cli-0.1.3 → dexverse_cli-0.1.3.post1}/src/dexverse_cli/alignment.py +0 -0
- {dexverse_cli-0.1.3 → dexverse_cli-0.1.3.post1}/src/dexverse_cli/hdf5_schema.py +0 -0
- {dexverse_cli-0.1.3 → dexverse_cli-0.1.3.post1}/src/dexverse_cli/http.py +0 -0
- {dexverse_cli-0.1.3 → dexverse_cli-0.1.3.post1}/src/dexverse_cli/jetson_encoder.py +0 -0
- {dexverse_cli-0.1.3 → dexverse_cli-0.1.3.post1}/src/dexverse_cli/manifest.py +0 -0
- {dexverse_cli-0.1.3 → dexverse_cli-0.1.3.post1}/src/dexverse_cli/pack.py +0 -0
- {dexverse_cli-0.1.3 → dexverse_cli-0.1.3.post1}/src/dexverse_cli/raw_schema.py +0 -0
- {dexverse_cli-0.1.3 → dexverse_cli-0.1.3.post1}/src/dexverse_cli/state.py +0 -0
- {dexverse_cli-0.1.3 → dexverse_cli-0.1.3.post1}/src/dexverse_cli/transaction.py +0 -0
- {dexverse_cli-0.1.3 → dexverse_cli-0.1.3.post1}/src/dexverse_cli/unpack.py +0 -0
- {dexverse_cli-0.1.3 → dexverse_cli-0.1.3.post1}/src/dexverse_cli/unversioned_hdf5.py +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.1.3.post1"
|
|
@@ -87,14 +87,21 @@ def download(
|
|
|
87
87
|
"warning: TLS certificate verification is disabled; pass --secure to enable it",
|
|
88
88
|
err=True,
|
|
89
89
|
)
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
90
|
+
with batch_progress(show_detail=True) as progress:
|
|
91
|
+
task_id = progress.add_task(
|
|
92
|
+
f"Downloading 0/{len(files)}",
|
|
93
|
+
total=len(files),
|
|
94
|
+
detail=f"{len(files)} files → {out}",
|
|
95
|
+
)
|
|
96
|
+
report = download_files(
|
|
97
|
+
files,
|
|
98
|
+
out,
|
|
99
|
+
parallel=parallel,
|
|
100
|
+
secure=secure,
|
|
101
|
+
read_timeout=http_read_timeout,
|
|
102
|
+
max_retries=http_retries,
|
|
103
|
+
on_progress=progress_callback(progress, task_id, "Downloading"),
|
|
104
|
+
)
|
|
98
105
|
except (ManifestError, OSError) as exc:
|
|
99
106
|
typer.echo(f"error: {exc}", err=True)
|
|
100
107
|
raise typer.Exit(code=1) from exc
|
|
@@ -9,6 +9,7 @@ from dataclasses import dataclass
|
|
|
9
9
|
from functools import partial
|
|
10
10
|
from hashlib import sha256
|
|
11
11
|
from pathlib import Path
|
|
12
|
+
from threading import Lock
|
|
12
13
|
|
|
13
14
|
from dexverse_cli.http import (
|
|
14
15
|
HttpClientProvider,
|
|
@@ -26,6 +27,8 @@ from dexverse_cli.state import (
|
|
|
26
27
|
write_file_metadata,
|
|
27
28
|
)
|
|
28
29
|
|
|
30
|
+
ProgressCallback = Callable[[int, int], None]
|
|
31
|
+
|
|
29
32
|
|
|
30
33
|
@dataclass(frozen=True, slots=True)
|
|
31
34
|
class DownloadReport:
|
|
@@ -289,17 +292,32 @@ def download_files(
|
|
|
289
292
|
secure: bool,
|
|
290
293
|
read_timeout: float,
|
|
291
294
|
max_retries: int,
|
|
295
|
+
on_progress: ProgressCallback | None = None,
|
|
292
296
|
) -> DownloadReport:
|
|
293
297
|
output = build_output_plan(files, out)
|
|
294
298
|
if not output.files:
|
|
295
299
|
return DownloadReport(downloaded=0, skipped=0, failures=())
|
|
300
|
+
if on_progress is not None:
|
|
301
|
+
on_progress(0, len(output.files))
|
|
296
302
|
client_provider = HttpClientProvider(parallel=parallel, secure=secure, read_timeout=read_timeout)
|
|
297
|
-
|
|
303
|
+
download_worker = partial(
|
|
298
304
|
download_one,
|
|
299
305
|
output=output,
|
|
300
306
|
client_provider=client_provider,
|
|
301
307
|
max_retries=max_retries,
|
|
302
308
|
)
|
|
309
|
+
completed = 0
|
|
310
|
+
progress_lock = Lock()
|
|
311
|
+
|
|
312
|
+
def worker(file: FileOutputPlan) -> tuple[str, str | None]:
|
|
313
|
+
nonlocal completed
|
|
314
|
+
result = download_worker(file)
|
|
315
|
+
if on_progress is not None:
|
|
316
|
+
with progress_lock:
|
|
317
|
+
completed += 1
|
|
318
|
+
on_progress(completed, len(output.files))
|
|
319
|
+
return result
|
|
320
|
+
|
|
303
321
|
try:
|
|
304
322
|
with ThreadPoolExecutor(max_workers=parallel) as executor:
|
|
305
323
|
results = tuple(executor.map(worker, output.files))
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "0.1.3"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|