Skip to content

Commit 1b4f8a8

Browse files
chore(internal): codegen related update (#90)
1 parent 6bf0844 commit 1b4f8a8

File tree

8 files changed

+31
-19
lines changed

8 files changed

+31
-19
lines changed

pyproject.toml

Lines changed: 1 addition & 0 deletions
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
]

src/lumaai/resources/credits.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class CreditsResource(SyncAPIResource):
2323
@cached_property
2424
def with_raw_response(self) -> CreditsResourceWithRawResponse:
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/lumalabs/lumaai-python#accessing-raw-response-data-eg-headers
@@ -63,7 +63,7 @@ class AsyncCreditsResource(AsyncAPIResource):
6363
@cached_property
6464
def with_raw_response(self) -> AsyncCreditsResourceWithRawResponse:
6565
"""
66-
This property can be used as a prefix for any HTTP method call to return the
66+
This property can be used as a prefix for any HTTP method call to return
6767
the raw response object instead of the parsed content.
6868
6969
For more information, see https://www.github.com/lumalabs/lumaai-python#accessing-raw-response-data-eg-headers

src/lumaai/resources/generations/camera_motion.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class CameraMotionResource(SyncAPIResource):
2323
@cached_property
2424
def with_raw_response(self) -> CameraMotionResourceWithRawResponse:
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/lumalabs/lumaai-python#accessing-raw-response-data-eg-headers
@@ -63,7 +63,7 @@ class AsyncCameraMotionResource(AsyncAPIResource):
6363
@cached_property
6464
def with_raw_response(self) -> AsyncCameraMotionResourceWithRawResponse:
6565
"""
66-
This property can be used as a prefix for any HTTP method call to return the
66+
This property can be used as a prefix for any HTTP method call to return
6767
the raw response object instead of the parsed content.
6868
6969
For more information, see https://www.github.com/lumalabs/lumaai-python#accessing-raw-response-data-eg-headers

src/lumaai/resources/generations/generations.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ def video(self) -> VideoResource:
6767
@cached_property
6868
def with_raw_response(self) -> GenerationsResourceWithRawResponse:
6969
"""
70-
This property can be used as a prefix for any HTTP method call to return the
70+
This property can be used as a prefix for any HTTP method call to return
7171
the raw response object instead of the parsed content.
7272
7373
For more information, see https://www.github.com/lumalabs/lumaai-python#accessing-raw-response-data-eg-headers
@@ -268,7 +268,7 @@ def video(self) -> AsyncVideoResource:
268268
@cached_property
269269
def with_raw_response(self) -> AsyncGenerationsResourceWithRawResponse:
270270
"""
271-
This property can be used as a prefix for any HTTP method call to return the
271+
This property can be used as a prefix for any HTTP method call to return
272272
the raw response object instead of the parsed content.
273273
274274
For more information, see https://www.github.com/lumalabs/lumaai-python#accessing-raw-response-data-eg-headers

src/lumaai/resources/generations/image.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class ImageResource(SyncAPIResource):
3131
@cached_property
3232
def with_raw_response(self) -> ImageResourceWithRawResponse:
3333
"""
34-
This property can be used as a prefix for any HTTP method call to return the
34+
This property can be used as a prefix for any HTTP method call to return
3535
the raw response object instead of the parsed content.
3636
3737
For more information, see https://www.github.com/lumalabs/lumaai-python#accessing-raw-response-data-eg-headers
@@ -115,7 +115,7 @@ class AsyncImageResource(AsyncAPIResource):
115115
@cached_property
116116
def with_raw_response(self) -> AsyncImageResourceWithRawResponse:
117117
"""
118-
This property can be used as a prefix for any HTTP method call to return the
118+
This property can be used as a prefix for any HTTP method call to return
119119
the raw response object instead of the parsed content.
120120
121121
For more information, see https://www.github.com/lumalabs/lumaai-python#accessing-raw-response-data-eg-headers

src/lumaai/resources/generations/video.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class VideoResource(SyncAPIResource):
3030
@cached_property
3131
def with_raw_response(self) -> VideoResourceWithRawResponse:
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/lumalabs/lumaai-python#accessing-raw-response-data-eg-headers
@@ -110,7 +110,7 @@ class AsyncVideoResource(AsyncAPIResource):
110110
@cached_property
111111
def with_raw_response(self) -> AsyncVideoResourceWithRawResponse:
112112
"""
113-
This property can be used as a prefix for any HTTP method call to return the
113+
This property can be used as a prefix for any HTTP method call to return
114114
the raw response object instead of the parsed content.
115115
116116
For more information, see https://www.github.com/lumalabs/lumaai-python#accessing-raw-response-data-eg-headers

src/lumaai/resources/ping.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class PingResource(SyncAPIResource):
2323
@cached_property
2424
def with_raw_response(self) -> PingResourceWithRawResponse:
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/lumalabs/lumaai-python#accessing-raw-response-data-eg-headers
@@ -63,7 +63,7 @@ class AsyncPingResource(AsyncAPIResource):
6363
@cached_property
6464
def with_raw_response(self) -> AsyncPingResourceWithRawResponse:
6565
"""
66-
This property can be used as a prefix for any HTTP method call to return the
66+
This property can be used as a prefix for any HTTP method call to return
6767
the raw response object instead of the parsed content.
6868
6969
For more information, see https://www.github.com/lumalabs/lumaai-python#accessing-raw-response-data-eg-headers

tests/test_client.py

Lines changed: 18 additions & 7 deletions
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
@@ -1660,10 +1661,20 @@ async def test_main() -> None:
16601661
[sys.executable, "-c", test_code],
16611662
text=True,
16621663
) as process:
1663-
try:
1664-
process.wait(2)
1665-
if process.returncode:
1666-
raise AssertionError("calling get_platform using asyncify resulted in a non-zero exit code")
1667-
except subprocess.TimeoutExpired as e:
1668-
process.kill()
1669-
raise AssertionError("calling get_platform using asyncify resulted in a hung process") from e
1664+
timeout = 10 # seconds
1665+
1666+
start_time = time.monotonic()
1667+
while True:
1668+
return_code = process.poll()
1669+
if return_code is not None:
1670+
if return_code != 0:
1671+
raise AssertionError("calling get_platform using asyncify resulted in a non-zero exit code")
1672+
1673+
# success
1674+
break
1675+
1676+
if time.monotonic() - start_time > timeout:
1677+
process.kill()
1678+
raise AssertionError("calling get_platform using asyncify resulted in a hung process")
1679+
1680+
time.sleep(0.1)

0 commit comments

Comments
 (0)