sideload 1.1.0__py3-none-any.whl → 1.2.0__py3-none-any.whl

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.

Potentially problematic release.


This version of sideload might be problematic. Click here for more details.

sideload/cli.py CHANGED
@@ -117,7 +117,7 @@ class SideloadClient:
117
117
  return self.manager.get_sideload_data(bin_id)
118
118
 
119
119
  def download_packages(
120
- self, package_names: List[str], output_dir: Path
120
+ self, package_names: List[str], output_dir: Path, debug: bool = False
121
121
  ) -> List[Path]:
122
122
  """Download all packages to a temporary directory"""
123
123
  downloaded_files = []
@@ -128,6 +128,7 @@ class SideloadClient:
128
128
  BarColumn(),
129
129
  TaskProgressColumn(),
130
130
  console=console,
131
+ disable=debug, # Disable progress bar in debug mode
131
132
  ) as progress:
132
133
  download_task = progress.add_task(
133
134
  "Downloading packages...", total=len(package_names)
@@ -142,18 +143,23 @@ class SideloadClient:
142
143
 
143
144
  # Download using pip to temporary directory
144
145
  try:
146
+ cmd = [
147
+ sys.executable,
148
+ "-m",
149
+ "pip",
150
+ "download",
151
+ "--no-deps",
152
+ "--dest",
153
+ str(output_dir),
154
+ package_name,
155
+ ]
156
+
157
+ if debug:
158
+ console.print(f"[dim]Running: {' '.join(cmd)}[/dim]")
159
+
145
160
  subprocess.run(
146
- [
147
- sys.executable,
148
- "-m",
149
- "pip",
150
- "download",
151
- "--no-deps",
152
- "--dest",
153
- str(output_dir),
154
- package_name,
155
- ],
156
- capture_output=True,
161
+ cmd,
162
+ capture_output=not debug,
157
163
  text=True,
158
164
  check=True,
159
165
  )
@@ -162,10 +168,13 @@ class SideloadClient:
162
168
  wheel_files = list(output_dir.glob(f"{package_name}*.whl"))
163
169
  if wheel_files:
164
170
  downloaded_files.append(wheel_files[0])
171
+ if debug:
172
+ console.print(f"[green]✓ Downloaded: {wheel_files[0].name}[/green]")
165
173
 
166
174
  except subprocess.CalledProcessError as e:
175
+ error_msg = e.stderr if hasattr(e, 'stderr') and e.stderr else str(e)
167
176
  console.print(
168
- f"❌ Failed to download {package_name}: {e.stderr}", style="red"
177
+ f"❌ Failed to download {package_name}: {error_msg}", style="red"
169
178
  )
170
179
  continue
171
180
 
@@ -204,6 +213,7 @@ class SideloadClient:
204
213
  BarColumn(),
205
214
  TaskProgressColumn(),
206
215
  console=console,
216
+ disable=debug, # Disable progress bar in debug mode
207
217
  ) as progress:
208
218
  extract_task = progress.add_task(
209
219
  "Extracting packages...", total=len(wheel_files)
@@ -217,6 +227,9 @@ class SideloadClient:
217
227
  completed=i,
218
228
  )
219
229
 
230
+ if debug:
231
+ console.print(f"\n[cyan]Extracting package {i + 1}/{len(wheel_files)}: {package_name}[/cyan]")
232
+
220
233
  # Extract wheel file (it's just a zip)
221
234
  import zipfile
222
235
 
@@ -274,6 +287,7 @@ class SideloadClient:
274
287
  BarColumn(),
275
288
  TaskProgressColumn(),
276
289
  console=console,
290
+ disable=debug, # Disable progress bar in debug mode
277
291
  ) as progress:
278
292
  reassemble_task = progress.add_task(
279
293
  "Reassembling file...", total=len(part_files)
@@ -287,6 +301,9 @@ class SideloadClient:
287
301
  completed=i,
288
302
  )
289
303
 
304
+ if debug:
305
+ console.print(f"[dim]Reading part {i + 1}/{len(part_files)}: {part_file.name} ({part_file.stat().st_size:,} bytes)[/dim]")
306
+
290
307
  with open(part_file, "rb") as part:
291
308
  output_file.write(part.read())
292
309
 
@@ -394,6 +411,15 @@ Examples:
394
411
  # Ensure output directory exists
395
412
  args.output.mkdir(parents=True, exist_ok=True)
396
413
 
414
+ # Show debug flags if enabled
415
+ if args.debug:
416
+ console.print("\n[bold cyan]Debug Mode Enabled[/bold cyan]")
417
+ console.print(f" [dim]URL:[/dim] {args.url}")
418
+ console.print(f" [dim]Output:[/dim] {args.output}")
419
+ console.print(f" [dim]Work Directory:[/dim] {args.work_dir or 'temp (auto-cleanup)'}")
420
+ console.print(f" [dim]Collection ID:[/dim] {collection_id}")
421
+ console.print()
422
+
397
423
  try:
398
424
  with SideloadClient(jsonbin_token, collection_id) as client:
399
425
  # Create the request
@@ -425,7 +451,7 @@ Examples:
425
451
 
426
452
  with tempfile.TemporaryDirectory() as temp_dir:
427
453
  temp_path = Path(temp_dir)
428
- wheel_files = client.download_packages(package_names, temp_path)
454
+ wheel_files = client.download_packages(package_names, temp_path, args.debug)
429
455
 
430
456
  if not wheel_files:
431
457
  console.print(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: sideload
3
- Version: 1.1.0
3
+ Version: 1.2.0
4
4
  Summary: Download large files via PyPI packages
5
5
  Author: Sygmei
6
6
  Author-email: Sygmei <3835355+Sygmei@users.noreply.github.com>
@@ -1,11 +1,11 @@
1
1
  sideload/__init__.py,sha256=Y3rHLtR7n0sjLXrn-BEcrbIHx-9uE1tPZkooavo7xcA,222
2
- sideload/cli.py,sha256=zGcpAJ_j4ZrqWln3lQfZ2kO8TD_AW2PjAfVo3BvRIwM,17465
2
+ sideload/cli.py,sha256=JCedG4Xqz3AQ-24eerMW8ZdBpTx_sOZI1nfXDzOU9dE,18843
3
3
  sideload/jsonbin.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
4
  sideload/jsonbin_connector.py,sha256=HtR1Pwnpm5jfYcmnvcug9HaKxFpsyJBXYYlLuzWPiTE,1680
5
5
  sideload/jsonbin_old.py,sha256=ve21WsV7Ay60moFfrR4lSM_JRZNqo4z5v69cNw0Iqo0,8411
6
6
  sideload/main.py,sha256=EiZguc4-ug8RM6vXkZuXW_ps8jFWoAfeKBBNy7FX-F0,7600
7
7
  sideload/scripts/cleanup_pypi.py,sha256=CouuOhnbpSbrFc1KhlOeZAuajVVpGF9d4qwFpIKkEvY,5906
8
- sideload-1.1.0.dist-info/WHEEL,sha256=-neZj6nU9KAMg2CnCY6T3w8J53nx1kFGw_9HfoSzM60,79
9
- sideload-1.1.0.dist-info/entry_points.txt,sha256=7ULrIjaVhrxMhuddTeoPjeIrqmIvVc9cSU3lZU2_YqE,44
10
- sideload-1.1.0.dist-info/METADATA,sha256=AGrmSEXpybApWqfbA3uv9MHaGY2wUXo_poyPHWVRvd8,4281
11
- sideload-1.1.0.dist-info/RECORD,,
8
+ sideload-1.2.0.dist-info/WHEEL,sha256=-neZj6nU9KAMg2CnCY6T3w8J53nx1kFGw_9HfoSzM60,79
9
+ sideload-1.2.0.dist-info/entry_points.txt,sha256=7ULrIjaVhrxMhuddTeoPjeIrqmIvVc9cSU3lZU2_YqE,44
10
+ sideload-1.2.0.dist-info/METADATA,sha256=OVl1VRCVXj0m3JeHtdEQ0bjX6LyEVf8R4_tKTATPBIw,4281
11
+ sideload-1.2.0.dist-info/RECORD,,