Skip to content

Commit 9eb8104

Browse files
committed
[python] don't attempt systemdep install if no deps
1 parent 8491c5a commit 9eb8104

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

internal/backends/python/python.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,8 @@ func commonInstallDotReplitNixDeps(ctx context.Context, pkgs []api.PkgName, spec
333333
}
334334
}
335335
}
336+
337+
originalLen := len(allPkgs)
336338

337339
for _, pkg := range pkgs {
338340
deps := nix.PythonNixDeps(string(pkg))
@@ -350,11 +352,17 @@ func commonInstallDotReplitNixDeps(ctx context.Context, pkgs []api.PkgName, spec
350352
}
351353
}
352354

355+
if len(allPkgs) == originalLen {
356+
// No new packages were added, so we can skip writing to .replit
357+
return
358+
}
359+
353360
keys := []string{}
354361
for key := range allPkgs {
355362
keys = append(keys, key)
356363
}
357364
slices.Sort(keys)
365+
358366
value, err := json.Marshal(keys)
359367
if err != nil {
360368
util.DieSubprocess("failed to marshal JSON: %s", err)

0 commit comments

Comments
 (0)