<#724 feat: allow with_source_file to accept a lis...
# flyte-github
a
#724 feat: allow with_source_file to accept a list of paths Pull request opened by AdilFayyaz Summary
with_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-sdk