Skip to content

Commit 5397dee

Browse files
Merge pull request #292 from OneBusAway/release-please--branches--main--changes--next
release: 1.8.5
2 parents ccadbb1 + d50bcd8 commit 5397dee

File tree

127 files changed

+2735
-4135
lines changed

Some content is hidden

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

127 files changed

+2735
-4135
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.8.4"
2+
".": "1.8.5"
33
}

CHANGELOG.md

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

3+
## 1.8.5 (2025-05-15)
4+
5+
Full Changelog: [v1.8.4...v1.8.5](https://github.com/OneBusAway/python-sdk/compare/v1.8.4...v1.8.5)
6+
7+
### Chores
8+
9+
* **internal:** codegen related update ([#288](https://github.com/OneBusAway/python-sdk/issues/288)) ([d301a0c](https://github.com/OneBusAway/python-sdk/commit/d301a0cf24104ff0d791046c99093f3c47365bf3))
10+
311
## 1.8.4 (2025-03-27)
412

513
Full Changelog: [v1.8.3...v1.8.4](https://github.com/OneBusAway/python-sdk/compare/v1.8.3...v1.8.4)

README.md

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,8 @@ client = AsyncOnebusawaySDK(
5454
api_key=os.environ.get("ONEBUSAWAY_API_KEY"), # This is the default and can be omitted
5555
)
5656

57-
5857
async def main() -> None:
59-
current_time = await client.current_time.retrieve()
60-
58+
current_time = await client.current_time.retrieve()
6159

6260
asyncio.run(main())
6361
```
@@ -92,7 +90,7 @@ try:
9290
client.current_time.retrieve()
9391
except onebusaway.APIConnectionError as e:
9492
print("The server could not be reached")
95-
print(e.__cause__) # an underlying Exception, likely raised within httpx.
93+
print(e.__cause__) # an underlying Exception, likely raised within httpx.
9694
except onebusaway.RateLimitError as e:
9795
print("A 429 status code was received; we should back off a bit.")
9896
except onebusaway.APIStatusError as e:
@@ -132,7 +130,7 @@ client = OnebusawaySDK(
132130
)
133131

134132
# Or, configure per-request:
135-
client.with_options(max_retries=5).current_time.retrieve()
133+
client.with_options(max_retries = 5).current_time.retrieve()
136134
```
137135

138136
### Timeouts
@@ -155,7 +153,7 @@ client = OnebusawaySDK(
155153
)
156154

157155
# Override per-request:
158-
client.with_options(timeout=5.0).current_time.retrieve()
156+
client.with_options(timeout = 5.0).current_time.retrieve()
159157
```
160158

161159
On timeout, an `APITimeoutError` is thrown.
@@ -214,11 +212,11 @@ The above interface eagerly reads the full response body when you make the reque
214212
To stream the response body, use `.with_streaming_response` instead, which requires a context manager and only reads the response body once you call `.read()`, `.text()`, `.json()`, `.iter_bytes()`, `.iter_text()`, `.iter_lines()` or `.parse()`. In the async client, these are async methods.
215213

216214
```python
217-
with client.current_time.with_streaming_response.retrieve() as response:
218-
print(response.headers.get("X-My-Header"))
215+
with client.current_time.with_streaming_response.retrieve() as response :
216+
print(response.headers.get('X-My-Header'))
219217

220218
for line in response.iter_lines():
221-
print(line)
219+
print(line)
222220
```
223221

224222
The context manager is required so that the response will reliably be closed.
@@ -272,10 +270,7 @@ from onebusaway import OnebusawaySDK, DefaultHttpxClient
272270
client = OnebusawaySDK(
273271
# Or use the `ONEBUSAWAY_SDK_BASE_URL` env var
274272
base_url="http://my.test.server.example.com:8083",
275-
http_client=DefaultHttpxClient(
276-
proxy="http://my.test.proxy.example.com",
277-
transport=httpx.HTTPTransport(local_address="0.0.0.0"),
278-
),
273+
http_client=DefaultHttpxClient(proxy="http://my.test.proxy.example.com", transport=httpx.HTTPTransport(local_address="0.0.0.0")),
279274
)
280275
```
281276

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.8.4"
3+
version = "1.8.5"
44
description = "The official Python library for the onebusaway-sdk API"
55
dynamic = ["readme"]
66
license = "Apache-2.0"

requirements-dev.lock

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ annotated-types==0.6.0
1414
# via pydantic
1515
anyio==4.4.0
1616
# via httpx
17-
# via onebusaway
17+
# via sdk-pythonpackagename
1818
argcomplete==3.1.2
1919
# via nox
2020
certifi==2023.7.22
@@ -26,7 +26,7 @@ dirty-equals==0.6.0
2626
distlib==0.3.7
2727
# via virtualenv
2828
distro==1.8.0
29-
# via onebusaway
29+
# via sdk-pythonpackagename
3030
exceptiongroup==1.2.2
3131
# via anyio
3232
# via pytest
@@ -37,8 +37,8 @@ h11==0.14.0
3737
httpcore==1.0.2
3838
# via httpx
3939
httpx==0.28.1
40-
# via onebusaway
4140
# via respx
41+
# via sdk-pythonpackagename
4242
idna==3.4
4343
# via anyio
4444
# via httpx
@@ -64,7 +64,7 @@ platformdirs==3.11.0
6464
pluggy==1.5.0
6565
# via pytest
6666
pydantic==2.10.3
67-
# via onebusaway
67+
# via sdk-pythonpackagename
6868
pydantic-core==2.27.1
6969
# via pydantic
7070
pygments==2.18.0
@@ -86,18 +86,18 @@ six==1.16.0
8686
# via python-dateutil
8787
sniffio==1.3.0
8888
# via anyio
89-
# via onebusaway
89+
# via sdk-pythonpackagename
9090
time-machine==2.9.0
9191
tomli==2.0.2
9292
# via mypy
9393
# via pytest
9494
typing-extensions==4.12.2
9595
# via anyio
9696
# via mypy
97-
# via onebusaway
9897
# via pydantic
9998
# via pydantic-core
10099
# via pyright
100+
# via sdk-pythonpackagename
101101
virtualenv==20.24.5
102102
# via nox
103103
zipp==3.17.0

requirements.lock

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,32 +14,32 @@ annotated-types==0.6.0
1414
# via pydantic
1515
anyio==4.4.0
1616
# via httpx
17-
# via onebusaway
17+
# via sdk-pythonpackagename
1818
certifi==2023.7.22
1919
# via httpcore
2020
# via httpx
2121
distro==1.8.0
22-
# via onebusaway
22+
# via sdk-pythonpackagename
2323
exceptiongroup==1.2.2
2424
# via anyio
2525
h11==0.14.0
2626
# via httpcore
2727
httpcore==1.0.2
2828
# via httpx
2929
httpx==0.28.1
30-
# via onebusaway
30+
# via sdk-pythonpackagename
3131
idna==3.4
3232
# via anyio
3333
# via httpx
3434
pydantic==2.10.3
35-
# via onebusaway
35+
# via sdk-pythonpackagename
3636
pydantic-core==2.27.1
3737
# via pydantic
3838
sniffio==1.3.0
3939
# via anyio
40-
# via onebusaway
40+
# via sdk-pythonpackagename
4141
typing-extensions==4.12.2
4242
# via anyio
43-
# via onebusaway
4443
# via pydantic
4544
# via pydantic-core
45+
# via sdk-pythonpackagename

scripts/utils/ruffen-docs.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def _md_match(match: Match[str]) -> str:
4747
with _collect_error(match):
4848
code = format_code_block(code)
4949
code = textwrap.indent(code, match["indent"])
50-
return f"{match['before']}{code}{match['after']}"
50+
return f'{match["before"]}{code}{match["after"]}'
5151

5252
def _pycon_match(match: Match[str]) -> str:
5353
code = ""
@@ -97,7 +97,7 @@ def finish_fragment() -> None:
9797
def _md_pycon_match(match: Match[str]) -> str:
9898
code = _pycon_match(match)
9999
code = textwrap.indent(code, match["indent"])
100-
return f"{match['before']}{code}{match['after']}"
100+
return f'{match["before"]}{code}{match["after"]}'
101101

102102
src = MD_RE.sub(_md_match, src)
103103
src = MD_PYCON_RE.sub(_md_pycon_match, src)

src/onebusaway/__init__.py

Lines changed: 3 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -37,46 +37,7 @@
3737
from ._base_client import DefaultHttpxClient, DefaultAsyncHttpxClient
3838
from ._utils._logs import setup_logging as _setup_logging
3939

40-
__all__ = [
41-
"types",
42-
"__version__",
43-
"__title__",
44-
"NoneType",
45-
"Transport",
46-
"ProxiesTypes",
47-
"NotGiven",
48-
"NOT_GIVEN",
49-
"Omit",
50-
"OnebusawaySDKError",
51-
"APIError",
52-
"APIStatusError",
53-
"APITimeoutError",
54-
"APIConnectionError",
55-
"APIResponseValidationError",
56-
"BadRequestError",
57-
"AuthenticationError",
58-
"PermissionDeniedError",
59-
"NotFoundError",
60-
"ConflictError",
61-
"UnprocessableEntityError",
62-
"RateLimitError",
63-
"InternalServerError",
64-
"Timeout",
65-
"RequestOptions",
66-
"Client",
67-
"AsyncClient",
68-
"Stream",
69-
"AsyncStream",
70-
"OnebusawaySDK",
71-
"AsyncOnebusawaySDK",
72-
"file_from_path",
73-
"BaseModel",
74-
"DEFAULT_TIMEOUT",
75-
"DEFAULT_MAX_RETRIES",
76-
"DEFAULT_CONNECTION_LIMITS",
77-
"DefaultHttpxClient",
78-
"DefaultAsyncHttpxClient",
79-
]
40+
__all__ = ["types", "__version__", "__title__", "NoneType", "Transport", "ProxiesTypes", "NotGiven", "NOT_GIVEN", "Omit", "OnebusawaySDKError", "APIError", "APIStatusError", "APITimeoutError", "APIConnectionError", "APIResponseValidationError", "BadRequestError", "AuthenticationError", "PermissionDeniedError", "NotFoundError", "ConflictError", "UnprocessableEntityError", "RateLimitError", "InternalServerError", "Timeout", "RequestOptions", "Client", "AsyncClient", "Stream", "AsyncStream", "OnebusawaySDK", "AsyncOnebusawaySDK", "file_from_path", "BaseModel", "DEFAULT_TIMEOUT", "DEFAULT_MAX_RETRIES", "DEFAULT_CONNECTION_LIMITS", "DefaultHttpxClient", "DefaultAsyncHttpxClient"]
8041

8142
_setup_logging()
8243

@@ -88,7 +49,7 @@
8849
for __name in __all__:
8950
if not __name.startswith("__"):
9051
try:
91-
__locals[__name].__module__ = "onebusaway"
52+
__locals[__name].__module__ = "onebusaway"
9253
except (TypeError, AttributeError):
9354
# Some of our exported symbols are builtins which we can't set attributes for.
94-
pass
55+
pass

src/onebusaway/_base_client.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ def _set_private_attributes(
203203
model: Type[_T],
204204
options: FinalRequestOptions,
205205
) -> None:
206-
if PYDANTIC_V2 and getattr(self, "__pydantic_private__", None) is None:
206+
if PYDANTIC_V2 and getattr(self, '__pydantic_private__', None) is None:
207207
self.__pydantic_private__ = {}
208208

209209
self._model = model
@@ -291,7 +291,7 @@ def _set_private_attributes(
291291
client: AsyncAPIClient,
292292
options: FinalRequestOptions,
293293
) -> None:
294-
if PYDANTIC_V2 and getattr(self, "__pydantic_private__", None) is None:
294+
if PYDANTIC_V2 and getattr(self, '__pydantic_private__', None) is None:
295295
self.__pydantic_private__ = {}
296296

297297
self._model = model
@@ -608,7 +608,7 @@ def default_headers(self) -> dict[str, str | Omit]:
608608
"Accept": "application/json",
609609
"Content-Type": "application/json",
610610
"User-Agent": self.user_agent,
611-
**self.platform_headers(),
611+
**self.platform_headers(),
612612
**self.auth_headers,
613613
**self._custom_headers,
614614
}
@@ -994,6 +994,7 @@ def _request(
994994
response.reason_phrase,
995995
response.headers,
996996
)
997+
997998

998999
try:
9991000
response.raise_for_status()
@@ -1069,6 +1070,8 @@ def _process_response(
10691070
stream_cls: type[Stream[Any]] | type[AsyncStream[Any]] | None,
10701071
retries_taken: int = 0,
10711072
) -> ResponseT:
1073+
1074+
10721075
origin = get_origin(cast_to) or cast_to
10731076

10741077
if inspect.isclass(origin) and issubclass(origin, BaseAPIResponse):
@@ -1592,6 +1595,8 @@ async def _process_response(
15921595
stream_cls: type[Stream[Any]] | type[AsyncStream[Any]] | None,
15931596
retries_taken: int = 0,
15941597
) -> ResponseT:
1598+
1599+
15951600
origin = get_origin(cast_to) or cast_to
15961601

15971602
if inspect.isclass(origin) and issubclass(origin, BaseAPIResponse):

0 commit comments

Comments
 (0)