Skip to content

release: 3.0.2 #137

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "3.0.1"
".": "3.0.2"
}
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Changelog

## 3.0.2 (2025-04-17)

Full Changelog: [v3.0.1...v3.0.2](https://github.com/runwayml/sdk-python/compare/v3.0.1...v3.0.2)

### Chores

* **internal:** base client updates ([6d4d8bb](https://github.com/runwayml/sdk-python/commit/6d4d8bb73df9c0985d12d349d783188de0cd7d7d))
* **internal:** bump pyright version ([5693e26](https://github.com/runwayml/sdk-python/commit/5693e261dcbc21f6a900c514ba8e6659e0a2cd4f))

## 3.0.1 (2025-04-15)

Full Changelog: [v3.0.0...v3.0.1](https://github.com/runwayml/sdk-python/compare/v3.0.0...v3.0.1)
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "runwayml"
version = "3.0.1"
version = "3.0.2"
description = "The official Python library for the runwayml API"
dynamic = ["readme"]
license = "Apache-2.0"
Expand Down Expand Up @@ -42,7 +42,7 @@ Repository = "https://github.com/runwayml/sdk-python"
managed = true
# version pins are in requirements-dev.lock
dev-dependencies = [
"pyright>=1.1.359",
"pyright==1.1.399",
"mypy",
"respx",
"pytest",
Expand Down
2 changes: 1 addition & 1 deletion requirements-dev.lock
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ pydantic-core==2.27.1
# via pydantic
pygments==2.18.0
# via rich
pyright==1.1.392.post0
pyright==1.1.399
pytest==8.3.3
# via pytest-asyncio
pytest-asyncio==0.24.0
Expand Down
31 changes: 30 additions & 1 deletion src/runwayml/_base_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,11 @@
_AsyncStreamT = TypeVar("_AsyncStreamT", bound=AsyncStream[Any])

if TYPE_CHECKING:
from httpx._config import DEFAULT_TIMEOUT_CONFIG as HTTPX_DEFAULT_TIMEOUT
from httpx._config import (
DEFAULT_TIMEOUT_CONFIG, # pyright: ignore[reportPrivateImportUsage]
)

HTTPX_DEFAULT_TIMEOUT = DEFAULT_TIMEOUT_CONFIG
else:
try:
from httpx._config import DEFAULT_TIMEOUT_CONFIG as HTTPX_DEFAULT_TIMEOUT
Expand All @@ -115,6 +119,7 @@ class PageInfo:

url: URL | NotGiven
params: Query | NotGiven
json: Body | NotGiven

@overload
def __init__(
Expand All @@ -130,19 +135,30 @@ def __init__(
params: Query,
) -> None: ...

@overload
def __init__(
self,
*,
json: Body,
) -> None: ...

def __init__(
self,
*,
url: URL | NotGiven = NOT_GIVEN,
json: Body | NotGiven = NOT_GIVEN,
params: Query | NotGiven = NOT_GIVEN,
) -> None:
self.url = url
self.json = json
self.params = params

@override
def __repr__(self) -> str:
if self.url:
return f"{self.__class__.__name__}(url={self.url})"
if self.json:
return f"{self.__class__.__name__}(json={self.json})"
return f"{self.__class__.__name__}(params={self.params})"


Expand Down Expand Up @@ -191,6 +207,19 @@ def _info_to_options(self, info: PageInfo) -> FinalRequestOptions:
options.url = str(url)
return options

if not isinstance(info.json, NotGiven):
if not is_mapping(info.json):
raise TypeError("Pagination is only supported with mappings")

if not options.json_data:
options.json_data = {**info.json}
else:
if not is_mapping(options.json_data):
raise TypeError("Pagination is only supported with mappings")

options.json_data = {**options.json_data, **info.json}
return options

raise ValueError("Unexpected PageInfo state")


Expand Down
1 change: 0 additions & 1 deletion src/runwayml/_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
)

import pydantic
import pydantic.generics
from pydantic.fields import FieldInfo

from ._types import (
Expand Down
2 changes: 1 addition & 1 deletion src/runwayml/_utils/_typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ class MyResponse(Foo[_T]):
```
"""
cls = cast(object, get_origin(typ) or typ)
if cls in generic_bases:
if cls in generic_bases: # pyright: ignore[reportUnnecessaryContains]
# we're given the class directly
return extract_type_arg(typ, index)

Expand Down
2 changes: 1 addition & 1 deletion src/runwayml/_version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

__title__ = "runwayml"
__version__ = "3.0.1" # x-release-please-version
__version__ = "3.0.2" # x-release-please-version
2 changes: 1 addition & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from runwayml import RunwayML, AsyncRunwayML

if TYPE_CHECKING:
from _pytest.fixtures import FixtureRequest
from _pytest.fixtures import FixtureRequest # pyright: ignore[reportPrivateImportUsage]

pytest.register_assert_rewrite("tests.utils")

Expand Down
2 changes: 1 addition & 1 deletion tests/test_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -832,7 +832,7 @@ class B(BaseModel):

@pytest.mark.skipif(not PYDANTIC_V2, reason="TypeAliasType is not supported in Pydantic v1")
def test_type_alias_type() -> None:
Alias = TypeAliasType("Alias", str)
Alias = TypeAliasType("Alias", str) # pyright: ignore

class Model(BaseModel):
alias: Alias
Expand Down