Commit Graph

585 Commits

Author SHA1 Message Date
0div bff11dc02e add the same fixes to python async 2024-12-11 17:29:46 -08:00
0div 3c525220d9 make stdout and stderr decode handle errors by replacing with unicode replacement char; add tests 2024-12-11 17:07:36 -08:00
github-actions[bot] e8fa4be096 [skip ci] Release new versions 2024-12-06 04:41:39 +00:00
Jakub Novak 7999815887 Update httpx version in dependencies 2024-12-05 20:30:39 -08:00
0div 9350971f34 move gen sdk workflow into publish package workflow 2024-11-27 16:36:11 -08:00
0div 8fe82fa6c5 Merge branch 'main' of https://github.com/e2b-dev/E2B into improved-api-refs 2024-11-27 10:45:08 -08:00
github-actions[bot] ff02ae9e98 [skip ci] Release new versions 2024-11-26 19:15:40 +00:00
0div d599ddac32 rebrand to SDK reference 2024-11-26 10:34:04 -08:00
0div 91a1e4e8fa merge master & generate versioned routes for SDK in prebuild 2024-11-25 12:32:05 -08:00
Tomas Valenta eff5ff533d Add missing dependency 2024-11-23 21:58:59 -08:00
0div 1defbc8506 fix typo in legacy docs/READMEs 2024-11-22 14:45:39 -08:00
0div c89f970118 replace h4 as h3 in python-sdk api ref post processor 2024-11-22 14:34:56 -08:00
Jakub Novak ba78ba09d5 Improve READMEs and links to get access token / api key 2024-11-04 10:53:40 -08:00
github-actions[bot] 6332979ff6 [skip ci] Release new versions 2024-11-03 23:55:22 +00:00
Jakub Novak a87098e979 Remove typing-extensions from dependencies, fix version of httpcore + httpx, update poetry lock 2024-11-03 15:48:28 -08:00
Brendan Maginnis d8b5b1acbd Make dependencies more lenient 2024-11-01 09:51:18 +00:00
Tomas Valenta 732a8db0dc Merge branch 'main' of https://github.com/e2b-dev/E2B 2024-10-28 14:11:46 -07:00
Tomas Valenta 497bdc95d9 Fix sandbox killing in tests 2024-10-28 14:11:42 -07:00
github-actions[bot] 1405b6e1f7 [skip ci] Release new versions 2024-10-26 04:52:47 +00:00
Jakub Novak f49a2ea38b Improve texting 2024-10-22 21:57:08 -07:00
Jakub Novak 80f2159cc7 Add rate limit error 2024-10-22 21:41:08 -07:00
Jakub Novak d69317437c Respect the limit from pytest configuration 2024-10-22 13:38:24 -07:00
Tomas Valenta aa302edc96 Change exception descriptions; Add TODO comment 2024-10-21 10:35:54 -07:00
github-actions[bot] edc187e560 [skip ci] Release new versions 2024-10-16 11:35:16 +00:00
Vasek Mlejnsky 33992a6c31 Update README.md 2024-10-16 04:23:38 -07:00
Vasek Mlejnsky f502f52fff Update README.md 2024-10-16 04:11:12 -07:00
github-actions[bot] 21b1374a6e [skip ci] Release new versions 2024-10-16 10:45:54 +00:00
Jakub Novak 98336e92c1 Install dependencies required for API ref generation 2024-10-16 03:41:54 -07:00
Jakub Novak 1ee0f01b09 [skip CI] Release new versions 2024-10-16 03:25:08 -07:00
Vasek Mlejnsky 2be5fb296d Update README.md 2024-10-16 02:44:59 -07:00
Tomas Valenta 193b727dc9 Update example in docstrings 2024-10-16 02:21:03 -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 95baca5d1b Update async Python docstrings 2024-10-16 00:52:13 -07:00
Tereza Tizkova c682d94bc8 Update readmes 2024-10-15 16:40:07 -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
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 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
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