File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -534,7 +534,8 @@ def _create_or_update_code_dir(
534534 if os .path .isdir (dependency ):
535535 shutil .copytree (dependency , os .path .join (lib_dir , os .path .basename (dependency )))
536536 else :
537- os .mkdir (lib_dir )
537+ if not os .path .exists (lib_dir ):
538+ os .mkdir (lib_dir )
538539 shutil .copy2 (dependency , lib_dir )
539540
540541
Original file line number Diff line number Diff line change @@ -444,6 +444,8 @@ def test_repack_model_without_source_dir(tmp, fake_s3):
444444 "model-dir/model" ,
445445 "dependencies/a" ,
446446 "dependencies/some/dir/b" ,
447+ "aa" ,
448+ "bb" ,
447449 "source-dir/inference.py" ,
448450 "source-dir/this-file-should-not-be-included.py" ,
449451 ],
@@ -457,6 +459,8 @@ def test_repack_model_without_source_dir(tmp, fake_s3):
457459 dependencies = [
458460 os .path .join (tmp , "dependencies/a" ),
459461 os .path .join (tmp , "dependencies/some/dir" ),
462+ os .path .join (tmp , "aa" ),
463+ os .path .join (tmp , "bb" ),
460464 ],
461465 model_uri = "s3://fake/location" ,
462466 repacked_model_uri = "s3://destination-bucket/model.tar.gz" ,
@@ -466,6 +470,8 @@ def test_repack_model_without_source_dir(tmp, fake_s3):
466470 assert list_tar_files (fake_s3 .fake_upload_path , tmp ) == {
467471 "/model" ,
468472 "/code/lib/a" ,
473+ "/code/lib/aa" ,
474+ "/code/lib/bb" ,
469475 "/code/lib/dir/b" ,
470476 "/code/inference.py" ,
471477 }
You can’t perform that action at this time.
0 commit comments