Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package_python_function/nested_zip_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@ def load_nested_zip() -> None:
if staging_package_path.exists():
shutil.rmtree(str(staging_package_path))

nested_zip_path = Path(__file__).parent / '.requirements.zip'
nested_zip_path = Path(__file__).parent / '.dependencies.zip'

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

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

Expand Down
2 changes: 2 additions & 0 deletions package_python_function/packager.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ def package(self) -> None:
print("Input:", self.input_path)
print("Entrypoint Package name:", self.project.entrypoint_package_name)

self.output_file_path.parent.mkdir(parents=True, exist_ok=True)

with NamedTemporaryFile() as dependencies_zip:
self.zip_all_dependencies(Path(dependencies_zip.name))

Expand Down
Loading