Commit Graph

1019 Commits

Author SHA1 Message Date
Jakub Novak e037a945a2 Increase browser timeout 2024-10-16 03:07:49 -07:00
Vasek Mlejnsky 2be5fb296d Update README.md 2024-10-16 02:44:59 -07:00
Vasek Mlejnsky af7fb9f806 Update README.md 2024-10-16 02:44:24 -07:00
Vasek Mlejnsky 51456b05c9 Update README.md 2024-10-16 02:40:27 -07:00
Vasek Mlejnsky b991520714 Update README.md 2024-10-16 02:38:53 -07:00
Tomas Valenta 193b727dc9 Update example in docstrings 2024-10-16 02:21:03 -07:00
Jakub Novak d60ea0f6fb Add possibiliy to filter out logs based on loggers 2024-10-16 01:41:42 -07:00
Jakub Novak 370b2b3fce Simplify example 2024-10-16 01:41:40 -07:00
Tomas Valenta c688b267b4 Update sync Python docstrings 2024-10-16 01:31:03 -07:00
Tomas Valenta 480aec5ea0 Merge branch 'beta' of https://github.com/e2b-dev/E2B into beta 2024-10-16 00:52:39 -07:00
Tomas Valenta 95baca5d1b Update async Python docstrings 2024-10-16 00:52:13 -07:00
Jakub Novak 65df898277 Fix env variables precedence 2024-10-16 00:40:04 -07:00
Jakub Novak 8aec5fb870 Don't filter out loggers by default 2024-10-15 23:31:43 -07:00
Tomas Valenta ce68e3451c Update JS SDK docstrings 2024-10-15 23:10:19 -07:00
Tomas Valenta ce4e063469 Fix exception handling in CLI 2024-10-15 22:58:55 -07:00
Tomas Valenta 1cc3dbe7d0 Change default image for template init 2024-10-15 22:24:58 -07:00
Tomas Valenta 16dab9296b Fix default values formatting 2024-10-15 17:13:48 -07:00
Tomas Valenta a60239eb39 Merge branch 'beta' of https://github.com/e2b-dev/E2B into beta 2024-10-15 17:00:32 -07:00
Tomas Valenta 7a3dd7c632 Update JS SDK docstrings 2024-10-15 17:00:22 -07:00
Tereza Tizkova c682d94bc8 Update readmes 2024-10-15 16:40:07 -07:00
Jakub Novak a09af0d132 Fix Ctrl+C in CLI connect 2024-10-15 16:07:33 -07:00
Jakub Novak c003af795f Revert python version 2024-10-15 14:53:07 -07:00
Jakub Novak 707b518872 Setup release pipeline to generate api ref 2024-10-15 10:17:45 -07:00
Jakub Novak 291c1fb241 Clean up 2024-10-15 08:35:06 -07:00
Jakub Novak d8c609d208 Revert pnpm lock 2024-10-15 08:26:25 -07:00
github-actions[bot] ece6346bf7 [skip ci] Release new versions 2024-10-15 15:12:26 +00:00
Jakub Novak 0c8674abc5 Update min supported version of python to 3.9 2024-10-15 08:06:43 -07:00
github-actions[bot] 47a559b729 [skip ci] Release new versions 2024-10-15 14:40:37 +00:00
Jakub Novak 38db22d573 Fix issue with poetry 2024-10-15 07:30:24 -07:00
Jakub Novak 9ef205c2eb Merge pipelines 2024-10-15 07:24:51 -07:00
Jakub Novak e500af6eb3 Bump version 2024-10-15 07:03:58 -07:00
Jakub Novak bcea20f7bc Start tests with python 2024-10-14 23:11:51 -07:00
Jakub Novak 3844442bf1 Bump version 2024-10-14 23:05:33 -07:00
Jakub Novak c8b5d029f2 Fix browser test 2024-10-14 22:53:20 -07:00
Jakub Novak 0f292860b1 Remove protobuf runtime checks 2024-10-14 21:38:14 -07:00
Jakub Novak 23ea4adfb1 Rename rpc methods for watcher 2024-10-14 19:51:05 -07:00
Tomas Valenta ad2391482d Fix readme grammar 2024-10-14 16:59:29 -07:00
Tomas Valenta fb919b1ab9 Update CLI readme 2024-10-14 16:56:29 -07:00
Tomas Valenta 71ec17530e Fix CLI code snippets 2024-10-14 16:28:29 -07:00
Tereza Tizkova a668b3978a Merge branch 'beta' of https://github.com/e2b-dev/E2B into beta 2024-10-14 14:10:20 -07:00
Tereza Tizkova b5a6f4958e Update readme 2024-10-14 14:10:13 -07:00
Jakub Novák e48574f69c Improve file watcher in Python Sync SDK (#457)
# Description

Current solution didn't work well with in sync Python. If you're unsure
whether a file has been created, you might end up waiting for a timeout
to exit the loop.

New implementation uses polling, you can ask for events whenever you
want and it will request envd to send all events (or only new ones).
This should make it much better for users with sync Python SDK

Example of a problematic usage before and after:
## Before
```python
sbx = Sandbox()
watcher = sbx.files.watch("/home/user")
sbx.files.make_dir("test")
for event in watcher:
    print(event)
     # !!! if you don't exit, you would be stuck for the rest of the timeout (default 60 seconds)
    break
watcher.close()
```
## After
```python
sbx = Sandbox()
watcher = sbx.files.watch("/home/user")
sbx.files.make_dir("test")
events = watcher.get_new_events()
watcher.stop()
for event in events:
    print(event)
```

Even worse case was if you don't know if anything will happen:
## Before
```python
sbx = Sandbox()
watcher = sbx.files.watch("/home/user")
if random.random() > 0.5:
    sbx.files.make_dir("test")
# There's 50% chance you will get stuck. The only workaround is to run in in separate thread and you kill it after a while (you aren't really sure when it's safe)
for event in watcher:
    print(event)
    #  !!! if you don't exit, you would be stuck for the rest of the timeout (default 60 seconds)
    break
watcher.close()
```
## After
```python
sbx = Sandbox()
watcher = sbx.files.watch("/home/user")
if random.random() > 0.5:
    sbx.files.make_dir("test")
events = watcher.get_new_events()
watcher.stop()
for event in events:
    print(event)
```
2024-10-14 23:09:53 +02:00
Jakub Novak bfc4bb51d8 Rename watch to watch dir 2024-10-14 14:01:34 -07:00
Jakub Novak 6e926ecb13 Remove timeout from sync watch dir 2024-10-14 13:40:08 -07:00
Jakub Novak bc42ba1e66 Refactor watch dir 2024-10-14 13:01:59 -07:00
Jakub Novak 5c31902cc4 Change close to stop for watch dir 2024-10-14 12:10:17 -07:00
Jakub Novak 5de5385533 Update the python sdk to match the new spec 2024-10-14 12:10:04 -07:00
Jakub Novak f9978611f3 Regenerate rpc client 2024-10-14 11:30:02 -07:00
Tereza Tizkova 315c264ecd Update SDK readme 2024-10-12 20:49:33 -07:00
Tereza Tizkova 1b8957118f Update E2B CLI readme 2024-10-12 20:42:04 -07:00