Skip to content

Commit 6d266ee

Browse files
author
Ryan Ragnell
committed
fix: prevent double-zipping when using poetry_install/pip_requirements/npm_requirements
When poetry_install, pip_requirements, or npm_requirements are enabled, the dependency managers handle zipping their installed packages correctly. However, the module was also unconditionally zipping the original source path, causing both the dependencies AND filtered source files to be included in the final zip. This fix makes the source path zip step conditional - it only runs when NOT using dependency managers, preventing the double-zipping issue. Fixes issue where patterns were ineffective at excluding source files when poetry_install was enabled.
1 parent 1c3b16a commit 6d266ee

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

package.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -875,7 +875,10 @@ def commands_step(path, commands):
875875
required=True,
876876
tmp_dir=claim.get("npm_tmp_dir"),
877877
)
878-
if path:
878+
879+
# Only zip the source path if not using dependency managers
880+
# (pip/poetry/npm handle their own zipping)
881+
if path and not (pip_requirements or poetry_install or npm_requirements):
879882
path = os.path.normpath(path)
880883
step("zip", path, prefix)
881884
if patterns:

0 commit comments

Comments
 (0)