Skip to content

Commit a525d26

Browse files
chore(internal): codegen related update (#106)
1 parent e488d62 commit a525d26

File tree

10 files changed

+35
-23
lines changed

10 files changed

+35
-23
lines changed

Diff for: pyproject.toml

+1
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ testpaths = ["tests"]
129129
addopts = "--tb=short"
130130
xfail_strict = true
131131
asyncio_mode = "auto"
132+
asyncio_default_fixture_loop_scope = "session"
132133
filterwarnings = [
133134
"error"
134135
]

Diff for: src/browserbase/resources/contexts.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class ContextsResource(SyncAPIResource):
3030
@cached_property
3131
def with_raw_response(self) -> ContextsResourceWithRawResponse:
3232
"""
33-
This property can be used as a prefix for any HTTP method call to return the
33+
This property can be used as a prefix for any HTTP method call to return
3434
the raw response object instead of the parsed content.
3535
3636
For more information, see https://www.github.com/browserbase/sdk-python#accessing-raw-response-data-eg-headers
@@ -153,7 +153,7 @@ class AsyncContextsResource(AsyncAPIResource):
153153
@cached_property
154154
def with_raw_response(self) -> AsyncContextsResourceWithRawResponse:
155155
"""
156-
This property can be used as a prefix for any HTTP method call to return the
156+
This property can be used as a prefix for any HTTP method call to return
157157
the raw response object instead of the parsed content.
158158
159159
For more information, see https://www.github.com/browserbase/sdk-python#accessing-raw-response-data-eg-headers

Diff for: src/browserbase/resources/extensions.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class ExtensionsResource(SyncAPIResource):
3232
@cached_property
3333
def with_raw_response(self) -> ExtensionsResourceWithRawResponse:
3434
"""
35-
This property can be used as a prefix for any HTTP method call to return the
35+
This property can be used as a prefix for any HTTP method call to return
3636
the raw response object instead of the parsed content.
3737
3838
For more information, see https://www.github.com/browserbase/sdk-python#accessing-raw-response-data-eg-headers
@@ -159,7 +159,7 @@ class AsyncExtensionsResource(AsyncAPIResource):
159159
@cached_property
160160
def with_raw_response(self) -> AsyncExtensionsResourceWithRawResponse:
161161
"""
162-
This property can be used as a prefix for any HTTP method call to return the
162+
This property can be used as a prefix for any HTTP method call to return
163163
the raw response object instead of the parsed content.
164164
165165
For more information, see https://www.github.com/browserbase/sdk-python#accessing-raw-response-data-eg-headers

Diff for: src/browserbase/resources/projects.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class ProjectsResource(SyncAPIResource):
2525
@cached_property
2626
def with_raw_response(self) -> ProjectsResourceWithRawResponse:
2727
"""
28-
This property can be used as a prefix for any HTTP method call to return the
28+
This property can be used as a prefix for any HTTP method call to return
2929
the raw response object instead of the parsed content.
3030
3131
For more information, see https://www.github.com/browserbase/sdk-python#accessing-raw-response-data-eg-headers
@@ -131,7 +131,7 @@ class AsyncProjectsResource(AsyncAPIResource):
131131
@cached_property
132132
def with_raw_response(self) -> AsyncProjectsResourceWithRawResponse:
133133
"""
134-
This property can be used as a prefix for any HTTP method call to return the
134+
This property can be used as a prefix for any HTTP method call to return
135135
the raw response object instead of the parsed content.
136136
137137
For more information, see https://www.github.com/browserbase/sdk-python#accessing-raw-response-data-eg-headers

Diff for: src/browserbase/resources/sessions/downloads.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class DownloadsResource(SyncAPIResource):
2626
@cached_property
2727
def with_raw_response(self) -> DownloadsResourceWithRawResponse:
2828
"""
29-
This property can be used as a prefix for any HTTP method call to return the
29+
This property can be used as a prefix for any HTTP method call to return
3030
the raw response object instead of the parsed content.
3131
3232
For more information, see https://www.github.com/browserbase/sdk-python#accessing-raw-response-data-eg-headers
@@ -81,7 +81,7 @@ class AsyncDownloadsResource(AsyncAPIResource):
8181
@cached_property
8282
def with_raw_response(self) -> AsyncDownloadsResourceWithRawResponse:
8383
"""
84-
This property can be used as a prefix for any HTTP method call to return the
84+
This property can be used as a prefix for any HTTP method call to return
8585
the raw response object instead of the parsed content.
8686
8787
For more information, see https://www.github.com/browserbase/sdk-python#accessing-raw-response-data-eg-headers

Diff for: src/browserbase/resources/sessions/logs.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class LogsResource(SyncAPIResource):
2323
@cached_property
2424
def with_raw_response(self) -> LogsResourceWithRawResponse:
2525
"""
26-
This property can be used as a prefix for any HTTP method call to return the
26+
This property can be used as a prefix for any HTTP method call to return
2727
the raw response object instead of the parsed content.
2828
2929
For more information, see https://www.github.com/browserbase/sdk-python#accessing-raw-response-data-eg-headers
@@ -77,7 +77,7 @@ class AsyncLogsResource(AsyncAPIResource):
7777
@cached_property
7878
def with_raw_response(self) -> AsyncLogsResourceWithRawResponse:
7979
"""
80-
This property can be used as a prefix for any HTTP method call to return the
80+
This property can be used as a prefix for any HTTP method call to return
8181
the raw response object instead of the parsed content.
8282
8383
For more information, see https://www.github.com/browserbase/sdk-python#accessing-raw-response-data-eg-headers

Diff for: src/browserbase/resources/sessions/recording.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class RecordingResource(SyncAPIResource):
2323
@cached_property
2424
def with_raw_response(self) -> RecordingResourceWithRawResponse:
2525
"""
26-
This property can be used as a prefix for any HTTP method call to return the
26+
This property can be used as a prefix for any HTTP method call to return
2727
the raw response object instead of the parsed content.
2828
2929
For more information, see https://www.github.com/browserbase/sdk-python#accessing-raw-response-data-eg-headers
@@ -77,7 +77,7 @@ class AsyncRecordingResource(AsyncAPIResource):
7777
@cached_property
7878
def with_raw_response(self) -> AsyncRecordingResourceWithRawResponse:
7979
"""
80-
This property can be used as a prefix for any HTTP method call to return the
80+
This property can be used as a prefix for any HTTP method call to return
8181
the raw response object instead of the parsed content.
8282
8383
For more information, see https://www.github.com/browserbase/sdk-python#accessing-raw-response-data-eg-headers

Diff for: src/browserbase/resources/sessions/sessions.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ def uploads(self) -> UploadsResource:
8282
@cached_property
8383
def with_raw_response(self) -> SessionsResourceWithRawResponse:
8484
"""
85-
This property can be used as a prefix for any HTTP method call to return the
85+
This property can be used as a prefix for any HTTP method call to return
8686
the raw response object instead of the parsed content.
8787
8888
For more information, see https://www.github.com/browserbase/sdk-python#accessing-raw-response-data-eg-headers
@@ -347,7 +347,7 @@ def uploads(self) -> AsyncUploadsResource:
347347
@cached_property
348348
def with_raw_response(self) -> AsyncSessionsResourceWithRawResponse:
349349
"""
350-
This property can be used as a prefix for any HTTP method call to return the
350+
This property can be used as a prefix for any HTTP method call to return
351351
the raw response object instead of the parsed content.
352352
353353
For more information, see https://www.github.com/browserbase/sdk-python#accessing-raw-response-data-eg-headers

Diff for: src/browserbase/resources/sessions/uploads.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class UploadsResource(SyncAPIResource):
3232
@cached_property
3333
def with_raw_response(self) -> UploadsResourceWithRawResponse:
3434
"""
35-
This property can be used as a prefix for any HTTP method call to return the
35+
This property can be used as a prefix for any HTTP method call to return
3636
the raw response object instead of the parsed content.
3737
3838
For more information, see https://www.github.com/browserbase/sdk-python#accessing-raw-response-data-eg-headers
@@ -95,7 +95,7 @@ class AsyncUploadsResource(AsyncAPIResource):
9595
@cached_property
9696
def with_raw_response(self) -> AsyncUploadsResourceWithRawResponse:
9797
"""
98-
This property can be used as a prefix for any HTTP method call to return the
98+
This property can be used as a prefix for any HTTP method call to return
9999
the raw response object instead of the parsed content.
100100
101101
For more information, see https://www.github.com/browserbase/sdk-python#accessing-raw-response-data-eg-headers

Diff for: tests/test_client.py

+18-7
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import os
77
import sys
88
import json
9+
import time
910
import asyncio
1011
import inspect
1112
import subprocess
@@ -1639,10 +1640,20 @@ async def test_main() -> None:
16391640
[sys.executable, "-c", test_code],
16401641
text=True,
16411642
) as process:
1642-
try:
1643-
process.wait(2)
1644-
if process.returncode:
1645-
raise AssertionError("calling get_platform using asyncify resulted in a non-zero exit code")
1646-
except subprocess.TimeoutExpired as e:
1647-
process.kill()
1648-
raise AssertionError("calling get_platform using asyncify resulted in a hung process") from e
1643+
timeout = 10 # seconds
1644+
1645+
start_time = time.monotonic()
1646+
while True:
1647+
return_code = process.poll()
1648+
if return_code is not None:
1649+
if return_code != 0:
1650+
raise AssertionError("calling get_platform using asyncify resulted in a non-zero exit code")
1651+
1652+
# success
1653+
break
1654+
1655+
if time.monotonic() - start_time > timeout:
1656+
process.kill()
1657+
raise AssertionError("calling get_platform using asyncify resulted in a hung process")
1658+
1659+
time.sleep(0.1)

0 commit comments

Comments
 (0)