runwayml 2.1.11__tar.gz → 2.2.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- runwayml-2.2.1/.release-please-manifest.json +3 -0
- {runwayml-2.1.11 → runwayml-2.2.1}/CHANGELOG.md +17 -0
- {runwayml-2.1.11 → runwayml-2.2.1}/PKG-INFO +1 -1
- {runwayml-2.1.11 → runwayml-2.2.1}/pyproject.toml +1 -1
- {runwayml-2.1.11 → runwayml-2.2.1}/src/runwayml/_base_client.py +9 -2
- {runwayml-2.1.11 → runwayml-2.2.1}/src/runwayml/_models.py +7 -1
- {runwayml-2.1.11 → runwayml-2.2.1}/src/runwayml/_utils/_transform.py +11 -1
- {runwayml-2.1.11 → runwayml-2.2.1}/src/runwayml/_version.py +1 -1
- {runwayml-2.1.11 → runwayml-2.2.1}/tests/test_transform.py +10 -1
- runwayml-2.1.11/.release-please-manifest.json +0 -3
- {runwayml-2.1.11 → runwayml-2.2.1}/.gitignore +0 -0
- {runwayml-2.1.11 → runwayml-2.2.1}/CONTRIBUTING.md +0 -0
- {runwayml-2.1.11 → runwayml-2.2.1}/LICENSE +0 -0
- {runwayml-2.1.11 → runwayml-2.2.1}/README.md +0 -0
- {runwayml-2.1.11 → runwayml-2.2.1}/SECURITY.md +0 -0
- {runwayml-2.1.11 → runwayml-2.2.1}/api.md +0 -0
- {runwayml-2.1.11 → runwayml-2.2.1}/bin/check-release-environment +0 -0
- {runwayml-2.1.11 → runwayml-2.2.1}/bin/publish-pypi +0 -0
- {runwayml-2.1.11 → runwayml-2.2.1}/examples/.keep +0 -0
- {runwayml-2.1.11 → runwayml-2.2.1}/mypy.ini +0 -0
- {runwayml-2.1.11 → runwayml-2.2.1}/noxfile.py +0 -0
- {runwayml-2.1.11 → runwayml-2.2.1}/release-please-config.json +0 -0
- {runwayml-2.1.11 → runwayml-2.2.1}/requirements-dev.lock +0 -0
- {runwayml-2.1.11 → runwayml-2.2.1}/requirements.lock +0 -0
- {runwayml-2.1.11 → runwayml-2.2.1}/src/runwayml/__init__.py +0 -0
- {runwayml-2.1.11 → runwayml-2.2.1}/src/runwayml/_client.py +0 -0
- {runwayml-2.1.11 → runwayml-2.2.1}/src/runwayml/_compat.py +0 -0
- {runwayml-2.1.11 → runwayml-2.2.1}/src/runwayml/_constants.py +0 -0
- {runwayml-2.1.11 → runwayml-2.2.1}/src/runwayml/_exceptions.py +0 -0
- {runwayml-2.1.11 → runwayml-2.2.1}/src/runwayml/_files.py +0 -0
- {runwayml-2.1.11 → runwayml-2.2.1}/src/runwayml/_qs.py +0 -0
- {runwayml-2.1.11 → runwayml-2.2.1}/src/runwayml/_resource.py +0 -0
- {runwayml-2.1.11 → runwayml-2.2.1}/src/runwayml/_response.py +0 -0
- {runwayml-2.1.11 → runwayml-2.2.1}/src/runwayml/_streaming.py +0 -0
- {runwayml-2.1.11 → runwayml-2.2.1}/src/runwayml/_types.py +0 -0
- {runwayml-2.1.11 → runwayml-2.2.1}/src/runwayml/_utils/__init__.py +0 -0
- {runwayml-2.1.11 → runwayml-2.2.1}/src/runwayml/_utils/_logs.py +0 -0
- {runwayml-2.1.11 → runwayml-2.2.1}/src/runwayml/_utils/_proxy.py +0 -0
- {runwayml-2.1.11 → runwayml-2.2.1}/src/runwayml/_utils/_reflection.py +0 -0
- {runwayml-2.1.11 → runwayml-2.2.1}/src/runwayml/_utils/_streams.py +0 -0
- {runwayml-2.1.11 → runwayml-2.2.1}/src/runwayml/_utils/_sync.py +0 -0
- {runwayml-2.1.11 → runwayml-2.2.1}/src/runwayml/_utils/_typing.py +0 -0
- {runwayml-2.1.11 → runwayml-2.2.1}/src/runwayml/_utils/_utils.py +0 -0
- {runwayml-2.1.11 → runwayml-2.2.1}/src/runwayml/lib/.keep +0 -0
- {runwayml-2.1.11 → runwayml-2.2.1}/src/runwayml/py.typed +0 -0
- {runwayml-2.1.11 → runwayml-2.2.1}/src/runwayml/resources/__init__.py +0 -0
- {runwayml-2.1.11 → runwayml-2.2.1}/src/runwayml/resources/image_to_video.py +0 -0
- {runwayml-2.1.11 → runwayml-2.2.1}/src/runwayml/resources/tasks.py +0 -0
- {runwayml-2.1.11 → runwayml-2.2.1}/src/runwayml/types/__init__.py +0 -0
- {runwayml-2.1.11 → runwayml-2.2.1}/src/runwayml/types/image_to_video_create_params.py +0 -0
- {runwayml-2.1.11 → runwayml-2.2.1}/src/runwayml/types/image_to_video_create_response.py +0 -0
- {runwayml-2.1.11 → runwayml-2.2.1}/src/runwayml/types/task_retrieve_response.py +0 -0
- {runwayml-2.1.11 → runwayml-2.2.1}/tests/__init__.py +0 -0
- {runwayml-2.1.11 → runwayml-2.2.1}/tests/api_resources/__init__.py +0 -0
- {runwayml-2.1.11 → runwayml-2.2.1}/tests/api_resources/test_image_to_video.py +0 -0
- {runwayml-2.1.11 → runwayml-2.2.1}/tests/api_resources/test_tasks.py +0 -0
- {runwayml-2.1.11 → runwayml-2.2.1}/tests/conftest.py +0 -0
- {runwayml-2.1.11 → runwayml-2.2.1}/tests/sample_file.txt +0 -0
- {runwayml-2.1.11 → runwayml-2.2.1}/tests/test_client.py +0 -0
- {runwayml-2.1.11 → runwayml-2.2.1}/tests/test_deepcopy.py +0 -0
- {runwayml-2.1.11 → runwayml-2.2.1}/tests/test_extract_files.py +0 -0
- {runwayml-2.1.11 → runwayml-2.2.1}/tests/test_files.py +0 -0
- {runwayml-2.1.11 → runwayml-2.2.1}/tests/test_models.py +0 -0
- {runwayml-2.1.11 → runwayml-2.2.1}/tests/test_qs.py +0 -0
- {runwayml-2.1.11 → runwayml-2.2.1}/tests/test_required_args.py +0 -0
- {runwayml-2.1.11 → runwayml-2.2.1}/tests/test_response.py +0 -0
- {runwayml-2.1.11 → runwayml-2.2.1}/tests/test_streaming.py +0 -0
- {runwayml-2.1.11 → runwayml-2.2.1}/tests/test_utils/test_proxy.py +0 -0
- {runwayml-2.1.11 → runwayml-2.2.1}/tests/test_utils/test_typing.py +0 -0
- {runwayml-2.1.11 → runwayml-2.2.1}/tests/utils.py +0 -0
@@ -1,5 +1,22 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## 2.2.1 (2025-02-07)
|
4
|
+
|
5
|
+
Full Changelog: [v2.2.0...v2.2.1](https://github.com/runwayml/sdk-python/compare/v2.2.0...v2.2.1)
|
6
|
+
|
7
|
+
### Chores
|
8
|
+
|
9
|
+
* **internal:** fix type traversing dictionary params ([#90](https://github.com/runwayml/sdk-python/issues/90)) ([49d44b9](https://github.com/runwayml/sdk-python/commit/49d44b9b3f234f9aa5c69e3694f1774a8a0a4581))
|
10
|
+
* **internal:** minor type handling changes ([#92](https://github.com/runwayml/sdk-python/issues/92)) ([f4f122f](https://github.com/runwayml/sdk-python/commit/f4f122f97e7bd10d51250bdcca67f55cb8a76e4a))
|
11
|
+
|
12
|
+
## 2.2.0 (2025-02-06)
|
13
|
+
|
14
|
+
Full Changelog: [v2.1.11...v2.2.0](https://github.com/runwayml/sdk-python/compare/v2.1.11...v2.2.0)
|
15
|
+
|
16
|
+
### Features
|
17
|
+
|
18
|
+
* **client:** send `X-Stainless-Read-Timeout` header ([#87](https://github.com/runwayml/sdk-python/issues/87)) ([43e6f00](https://github.com/runwayml/sdk-python/commit/43e6f005f611ddc87a11d4f7244c883a25a5c8ed))
|
19
|
+
|
3
20
|
## 2.1.11 (2025-02-04)
|
4
21
|
|
5
22
|
Full Changelog: [v2.1.10...v2.1.11](https://github.com/runwayml/sdk-python/compare/v2.1.10...v2.1.11)
|
@@ -418,10 +418,17 @@ class BaseClient(Generic[_HttpxClientT, _DefaultStreamT]):
|
|
418
418
|
if idempotency_header and options.method.lower() != "get" and idempotency_header not in headers:
|
419
419
|
headers[idempotency_header] = options.idempotency_key or self._idempotency_key()
|
420
420
|
|
421
|
-
# Don't set
|
421
|
+
# Don't set these headers if they were already set or removed by the caller. We check
|
422
422
|
# `custom_headers`, which can contain `Omit()`, instead of `headers` to account for the removal case.
|
423
|
-
|
423
|
+
lower_custom_headers = [header.lower() for header in custom_headers]
|
424
|
+
if "x-stainless-retry-count" not in lower_custom_headers:
|
424
425
|
headers["x-stainless-retry-count"] = str(retries_taken)
|
426
|
+
if "x-stainless-read-timeout" not in lower_custom_headers:
|
427
|
+
timeout = self.timeout if isinstance(options.timeout, NotGiven) else options.timeout
|
428
|
+
if isinstance(timeout, Timeout):
|
429
|
+
timeout = timeout.read
|
430
|
+
if timeout is not None:
|
431
|
+
headers["x-stainless-read-timeout"] = str(timeout)
|
425
432
|
|
426
433
|
return headers
|
427
434
|
|
@@ -426,10 +426,16 @@ def construct_type(*, value: object, type_: object) -> object:
|
|
426
426
|
|
427
427
|
If the given value does not match the expected type then it is returned as-is.
|
428
428
|
"""
|
429
|
+
|
430
|
+
# store a reference to the original type we were given before we extract any inner
|
431
|
+
# types so that we can properly resolve forward references in `TypeAliasType` annotations
|
432
|
+
original_type = None
|
433
|
+
|
429
434
|
# we allow `object` as the input type because otherwise, passing things like
|
430
435
|
# `Literal['value']` will be reported as a type error by type checkers
|
431
436
|
type_ = cast("type[object]", type_)
|
432
437
|
if is_type_alias_type(type_):
|
438
|
+
original_type = type_ # type: ignore[unreachable]
|
433
439
|
type_ = type_.__value__ # type: ignore[unreachable]
|
434
440
|
|
435
441
|
# unwrap `Annotated[T, ...]` -> `T`
|
@@ -446,7 +452,7 @@ def construct_type(*, value: object, type_: object) -> object:
|
|
446
452
|
|
447
453
|
if is_union(origin):
|
448
454
|
try:
|
449
|
-
return validate_type(type_=cast("type[object]", type_), value=value)
|
455
|
+
return validate_type(type_=cast("type[object]", original_type or type_), value=value)
|
450
456
|
except Exception:
|
451
457
|
pass
|
452
458
|
|
@@ -25,7 +25,7 @@ from ._typing import (
|
|
25
25
|
is_annotated_type,
|
26
26
|
strip_annotated_type,
|
27
27
|
)
|
28
|
-
from .._compat import model_dump, is_typeddict
|
28
|
+
from .._compat import get_origin, model_dump, is_typeddict
|
29
29
|
|
30
30
|
_T = TypeVar("_T")
|
31
31
|
|
@@ -164,9 +164,14 @@ def _transform_recursive(
|
|
164
164
|
inner_type = annotation
|
165
165
|
|
166
166
|
stripped_type = strip_annotated_type(inner_type)
|
167
|
+
origin = get_origin(stripped_type) or stripped_type
|
167
168
|
if is_typeddict(stripped_type) and is_mapping(data):
|
168
169
|
return _transform_typeddict(data, stripped_type)
|
169
170
|
|
171
|
+
if origin == dict and is_mapping(data):
|
172
|
+
items_type = get_args(stripped_type)[1]
|
173
|
+
return {key: _transform_recursive(value, annotation=items_type) for key, value in data.items()}
|
174
|
+
|
170
175
|
if (
|
171
176
|
# List[T]
|
172
177
|
(is_list_type(stripped_type) and is_list(data))
|
@@ -307,9 +312,14 @@ async def _async_transform_recursive(
|
|
307
312
|
inner_type = annotation
|
308
313
|
|
309
314
|
stripped_type = strip_annotated_type(inner_type)
|
315
|
+
origin = get_origin(stripped_type) or stripped_type
|
310
316
|
if is_typeddict(stripped_type) and is_mapping(data):
|
311
317
|
return await _async_transform_typeddict(data, stripped_type)
|
312
318
|
|
319
|
+
if origin == dict and is_mapping(data):
|
320
|
+
items_type = get_args(stripped_type)[1]
|
321
|
+
return {key: _transform_recursive(value, annotation=items_type) for key, value in data.items()}
|
322
|
+
|
313
323
|
if (
|
314
324
|
# List[T]
|
315
325
|
(is_list_type(stripped_type) and is_list(data))
|
@@ -2,7 +2,7 @@ from __future__ import annotations
|
|
2
2
|
|
3
3
|
import io
|
4
4
|
import pathlib
|
5
|
-
from typing import Any, List, Union, TypeVar, Iterable, Optional, cast
|
5
|
+
from typing import Any, Dict, List, Union, TypeVar, Iterable, Optional, cast
|
6
6
|
from datetime import date, datetime
|
7
7
|
from typing_extensions import Required, Annotated, TypedDict
|
8
8
|
|
@@ -388,6 +388,15 @@ async def test_iterable_of_dictionaries(use_async: bool) -> None:
|
|
388
388
|
}
|
389
389
|
|
390
390
|
|
391
|
+
@parametrize
|
392
|
+
@pytest.mark.asyncio
|
393
|
+
async def test_dictionary_items(use_async: bool) -> None:
|
394
|
+
class DictItems(TypedDict):
|
395
|
+
foo_baz: Annotated[str, PropertyInfo(alias="fooBaz")]
|
396
|
+
|
397
|
+
assert await transform({"foo": {"foo_baz": "bar"}}, Dict[str, DictItems], use_async) == {"foo": {"fooBaz": "bar"}}
|
398
|
+
|
399
|
+
|
391
400
|
class TypedDictIterableUnionStr(TypedDict):
|
392
401
|
foo: Annotated[Union[str, Iterable[Baz8]], PropertyInfo(alias="FOO")]
|
393
402
|
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|