56d16a8762
<!-- CURSOR_SUMMARY --> > [!NOTE] > Ensure file uploads honor ignore patterns (incl. .dockerignore), refactor file discovery/tar streaming in JS/Python SDKs, and add comprehensive tests. > > - **File upload behavior**: > - JS/TS and Python uploads now pass `ignorePatterns` (merged from `fileIgnorePatterns` and `.dockerignore`) to tar creation, ensuring ignored files aren’t uploaded. > - **Refactor/Utilities**: > - Rename `getAllFilesForFilesHash` -> `getAllFilesInPath` with optional directory inclusion in both SDKs. > - Implement `tar_file_stream` (JS and Python) to build archives from `getAllFilesInPath`, with `noDirRecurse` and symlink control. > - Hashing functions updated to use `getAllFilesInPath`. > - Type tweak: allow `None` in Python `stack_traces` during build wait. > - **Integration**: > - JS `uploadFile` and Python async/sync `upload_file` now use tar streaming with ignore patterns; JS `Template` wires ignore patterns into uploads. > - **Tests**: > - Add extensive tests for `getAllFilesInPath` and `tar_file_stream` in JS and Python, covering ignore patterns, directories, sorting, and symlinks. > - Remove obsolete tests relying on old function names. > - **Meta**: > - Changeset entries for `@e2b/python-sdk` and `e2b` (patch). > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 2f83444f9006393f33e8c346bec1998b3a06044d. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
What is E2B?
E2B is an open-source infrastructure that allows you to run AI-generated code in secure isolated sandboxes in the cloud. To start and control sandboxes, use our JavaScript SDK or Python SDK.
Run your first Sandbox
1. Install SDK
pip install e2b-code-interpreter
2. Get your E2B API key
E2B_API_KEY=e2b_***
3. Execute code with code interpreter inside Sandbox
from e2b_code_interpreter import Sandbox
with Sandbox.create() as sandbox:
sandbox.run_code("x = 1")
execution = sandbox.run_code("x+=1; x")
print(execution.text) # outputs 2
4. Check docs
Visit E2B documentation.
5. E2B cookbook
Visit our Cookbook to get inspired by examples with different LLMs and AI frameworks.
