Skip to content

Commit 0fdbcdd

Browse files
authored
fix: don't filter files when copying dependencies to artifact folder for pip workflow (#305)
1 parent b1fb168 commit 0fdbcdd

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

aws_lambda_builders/actions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ def execute(self):
187187

188188
for name in targets:
189189
target_path = os.path.join(self.target_dir, name)
190-
LOG.info("Clean up action: %s is deleted", str(target_path))
190+
LOG.debug("Clean up action: %s is deleted", str(target_path))
191191

192192
if os.path.isdir(target_path):
193193
shutil.rmtree(target_path)

aws_lambda_builders/workflows/python_pip/workflow.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,8 @@ def __init__(self, source_dir, artifacts_dir, scratch_dir, manifest_path, runtim
105105
# if combine_dependencies is false, will not copy the dependencies from dependencies folder to artifact
106106
# folder
107107
if self.dependencies_dir and self.combine_dependencies:
108-
self.actions.append(CopySourceAction(self.dependencies_dir, artifacts_dir, excludes=self.EXCLUDED_FILES))
108+
# when copying downloaded dependencies back to artifacts folder, don't exclude anything
109+
self.actions.append(CopySourceAction(self.dependencies_dir, artifacts_dir))
109110

110111
self.actions.append(CopySourceAction(source_dir, artifacts_dir, excludes=self.EXCLUDED_FILES))
111112

tests/unit/workflows/python_pip/test_workflow.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@ def test_workflow_sets_up_actions_with_download_dependencies_and_dependencies_di
6969
self.assertIsInstance(self.workflow.actions[1], PythonPipBuildAction)
7070
self.assertIsInstance(self.workflow.actions[2], CopySourceAction)
7171
self.assertIsInstance(self.workflow.actions[3], CopySourceAction)
72+
# check copying dependencies does not have any exclude
73+
self.assertEqual(self.workflow.actions[2].excludes, [])
7274

7375
def test_workflow_sets_up_actions_without_download_dependencies_without_dependencies_dir(self):
7476
osutils_mock = Mock(spec=self.osutils)

0 commit comments

Comments
 (0)