Skip to content

Commit e8a862d

Browse files
Merge pull request #320 from OneBusAway/release-please--branches--main--changes--next
release: 1.17.2
2 parents 486c42e + f39f06a commit e8a862d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+280
-243
lines changed

.release-please-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "1.17.1"
2+
".": "1.17.2"
33
}

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
# Changelog
22

3+
## 1.17.2 (2025-09-19)
4+
5+
Full Changelog: [v1.17.1...v1.17.2](https://github.com/OneBusAway/python-sdk/compare/v1.17.1...v1.17.2)
6+
7+
### Chores
8+
9+
* **internal:** update pydantic dependency ([c13d52b](https://github.com/OneBusAway/python-sdk/commit/c13d52be2ec7ab0ff9da3f2120792d9ed247881e))
10+
* **types:** change optional parameter type from NotGiven to Omit ([c24d539](https://github.com/OneBusAway/python-sdk/commit/c24d539861b7594e5a88f68de5a422ab0db096e3))
11+
312
## 1.17.1 (2025-09-06)
413

514
Full Changelog: [v1.17.0...v1.17.1](https://github.com/OneBusAway/python-sdk/compare/v1.17.0...v1.17.1)

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "onebusaway"
3-
version = "1.17.1"
3+
version = "1.17.2"
44
description = "The official Python library for the onebusaway-sdk API"
55
dynamic = ["readme"]
66
license = "Apache-2.0"

requirements-dev.lock

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,9 @@ pluggy==1.5.0
8888
propcache==0.3.1
8989
# via aiohttp
9090
# via yarl
91-
pydantic==2.10.3
91+
pydantic==2.11.9
9292
# via onebusaway
93-
pydantic-core==2.27.1
93+
pydantic-core==2.33.2
9494
# via pydantic
9595
pygments==2.18.0
9696
# via rich
@@ -126,6 +126,9 @@ typing-extensions==4.12.2
126126
# via pydantic
127127
# via pydantic-core
128128
# via pyright
129+
# via typing-inspection
130+
typing-inspection==0.4.1
131+
# via pydantic
129132
virtualenv==20.24.5
130133
# via nox
131134
yarl==1.20.0

requirements.lock

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,9 @@ multidict==6.4.4
5555
propcache==0.3.1
5656
# via aiohttp
5757
# via yarl
58-
pydantic==2.10.3
58+
pydantic==2.11.9
5959
# via onebusaway
60-
pydantic-core==2.27.1
60+
pydantic-core==2.33.2
6161
# via pydantic
6262
sniffio==1.3.0
6363
# via anyio
@@ -68,5 +68,8 @@ typing-extensions==4.12.2
6868
# via onebusaway
6969
# via pydantic
7070
# via pydantic-core
71+
# via typing-inspection
72+
typing-inspection==0.4.1
73+
# via pydantic
7174
yarl==1.20.0
7275
# via aiohttp

src/onebusaway/__init__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import typing as _t
44

55
from . import types
6-
from ._types import NOT_GIVEN, Omit, NoneType, NotGiven, Transport, ProxiesTypes
6+
from ._types import NOT_GIVEN, Omit, NoneType, NotGiven, Transport, ProxiesTypes, omit, not_given
77
from ._utils import file_from_path
88
from ._client import (
99
Client,
@@ -48,7 +48,9 @@
4848
"ProxiesTypes",
4949
"NotGiven",
5050
"NOT_GIVEN",
51+
"not_given",
5152
"Omit",
53+
"omit",
5254
"OnebusawaySDKError",
5355
"APIError",
5456
"APIStatusError",

src/onebusaway/_base_client.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@
4242
from ._qs import Querystring
4343
from ._files import to_httpx_files, async_to_httpx_files
4444
from ._types import (
45-
NOT_GIVEN,
4645
Body,
4746
Omit,
4847
Query,
@@ -57,6 +56,7 @@
5756
RequestOptions,
5857
HttpxRequestFiles,
5958
ModelBuilderProtocol,
59+
not_given,
6060
)
6161
from ._utils import is_dict, is_list, asyncify, is_given, lru_cache, is_mapping
6262
from ._compat import PYDANTIC_V1, model_copy, model_dump
@@ -145,9 +145,9 @@ def __init__(
145145
def __init__(
146146
self,
147147
*,
148-
url: URL | NotGiven = NOT_GIVEN,
149-
json: Body | NotGiven = NOT_GIVEN,
150-
params: Query | NotGiven = NOT_GIVEN,
148+
url: URL | NotGiven = not_given,
149+
json: Body | NotGiven = not_given,
150+
params: Query | NotGiven = not_given,
151151
) -> None:
152152
self.url = url
153153
self.json = json
@@ -595,7 +595,7 @@ def _maybe_override_cast_to(self, cast_to: type[ResponseT], options: FinalReques
595595
# we internally support defining a temporary header to override the
596596
# default `cast_to` type for use with `.with_raw_response` and `.with_streaming_response`
597597
# see _response.py for implementation details
598-
override_cast_to = headers.pop(OVERRIDE_CAST_TO_HEADER, NOT_GIVEN)
598+
override_cast_to = headers.pop(OVERRIDE_CAST_TO_HEADER, not_given)
599599
if is_given(override_cast_to):
600600
options.headers = headers
601601
return cast(Type[ResponseT], override_cast_to)
@@ -825,7 +825,7 @@ def __init__(
825825
version: str,
826826
base_url: str | URL,
827827
max_retries: int = DEFAULT_MAX_RETRIES,
828-
timeout: float | Timeout | None | NotGiven = NOT_GIVEN,
828+
timeout: float | Timeout | None | NotGiven = not_given,
829829
http_client: httpx.Client | None = None,
830830
custom_headers: Mapping[str, str] | None = None,
831831
custom_query: Mapping[str, object] | None = None,
@@ -1356,7 +1356,7 @@ def __init__(
13561356
base_url: str | URL,
13571357
_strict_response_validation: bool,
13581358
max_retries: int = DEFAULT_MAX_RETRIES,
1359-
timeout: float | Timeout | None | NotGiven = NOT_GIVEN,
1359+
timeout: float | Timeout | None | NotGiven = not_given,
13601360
http_client: httpx.AsyncClient | None = None,
13611361
custom_headers: Mapping[str, str] | None = None,
13621362
custom_query: Mapping[str, object] | None = None,
@@ -1818,8 +1818,8 @@ def make_request_options(
18181818
extra_query: Query | None = None,
18191819
extra_body: Body | None = None,
18201820
idempotency_key: str | None = None,
1821-
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
1822-
post_parser: PostParser | NotGiven = NOT_GIVEN,
1821+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
1822+
post_parser: PostParser | NotGiven = not_given,
18231823
) -> RequestOptions:
18241824
"""Create a dict of type RequestOptions without keys of NotGiven values."""
18251825
options: RequestOptions = {}

src/onebusaway/_client.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,21 @@
33
from __future__ import annotations
44

55
import os
6-
from typing import Any, Union, Mapping
6+
from typing import Any, Mapping
77
from typing_extensions import Self, override
88

99
import httpx
1010

1111
from . import _exceptions
1212
from ._qs import Querystring
1313
from ._types import (
14-
NOT_GIVEN,
1514
Omit,
1615
Timeout,
1716
NotGiven,
1817
Transport,
1918
ProxiesTypes,
2019
RequestOptions,
20+
not_given,
2121
)
2222
from ._utils import is_given, get_async_library
2323
from ._version import __version__
@@ -111,7 +111,7 @@ def __init__(
111111
*,
112112
api_key: str | None = None,
113113
base_url: str | httpx.URL | None = None,
114-
timeout: Union[float, Timeout, None, NotGiven] = NOT_GIVEN,
114+
timeout: float | Timeout | None | NotGiven = not_given,
115115
max_retries: int = DEFAULT_MAX_RETRIES,
116116
default_headers: Mapping[str, str] | None = None,
117117
default_query: Mapping[str, object] | None = None,
@@ -221,9 +221,9 @@ def copy(
221221
*,
222222
api_key: str | None = None,
223223
base_url: str | httpx.URL | None = None,
224-
timeout: float | Timeout | None | NotGiven = NOT_GIVEN,
224+
timeout: float | Timeout | None | NotGiven = not_given,
225225
http_client: httpx.Client | None = None,
226-
max_retries: int | NotGiven = NOT_GIVEN,
226+
max_retries: int | NotGiven = not_given,
227227
default_headers: Mapping[str, str] | None = None,
228228
set_default_headers: Mapping[str, str] | None = None,
229229
default_query: Mapping[str, object] | None = None,
@@ -344,7 +344,7 @@ def __init__(
344344
*,
345345
api_key: str | None = None,
346346
base_url: str | httpx.URL | None = None,
347-
timeout: Union[float, Timeout, None, NotGiven] = NOT_GIVEN,
347+
timeout: float | Timeout | None | NotGiven = not_given,
348348
max_retries: int = DEFAULT_MAX_RETRIES,
349349
default_headers: Mapping[str, str] | None = None,
350350
default_query: Mapping[str, object] | None = None,
@@ -454,9 +454,9 @@ def copy(
454454
*,
455455
api_key: str | None = None,
456456
base_url: str | httpx.URL | None = None,
457-
timeout: float | Timeout | None | NotGiven = NOT_GIVEN,
457+
timeout: float | Timeout | None | NotGiven = not_given,
458458
http_client: httpx.AsyncClient | None = None,
459-
max_retries: int | NotGiven = NOT_GIVEN,
459+
max_retries: int | NotGiven = not_given,
460460
default_headers: Mapping[str, str] | None = None,
461461
set_default_headers: Mapping[str, str] | None = None,
462462
default_query: Mapping[str, object] | None = None,

src/onebusaway/_models.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -256,14 +256,15 @@ def model_dump(
256256
mode: Literal["json", "python"] | str = "python",
257257
include: IncEx | None = None,
258258
exclude: IncEx | None = None,
259-
by_alias: bool = False,
259+
by_alias: bool | None = None,
260260
exclude_unset: bool = False,
261261
exclude_defaults: bool = False,
262262
exclude_none: bool = False,
263263
round_trip: bool = False,
264264
warnings: bool | Literal["none", "warn", "error"] = True,
265265
context: dict[str, Any] | None = None,
266266
serialize_as_any: bool = False,
267+
fallback: Callable[[Any], Any] | None = None,
267268
) -> dict[str, Any]:
268269
"""Usage docs: https://docs.pydantic.dev/2.4/concepts/serialization/#modelmodel_dump
269270
@@ -295,10 +296,12 @@ def model_dump(
295296
raise ValueError("context is only supported in Pydantic v2")
296297
if serialize_as_any != False:
297298
raise ValueError("serialize_as_any is only supported in Pydantic v2")
299+
if fallback is not None:
300+
raise ValueError("fallback is only supported in Pydantic v2")
298301
dumped = super().dict( # pyright: ignore[reportDeprecated]
299302
include=include,
300303
exclude=exclude,
301-
by_alias=by_alias,
304+
by_alias=by_alias if by_alias is not None else False,
302305
exclude_unset=exclude_unset,
303306
exclude_defaults=exclude_defaults,
304307
exclude_none=exclude_none,
@@ -313,13 +316,14 @@ def model_dump_json(
313316
indent: int | None = None,
314317
include: IncEx | None = None,
315318
exclude: IncEx | None = None,
316-
by_alias: bool = False,
319+
by_alias: bool | None = None,
317320
exclude_unset: bool = False,
318321
exclude_defaults: bool = False,
319322
exclude_none: bool = False,
320323
round_trip: bool = False,
321324
warnings: bool | Literal["none", "warn", "error"] = True,
322325
context: dict[str, Any] | None = None,
326+
fallback: Callable[[Any], Any] | None = None,
323327
serialize_as_any: bool = False,
324328
) -> str:
325329
"""Usage docs: https://docs.pydantic.dev/2.4/concepts/serialization/#modelmodel_dump_json
@@ -348,11 +352,13 @@ def model_dump_json(
348352
raise ValueError("context is only supported in Pydantic v2")
349353
if serialize_as_any != False:
350354
raise ValueError("serialize_as_any is only supported in Pydantic v2")
355+
if fallback is not None:
356+
raise ValueError("fallback is only supported in Pydantic v2")
351357
return super().json( # type: ignore[reportDeprecated]
352358
indent=indent,
353359
include=include,
354360
exclude=exclude,
355-
by_alias=by_alias,
361+
by_alias=by_alias if by_alias is not None else False,
356362
exclude_unset=exclude_unset,
357363
exclude_defaults=exclude_defaults,
358364
exclude_none=exclude_none,

src/onebusaway/_qs.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from urllib.parse import parse_qs, urlencode
55
from typing_extensions import Literal, get_args
66

7-
from ._types import NOT_GIVEN, NotGiven, NotGivenOr
7+
from ._types import NotGiven, not_given
88
from ._utils import flatten
99

1010
_T = TypeVar("_T")
@@ -41,8 +41,8 @@ def stringify(
4141
self,
4242
params: Params,
4343
*,
44-
array_format: NotGivenOr[ArrayFormat] = NOT_GIVEN,
45-
nested_format: NotGivenOr[NestedFormat] = NOT_GIVEN,
44+
array_format: ArrayFormat | NotGiven = not_given,
45+
nested_format: NestedFormat | NotGiven = not_given,
4646
) -> str:
4747
return urlencode(
4848
self.stringify_items(
@@ -56,8 +56,8 @@ def stringify_items(
5656
self,
5757
params: Params,
5858
*,
59-
array_format: NotGivenOr[ArrayFormat] = NOT_GIVEN,
60-
nested_format: NotGivenOr[NestedFormat] = NOT_GIVEN,
59+
array_format: ArrayFormat | NotGiven = not_given,
60+
nested_format: NestedFormat | NotGiven = not_given,
6161
) -> list[tuple[str, str]]:
6262
opts = Options(
6363
qs=self,
@@ -143,8 +143,8 @@ def __init__(
143143
self,
144144
qs: Querystring = _qs,
145145
*,
146-
array_format: NotGivenOr[ArrayFormat] = NOT_GIVEN,
147-
nested_format: NotGivenOr[NestedFormat] = NOT_GIVEN,
146+
array_format: ArrayFormat | NotGiven = not_given,
147+
nested_format: NestedFormat | NotGiven = not_given,
148148
) -> None:
149149
self.array_format = qs.array_format if isinstance(array_format, NotGiven) else array_format
150150
self.nested_format = qs.nested_format if isinstance(nested_format, NotGiven) else nested_format

0 commit comments

Comments
 (0)