Skip to content

fix: place repack dependencies in code root - #6461

Open
lucasjia-aws wants to merge 1 commit into
aws:master-v2from
lucasjia-aws:fix/3491-repack-dependencies-v2
Open

lucasjia-aws wants to merge 1 commit into
aws:master-v2from
lucasjia-aws:fix/3491-repack-dependencies-v2

Conversation

@lucasjia-aws

@lucasjia-aws lucasjia-aws commented Oct 13, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Repacked models currently place user dependencies under code/lib, while SageMaker inference toolkits add only code to the Python path. This change copies file and directory dependencies directly into code, matching source-directory packaging and making the dependencies importable at runtime.

The existing collision behavior is preserved: directory conflicts raise FileExistsError, while file dependencies retain shutil.copy2 overwrite semantics.

Testing

  • Updated archive-layout expectations and added direct dependency and collision coverage.
  • Ran five targeted repack and archive-layout tests: 5 passed.
  • Flake8 and git diff --check passed; the modified tests pass Black.
  • Built the SageMaker 2.257.7 wheel and source distribution successfully.

Related change

The companion V3 fix is published on branch #6460.

Fixes #3491

Copy directory and file dependencies alongside inference code so SageMaker inference toolkits can import them without extending sys.path. Preserve the existing copytree collision error and copy2 file overwrite behavior.

Fixes aws#3491

This branch was successfully deployed

1 active deployment
auto-approve — 46633e6d Deployed Oct 13, 2026 by lucasjia-aws via wait-for-approval #254
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant