Skip to content

Commit a2277a4

Browse files
Fix .dependencies.zip filename (#2)
Create output directory if not exist
1 parent 5aec296 commit a2277a4

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

package_python_function/nested_zip_loader.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,13 @@ def load_nested_zip() -> None:
3131
if staging_package_path.exists():
3232
shutil.rmtree(str(staging_package_path))
3333

34-
nested_zip_path = Path(__file__).parent / '.requirements.zip'
34+
nested_zip_path = Path(__file__).parent / '.dependencies.zip'
3535

3636
zipfile.ZipFile(str(nested_zip_path), 'r').extractall(str(staging_package_path))
3737
os.rename(str(staging_package_path), str(target_package_path)) # Atomic -- TODO BW DOCME
3838

3939
# TODO BW: Update this comment
40-
# We want our path to look like [working_dir, serverless_requirements, ...]
40+
# We want our path to look like [working_dir, /tmp/package-python-function, ...]
4141
sys.path.insert(1, target_package_path)
4242
importlib.reload(sys.modules[__name__])
4343

package_python_function/packager.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ def package(self) -> None:
3434
print("Input:", self.input_path)
3535
print("Entrypoint Package name:", self.project.entrypoint_package_name)
3636

37+
self.output_file_path.parent.mkdir(parents=True, exist_ok=True)
38+
3739
with NamedTemporaryFile() as dependencies_zip:
3840
self.zip_all_dependencies(Path(dependencies_zip.name))
3941

0 commit comments

Comments
 (0)