sideload 1.0.0__py3-none-any.whl → 1.1.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 +26 -4
- sideload/main.py +1 -1
- {sideload-1.0.0.dist-info → sideload-1.1.0.dist-info}/METADATA +1 -1
- {sideload-1.0.0.dist-info → sideload-1.1.0.dist-info}/RECORD +6 -6
- {sideload-1.0.0.dist-info → sideload-1.1.0.dist-info}/WHEEL +0 -0
- {sideload-1.0.0.dist-info → sideload-1.1.0.dist-info}/entry_points.txt +0 -0
sideload/cli.py
CHANGED
|
@@ -178,13 +178,26 @@ class SideloadClient:
|
|
|
178
178
|
return downloaded_files
|
|
179
179
|
|
|
180
180
|
def extract_and_reassemble(
|
|
181
|
-
self, wheel_files: List[Path], package_names: List[str], original_filename: str, output_path: Path, debug: bool = False
|
|
181
|
+
self, wheel_files: List[Path], package_names: List[str], original_filename: str, output_path: Path, debug: bool = False, work_dir: Path = None
|
|
182
182
|
):
|
|
183
183
|
"""Extract parts from wheel files and reassemble the original file"""
|
|
184
|
-
|
|
185
|
-
|
|
184
|
+
# Use provided work directory or create a temporary one
|
|
185
|
+
use_temp = work_dir is None
|
|
186
|
+
if use_temp:
|
|
187
|
+
temp_dir_obj = tempfile.TemporaryDirectory()
|
|
188
|
+
temp_path = Path(temp_dir_obj.name)
|
|
189
|
+
else:
|
|
190
|
+
temp_dir_obj = None
|
|
191
|
+
temp_path = work_dir
|
|
192
|
+
temp_path.mkdir(parents=True, exist_ok=True)
|
|
193
|
+
|
|
194
|
+
try:
|
|
186
195
|
part_files = []
|
|
187
196
|
|
|
197
|
+
if not use_temp:
|
|
198
|
+
console.print(f"[yellow]⚠️ Using work directory: {temp_path}[/yellow]")
|
|
199
|
+
console.print(f"[yellow] Files will be kept after extraction for debugging[/yellow]")
|
|
200
|
+
|
|
188
201
|
with Progress(
|
|
189
202
|
SpinnerColumn(),
|
|
190
203
|
TextColumn("[progress.description]{task.description}"),
|
|
@@ -282,6 +295,10 @@ class SideloadClient:
|
|
|
282
295
|
description="✅ Reassembly complete!",
|
|
283
296
|
completed=len(part_files),
|
|
284
297
|
)
|
|
298
|
+
finally:
|
|
299
|
+
# Clean up temporary directory if we created one
|
|
300
|
+
if use_temp and temp_dir_obj:
|
|
301
|
+
temp_dir_obj.cleanup()
|
|
285
302
|
|
|
286
303
|
|
|
287
304
|
def display_header():
|
|
@@ -341,6 +358,11 @@ Examples:
|
|
|
341
358
|
action="store_true",
|
|
342
359
|
help="Enable debug logging",
|
|
343
360
|
)
|
|
361
|
+
download_parser.add_argument(
|
|
362
|
+
"--work-dir",
|
|
363
|
+
type=Path,
|
|
364
|
+
help="Working directory for extraction (for debugging, defaults to temp directory)",
|
|
365
|
+
)
|
|
344
366
|
|
|
345
367
|
args = parser.parse_args()
|
|
346
368
|
|
|
@@ -417,7 +439,7 @@ Examples:
|
|
|
417
439
|
output_file = args.output / original_filename
|
|
418
440
|
|
|
419
441
|
client.extract_and_reassemble(
|
|
420
|
-
wheel_files, package_names, original_filename, output_file, args.debug
|
|
442
|
+
wheel_files, package_names, original_filename, output_file, args.debug, args.work_dir
|
|
421
443
|
)
|
|
422
444
|
|
|
423
445
|
# Success!
|
sideload/main.py
CHANGED
|
@@ -11,7 +11,7 @@ from sideload.jsonbin_connector import JSONBinConnector
|
|
|
11
11
|
|
|
12
12
|
JSONBIN_TOKEN = os.environ["JSONBIN_TOKEN"]
|
|
13
13
|
PYPI_TOKEN = os.environ["PYPI_TOKEN"]
|
|
14
|
-
MAX_PACKAGE_SIZE =
|
|
14
|
+
MAX_PACKAGE_SIZE = 95 * 1024 * 1024 # 95 MB
|
|
15
15
|
|
|
16
16
|
LAST_BINS: dict[str, str | None] = {}
|
|
17
17
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
sideload/__init__.py,sha256=Y3rHLtR7n0sjLXrn-BEcrbIHx-9uE1tPZkooavo7xcA,222
|
|
2
|
-
sideload/cli.py,sha256=
|
|
2
|
+
sideload/cli.py,sha256=zGcpAJ_j4ZrqWln3lQfZ2kO8TD_AW2PjAfVo3BvRIwM,17465
|
|
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
|
-
sideload/main.py,sha256=
|
|
6
|
+
sideload/main.py,sha256=EiZguc4-ug8RM6vXkZuXW_ps8jFWoAfeKBBNy7FX-F0,7600
|
|
7
7
|
sideload/scripts/cleanup_pypi.py,sha256=CouuOhnbpSbrFc1KhlOeZAuajVVpGF9d4qwFpIKkEvY,5906
|
|
8
|
-
sideload-1.
|
|
9
|
-
sideload-1.
|
|
10
|
-
sideload-1.
|
|
11
|
-
sideload-1.
|
|
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,,
|
|
File without changes
|
|
File without changes
|