acoustic-carpenter-78188
02/26/2026, 10:35 PMwith_source_file previously accepted only a single Path. This PR extends it to also accept a List[Path], where each file becomes its own COPY layer in the image - equivalent to chaining multiple with_source_file calls. A ValueError is raised eagerly if two paths in the list share the same filename at the same destination, preventing silent overwrites in the Dockerfile.
Test Plan
• pytest tests/flyte/test_image.py -k "test_with_source" passes
• Single Path argument still works (backward-compatible)
• [Path("a/x.py"), Path("b/x.py")] raises ValueError with message mentioning "Multiple files with the same name would overwrite each other at destination [dst]"
• [Path("a.py"), Path("b.py")] produces two separate CopyConfig layers in the correct order
flyteorg/flyte-sdkacoustic-carpenter-78188
03/04/2026, 1:11 AM