Skip to content

Commit d50bcd8

Browse files
chore: rye linting
1 parent f783dc5 commit d50bcd8

File tree

113 files changed

+929
-1101
lines changed

Some content is hidden

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

113 files changed

+929
-1101
lines changed

src/onebusaway/__init__.py

Lines changed: 33 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,41 @@
11
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

33
from . import types
4-
from ._version import __version__, __title__
5-
from ._client import Timeout,Transport,RequestOptions,Client,AsyncClient,Stream,AsyncStream,OnebusawaySDK,AsyncOnebusawaySDK
6-
from ._exceptions import OnebusawaySDKError,APIError,APIStatusError,APITimeoutError,APIConnectionError,APIResponseValidationError,BadRequestError,AuthenticationError,PermissionDeniedError,NotFoundError,ConflictError,UnprocessableEntityError,RateLimitError,InternalServerError
7-
from ._types import NoneType,Transport,ProxiesTypes,NotGiven,NOT_GIVEN,Omit
4+
from ._types import NOT_GIVEN, Omit, NoneType, NotGiven, Transport, ProxiesTypes
85
from ._utils import file_from_path
6+
from ._client import (
7+
Client,
8+
Stream,
9+
Timeout,
10+
Transport,
11+
AsyncClient,
12+
AsyncStream,
13+
OnebusawaySDK,
14+
RequestOptions,
15+
AsyncOnebusawaySDK,
16+
)
917
from ._models import BaseModel
10-
from ._constants import DEFAULT_TIMEOUT,DEFAULT_MAX_RETRIES,DEFAULT_CONNECTION_LIMITS
11-
from ._base_client import DefaultHttpxClient,DefaultAsyncHttpxClient
12-
from ._utils._logs import setup_logging as _setup_logging
18+
from ._version import __title__, __version__
1319
from ._response import APIResponse as APIResponse, AsyncAPIResponse as AsyncAPIResponse
20+
from ._constants import DEFAULT_TIMEOUT, DEFAULT_MAX_RETRIES, DEFAULT_CONNECTION_LIMITS
21+
from ._exceptions import (
22+
APIError,
23+
ConflictError,
24+
NotFoundError,
25+
APIStatusError,
26+
RateLimitError,
27+
APITimeoutError,
28+
BadRequestError,
29+
APIConnectionError,
30+
OnebusawaySDKError,
31+
AuthenticationError,
32+
InternalServerError,
33+
PermissionDeniedError,
34+
UnprocessableEntityError,
35+
APIResponseValidationError,
36+
)
37+
from ._base_client import DefaultHttpxClient, DefaultAsyncHttpxClient
38+
from ._utils._logs import setup_logging as _setup_logging
1439

1540
__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"]
1641

@@ -24,7 +49,7 @@
2449
for __name in __all__:
2550
if not __name.startswith("__"):
2651
try:
27-
setattr(__locals[__name], "__module__", "onebusaway")
52+
__locals[__name].__module__ = "onebusaway"
2853
except (TypeError, AttributeError):
2954
# Some of our exported symbols are builtins which we can't set attributes for.
3055
pass

src/onebusaway/_base_client.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
import inspect
1010
import logging
1111
import platform
12-
import warnings
1312
import email.utils
1413
from types import TracebackType
1514
from random import random
@@ -84,7 +83,6 @@
8483
APIConnectionError,
8584
APIResponseValidationError,
8685
)
87-
from ._legacy_response import LegacyAPIResponse
8886

8987
log: logging.Logger = logging.getLogger(__name__)
9088

src/onebusaway/_client.py

Lines changed: 49 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -2,45 +2,64 @@
22

33
from __future__ import annotations
44

5-
import httpx
6-
7-
import os
8-
9-
from ._streaming import AsyncStream as AsyncStream, Stream as Stream
10-
11-
from typing import Union, Mapping, Any
12-
13-
from ._exceptions import OnebusawaySDKError, APIStatusError
14-
15-
from typing_extensions import override, Self
16-
17-
from ._utils import get_async_library
18-
19-
from .resources import agencies_with_coverage, agency, vehicles_for_agency, config, current_time, stops_for_location, stops_for_route, stops_for_agency, stop, stop_ids_for_agency, schedule_for_stop, route, route_ids_for_agency, routes_for_location, routes_for_agency, schedule_for_route, arrival_and_departure, trip, trips_for_location, trip_details, trip_for_vehicle, trips_for_route, report_problem_with_stop, report_problem_with_trip, search_for_stop, search_for_route, block, shape
20-
21-
from . import _exceptions
22-
235
import os
24-
import asyncio
25-
import warnings
26-
from typing_extensions import Literal
6+
from typing import Any, Union, Mapping
7+
from typing_extensions import Self, override
278

289
import httpx
2910

30-
from ._version import __version__
11+
from . import _exceptions
3112
from ._qs import Querystring
32-
from ._utils import extract_files, maybe_transform, required_args, deepcopy_minimal, maybe_coerce_integer, maybe_coerce_float, maybe_coerce_boolean, is_given
33-
from ._types import Omit, NotGiven, Timeout, Transport, ProxiesTypes, RequestOptions, Headers, NoneType, Query, Body, NOT_GIVEN
13+
from ._types import (
14+
NOT_GIVEN,
15+
Omit,
16+
Timeout,
17+
NotGiven,
18+
Transport,
19+
ProxiesTypes,
20+
RequestOptions,
21+
)
22+
from ._utils import (
23+
is_given,
24+
get_async_library,
25+
)
26+
from ._version import __version__
27+
from .resources import (
28+
stop,
29+
trip,
30+
block,
31+
route,
32+
shape,
33+
agency,
34+
config,
35+
current_time,
36+
trip_details,
37+
search_for_stop,
38+
stops_for_route,
39+
trips_for_route,
40+
search_for_route,
41+
stops_for_agency,
42+
trip_for_vehicle,
43+
routes_for_agency,
44+
schedule_for_stop,
45+
schedule_for_route,
46+
stops_for_location,
47+
trips_for_location,
48+
routes_for_location,
49+
stop_ids_for_agency,
50+
vehicles_for_agency,
51+
route_ids_for_agency,
52+
arrival_and_departure,
53+
agencies_with_coverage,
54+
report_problem_with_stop,
55+
report_problem_with_trip,
56+
)
57+
from ._streaming import Stream as Stream, AsyncStream as AsyncStream
58+
from ._exceptions import APIStatusError, OnebusawaySDKError
3459
from ._base_client import (
35-
DEFAULT_CONNECTION_LIMITS,
36-
DEFAULT_TIMEOUT,
3760
DEFAULT_MAX_RETRIES,
38-
ResponseT,
39-
SyncHttpxClientWrapper,
40-
AsyncHttpxClientWrapper,
4161
SyncAPIClient,
4262
AsyncAPIClient,
43-
make_request_options,
4463
)
4564

4665
__all__ = ["Timeout", "Transport", "ProxiesTypes", "RequestOptions", "OnebusawaySDK", "AsyncOnebusawaySDK", "Client", "AsyncClient"]

src/onebusaway/_exceptions.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
from __future__ import annotations
44

5-
import httpx
6-
75
from typing_extensions import Literal
86

7+
import httpx
8+
99
__all__ = ["BadRequestError", "AuthenticationError", "PermissionDeniedError", "NotFoundError", "ConflictError", "UnprocessableEntityError", "RateLimitError", "InternalServerError"]
1010

1111
class OnebusawaySDKError(Exception):

src/onebusaway/_resource.py

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

55
import time
6-
import anyio
7-
86
from typing import TYPE_CHECKING
97

8+
import anyio
9+
1010
if TYPE_CHECKING:
1111
from ._client import OnebusawaySDK, AsyncOnebusawaySDK
1212

src/onebusaway/_response.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,12 @@
2525
import pydantic
2626

2727
from ._types import NoneType
28-
from ._utils import is_given, extract_type_arg, is_annotated_type, extract_type_var_from_base, is_type_alias_type
29-
from ._streaming import extract_stream_chunk_type
28+
from ._utils import is_given, extract_type_arg, is_annotated_type, is_type_alias_type, extract_type_var_from_base
3029
from ._models import BaseModel, is_basemodel
3130
from ._constants import RAW_RESPONSE_HEADER, OVERRIDE_CAST_TO_HEADER
3231
from ._streaming import Stream, AsyncStream, is_stream_class_type, extract_stream_chunk_type
3332
from ._exceptions import OnebusawaySDKError, APIResponseValidationError
3433

35-
3634
if TYPE_CHECKING:
3735
from ._models import FinalRequestOptions
3836
from ._base_client import BaseClient

src/onebusaway/_streaming.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,7 @@
99

1010
import httpx
1111

12-
from ._utils import is_mapping, is_dict, extract_type_var_from_base
13-
from ._exceptions import APIError
14-
from ._response import APIResponse, AsyncAPIResponse
12+
from ._utils import extract_type_var_from_base
1513

1614
if TYPE_CHECKING:
1715
from ._client import OnebusawaySDK, AsyncOnebusawaySDK

src/onebusaway/_types.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
from __future__ import annotations
22

33
from os import PathLike
4-
from abc import ABC, abstractmethod
54
from typing import (
65
IO,
76
TYPE_CHECKING,
@@ -14,10 +13,8 @@
1413
Mapping,
1514
TypeVar,
1615
Callable,
17-
Iterator,
1816
Optional,
1917
Sequence,
20-
AsyncIterator,
2118
)
2219
from typing_extensions import Set, Literal, Protocol, TypeAlias, TypedDict, override, runtime_checkable
2320

@@ -28,7 +25,6 @@
2825
if TYPE_CHECKING:
2926
from ._models import BaseModel
3027
from ._response import APIResponse, AsyncAPIResponse
31-
from ._legacy_response import HttpxBinaryResponseContent
3228

3329
Transport = BaseTransport
3430
AsyncTransport = AsyncBaseTransport

0 commit comments

Comments
 (0)