Skip to content

Commit eb0bf8d

Browse files
committed
Copy site-packages for Pyodide only when needed
Add a guard to only copy site-packages for the Pyodide platform if there are requirements to include (requirements.isNotEmpty). This prevents unnecessary copying of the site-packages directory when no requirements are specified, avoiding wasted I/O and archive bloat.
1 parent 9445f96 commit eb0bf8d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/serious_python/bin/package_command.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,7 @@ class PackageCommand extends Command {
430430
}
431431

432432
// copy site packages to temp dir for web platform
433-
if (platform == "Pyodide") {
433+
if (platform == "Pyodide" && requirements.isNotEmpty) {
434434
final sitePackagesSrcDir = Directory(sitePackagesRoot);
435435
if (await sitePackagesSrcDir.exists()) {
436436
stdout.writeln("Copying site packages to app archive");

0 commit comments

Comments
 (0)