Skip to content

Commit bb4d4a6

Browse files
Merge pull request #5 from OneBusAway/release-please--branches--main--changes--next
release: 0.1.0-alpha.2
2 parents f6be4c0 + ec3a098 commit bb4d4a6

17 files changed

Lines changed: 613 additions & 15 deletions

.github/workflows/release-doctor.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
name: Release Doctor
22
on:
33
pull_request:
4+
branches:
5+
- main
46
workflow_dispatch:
57

68
jobs:

.release-please-manifest.json

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

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
configured_endpoints: 12
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/open-transit%2Fopen-transit-d7feb31fedeae9f0af2581bf85d95d374eb2eee635e6823975bc4f419bd8e492.yml
1+
configured_endpoints: 13
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/open-transit%2Fopen-transit-6c051801071707e025c582891048beeb3c06d10d13c852f8401a71604b81ac5d.yml

CHANGELOG.md

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

3+
## 0.1.0-alpha.2 (2024-07-22)
4+
5+
Full Changelog: [v0.1.0-alpha.1...v0.1.0-alpha.2](https://github.com/OneBusAway/python-sdk/compare/v0.1.0-alpha.1...v0.1.0-alpha.2)
6+
7+
### Features
8+
9+
* **api:** OpenAPI spec update via Stainless API ([#4](https://github.com/OneBusAway/python-sdk/issues/4)) ([fc1679d](https://github.com/OneBusAway/python-sdk/commit/fc1679d6086747ac91152587e272d6b2b32a97fd))
10+
* **api:** OpenAPI spec update via Stainless API ([#6](https://github.com/OneBusAway/python-sdk/issues/6)) ([b6a54cf](https://github.com/OneBusAway/python-sdk/commit/b6a54cfdac1ecfb398e20a4efa90294bde711490))
11+
* **api:** OpenAPI spec update via Stainless API ([#7](https://github.com/OneBusAway/python-sdk/issues/7)) ([448c0e3](https://github.com/OneBusAway/python-sdk/commit/448c0e3847375dcdb86f9cda1e8206f64910e6e9))
12+
* **api:** OpenAPI spec update via Stainless API ([#8](https://github.com/OneBusAway/python-sdk/issues/8)) ([361ab73](https://github.com/OneBusAway/python-sdk/commit/361ab733efaef27d9553cabde2844ffb95296979))
13+
* refactor: Remove print statement from main_sync function ([b72a7a1](https://github.com/OneBusAway/python-sdk/commit/b72a7a16aaf67c5d265cb995181e1abea6d7fed2))
14+
* refactor: Remove print statement from main_sync function ([dcd9e3b](https://github.com/OneBusAway/python-sdk/commit/dcd9e3b609078c5fcbb9682ae4f92849bc7291cf))
15+
316
## 0.1.0-alpha.1 (2024-07-14)
417

518
Full Changelog: [v0.0.1-alpha.0...v0.1.0-alpha.1](https://github.com/OneBusAway/python-sdk/compare/v0.0.1-alpha.0...v0.1.0-alpha.1)

README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ It is generated with [Stainless](https://www.stainlessapi.com/).
1010

1111
## Documentation
1212

13-
The REST API documentation can be found [on developer.onebusaway.org](https://developer.onebusaway.org). The full API of this library can be found in [api.md](api.md).
13+
The REST API documentation can be found on [developer.onebusaway.org](https://developer.onebusaway.org). The full API of this library can be found in [api.md](api.md).
1414

1515
## Installation
1616

@@ -277,6 +277,12 @@ client = OnebusawaySDK(
277277
)
278278
```
279279

280+
You can also customize the client on a per-request basis by using `with_options()`:
281+
282+
```python
283+
client.with_options(http_client=DefaultHttpxClient(...))
284+
```
285+
280286
### Managing HTTP resources
281287

282288
By default the library closes underlying HTTP connections whenever the client is [garbage collected](https://docs.python.org/3/reference/datamodel.html#object.__del__). You can manually close the client using the `.close()` method if desired, or with a context manager that closes when exiting.

api.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,3 +136,15 @@ from onebusaway.types import TripDetailRetrieveResponse
136136
Methods:
137137

138138
- <code title="get /api/where/trip-details/{tripID}.json">client.trip_details.<a href="./src/onebusaway/resources/trip_details.py">retrieve</a>(trip_id, \*\*<a href="src/onebusaway/types/trip_detail_retrieve_params.py">params</a>) -> <a href="./src/onebusaway/types/trip_detail_retrieve_response.py">TripDetailRetrieveResponse</a></code>
139+
140+
# TripForVehicle
141+
142+
Types:
143+
144+
```python
145+
from onebusaway.types import TripForVehicleRetrieveResponse
146+
```
147+
148+
Methods:
149+
150+
- <code title="get /api/where/trip-for-vehicle/{vehicleID}.json">client.trip_for_vehicle.<a href="./src/onebusaway/resources/trip_for_vehicle.py">retrieve</a>(vehicle_id, \*\*<a href="src/onebusaway/types/trip_for_vehicle_retrieve_params.py">params</a>) -> <a href="./src/onebusaway/types/trip_for_vehicle_retrieve_response.py">TripForVehicleRetrieveResponse</a></code>

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

src/onebusaway/_base_client.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -879,9 +879,9 @@ def __exit__(
879879
def _prepare_options(
880880
self,
881881
options: FinalRequestOptions, # noqa: ARG002
882-
) -> None:
882+
) -> FinalRequestOptions:
883883
"""Hook for mutating the given options"""
884-
return None
884+
return options
885885

886886
def _prepare_request(
887887
self,
@@ -961,7 +961,7 @@ def _request(
961961
input_options = model_copy(options)
962962

963963
cast_to = self._maybe_override_cast_to(cast_to, options)
964-
self._prepare_options(options)
964+
options = self._prepare_options(options)
965965

966966
retries = self._remaining_retries(remaining_retries, options)
967967
request = self._build_request(options)
@@ -1442,9 +1442,9 @@ async def __aexit__(
14421442
async def _prepare_options(
14431443
self,
14441444
options: FinalRequestOptions, # noqa: ARG002
1445-
) -> None:
1445+
) -> FinalRequestOptions:
14461446
"""Hook for mutating the given options"""
1447-
return None
1447+
return options
14481448

14491449
async def _prepare_request(
14501450
self,
@@ -1529,7 +1529,7 @@ async def _request(
15291529
input_options = model_copy(options)
15301530

15311531
cast_to = self._maybe_override_cast_to(cast_to, options)
1532-
await self._prepare_options(options)
1532+
options = await self._prepare_options(options)
15331533

15341534
retries = self._remaining_retries(remaining_retries, options)
15351535
request = self._build_request(options)

src/onebusaway/_client.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ class OnebusawaySDK(SyncAPIClient):
5757
trip: resources.TripResource
5858
trips_for_location: resources.TripsForLocationResource
5959
trip_details: resources.TripDetailsResource
60+
trip_for_vehicle: resources.TripForVehicleResource
6061
with_raw_response: OnebusawaySDKWithRawResponse
6162
with_streaming_response: OnebusawaySDKWithStreamedResponse
6263

@@ -125,6 +126,7 @@ def __init__(
125126
self.trip = resources.TripResource(self)
126127
self.trips_for_location = resources.TripsForLocationResource(self)
127128
self.trip_details = resources.TripDetailsResource(self)
129+
self.trip_for_vehicle = resources.TripForVehicleResource(self)
128130
self.with_raw_response = OnebusawaySDKWithRawResponse(self)
129131
self.with_streaming_response = OnebusawaySDKWithStreamedResponse(self)
130132

@@ -253,6 +255,7 @@ class AsyncOnebusawaySDK(AsyncAPIClient):
253255
trip: resources.AsyncTripResource
254256
trips_for_location: resources.AsyncTripsForLocationResource
255257
trip_details: resources.AsyncTripDetailsResource
258+
trip_for_vehicle: resources.AsyncTripForVehicleResource
256259
with_raw_response: AsyncOnebusawaySDKWithRawResponse
257260
with_streaming_response: AsyncOnebusawaySDKWithStreamedResponse
258261

@@ -321,6 +324,7 @@ def __init__(
321324
self.trip = resources.AsyncTripResource(self)
322325
self.trips_for_location = resources.AsyncTripsForLocationResource(self)
323326
self.trip_details = resources.AsyncTripDetailsResource(self)
327+
self.trip_for_vehicle = resources.AsyncTripForVehicleResource(self)
324328
self.with_raw_response = AsyncOnebusawaySDKWithRawResponse(self)
325329
self.with_streaming_response = AsyncOnebusawaySDKWithStreamedResponse(self)
326330

@@ -452,6 +456,7 @@ def __init__(self, client: OnebusawaySDK) -> None:
452456
self.trip = resources.TripResourceWithRawResponse(client.trip)
453457
self.trips_for_location = resources.TripsForLocationResourceWithRawResponse(client.trips_for_location)
454458
self.trip_details = resources.TripDetailsResourceWithRawResponse(client.trip_details)
459+
self.trip_for_vehicle = resources.TripForVehicleResourceWithRawResponse(client.trip_for_vehicle)
455460

456461

457462
class AsyncOnebusawaySDKWithRawResponse:
@@ -471,6 +476,7 @@ def __init__(self, client: AsyncOnebusawaySDK) -> None:
471476
self.trip = resources.AsyncTripResourceWithRawResponse(client.trip)
472477
self.trips_for_location = resources.AsyncTripsForLocationResourceWithRawResponse(client.trips_for_location)
473478
self.trip_details = resources.AsyncTripDetailsResourceWithRawResponse(client.trip_details)
479+
self.trip_for_vehicle = resources.AsyncTripForVehicleResourceWithRawResponse(client.trip_for_vehicle)
474480

475481

476482
class OnebusawaySDKWithStreamedResponse:
@@ -490,6 +496,7 @@ def __init__(self, client: OnebusawaySDK) -> None:
490496
self.trip = resources.TripResourceWithStreamingResponse(client.trip)
491497
self.trips_for_location = resources.TripsForLocationResourceWithStreamingResponse(client.trips_for_location)
492498
self.trip_details = resources.TripDetailsResourceWithStreamingResponse(client.trip_details)
499+
self.trip_for_vehicle = resources.TripForVehicleResourceWithStreamingResponse(client.trip_for_vehicle)
493500

494501

495502
class AsyncOnebusawaySDKWithStreamedResponse:
@@ -513,6 +520,7 @@ def __init__(self, client: AsyncOnebusawaySDK) -> None:
513520
client.trips_for_location
514521
)
515522
self.trip_details = resources.AsyncTripDetailsResourceWithStreamingResponse(client.trip_details)
523+
self.trip_for_vehicle = resources.AsyncTripForVehicleResourceWithStreamingResponse(client.trip_for_vehicle)
516524

517525

518526
Client = OnebusawaySDK

src/onebusaway/_compat.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,10 +118,10 @@ def get_model_fields(model: type[pydantic.BaseModel]) -> dict[str, FieldInfo]:
118118
return model.__fields__ # type: ignore
119119

120120

121-
def model_copy(model: _ModelT) -> _ModelT:
121+
def model_copy(model: _ModelT, *, deep: bool = False) -> _ModelT:
122122
if PYDANTIC_V2:
123-
return model.model_copy()
124-
return model.copy() # type: ignore
123+
return model.model_copy(deep=deep)
124+
return model.copy(deep=deep) # type: ignore
125125

126126

127127
def model_json(model: pydantic.BaseModel, *, indent: int | None = None) -> str:

0 commit comments

Comments
 (0)