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(
534
534
if os .path .isdir (dependency ):
535
535
shutil .copytree (dependency , os .path .join (lib_dir , os .path .basename (dependency )))
536
536
else :
537
- os .mkdir (lib_dir )
537
+ if not os .path .exists (lib_dir ):
538
+ os .mkdir (lib_dir )
538
539
shutil .copy2 (dependency , lib_dir )
539
540
540
541
Original file line number Diff line number Diff line change @@ -444,6 +444,8 @@ def test_repack_model_without_source_dir(tmp, fake_s3):
444
444
"model-dir/model" ,
445
445
"dependencies/a" ,
446
446
"dependencies/some/dir/b" ,
447
+ "aa" ,
448
+ "bb" ,
447
449
"source-dir/inference.py" ,
448
450
"source-dir/this-file-should-not-be-included.py" ,
449
451
],
@@ -457,6 +459,8 @@ def test_repack_model_without_source_dir(tmp, fake_s3):
457
459
dependencies = [
458
460
os .path .join (tmp , "dependencies/a" ),
459
461
os .path .join (tmp , "dependencies/some/dir" ),
462
+ os .path .join (tmp , "aa" ),
463
+ os .path .join (tmp , "bb" ),
460
464
],
461
465
model_uri = "s3://fake/location" ,
462
466
repacked_model_uri = "s3://destination-bucket/model.tar.gz" ,
@@ -466,6 +470,8 @@ def test_repack_model_without_source_dir(tmp, fake_s3):
466
470
assert list_tar_files (fake_s3 .fake_upload_path , tmp ) == {
467
471
"/model" ,
468
472
"/code/lib/a" ,
473
+ "/code/lib/aa" ,
474
+ "/code/lib/bb" ,
469
475
"/code/lib/dir/b" ,
470
476
"/code/inference.py" ,
471
477
}
You can’t perform that action at this time.
0 commit comments