Skip to content

Commit 223523c

Browse files
committed
FIX: Fix missing Ruff configuration extension
1 parent 0557d33 commit 223523c

40 files changed

+97
-72
lines changed

databento/common/types.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,20 @@
11
import datetime as dt
22
import logging
3+
import pathlib
4+
import warnings
35
from collections.abc import Callable
46
from os import PathLike
5-
import pathlib
6-
from typing import Generic
77
from typing import IO
8+
from typing import Generic
89
from typing import TypedDict
910
from typing import TypeVar
10-
import warnings
1111

1212
import databento_dbn
1313
import pandas as pd
1414

1515
from databento.common.error import BentoWarning
1616

17+
1718
logger = logging.getLogger(__name__)
1819

1920
DBNRecord = (
@@ -188,14 +189,14 @@ def write(self, data: bytes) -> None:
188189
except Exception as exc:
189190
if self._exc_fn is None:
190191
self._warn(
191-
f"stream '{self.stream_name}' encountered an exception without an exception handler: {repr(exc)}",
192+
f"stream '{self.stream_name}' encountered an exception without an exception handler: {exc!r}",
192193
)
193194
else:
194195
try:
195196
self._exc_fn(exc)
196197
except Exception as inner_exc:
197198
self._warn(
198-
f"exception callback '{self.exc_callback_name}' encountered an exception: {repr(inner_exc)}",
199+
f"exception callback '{self.exc_callback_name}' encountered an exception: {inner_exc!r}",
199200
)
200201
raise inner_exc from exc
201202
raise exc
@@ -258,14 +259,14 @@ def call(self, record: DBNRecord) -> None:
258259
except Exception as exc:
259260
if self._exc_fn is None:
260261
self._warn(
261-
f"callback '{self.callback_name}' encountered an exception without an exception callback: {repr(exc)}",
262+
f"callback '{self.callback_name}' encountered an exception without an exception callback: {exc!r}",
262263
)
263264
else:
264265
try:
265266
self._exc_fn(exc)
266267
except Exception as inner_exc:
267268
self._warn(
268-
f"exception callback '{self.exc_callback_name}' encountered an exception: {repr(inner_exc)}",
269+
f"exception callback '{self.exc_callback_name}' encountered an exception: {inner_exc!r}",
269270
)
270271
raise inner_exc from exc
271272
raise exc

databento/live/gateway.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,18 @@
55
from io import BytesIO
66
from operator import attrgetter
77
from typing import SupportsBytes
8-
from typing import TypeVar
98

109
from databento_dbn import Encoding
1110
from databento_dbn import Schema
1211
from databento_dbn import SType
12+
from typing_extensions import Self
1313

1414
from databento.common.publishers import Dataset
1515
from databento.common.system import USER_AGENT
1616

1717

1818
logger = logging.getLogger(__name__)
1919

20-
T = TypeVar("T", bound="GatewayControl")
21-
2220

2321
@dataclasses.dataclass
2422
class GatewayControl(SupportsBytes):
@@ -27,9 +25,9 @@ class GatewayControl(SupportsBytes):
2725
"""
2826

2927
@classmethod
30-
def parse(cls: type[T], line: str | bytes) -> T:
28+
def parse(cls: type[Self], line: str | bytes) -> Self:
3129
"""
32-
Parse a message of type `T` from a string.
30+
Parse a `GatewayControl` message from a string.
3331
3432
Parameters
3533
----------

examples/live_smoke_test.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,16 @@
44
import os
55
import typing
66

7+
from databento_dbn import ErrorMsg
8+
from databento_dbn import MBOMsg
9+
from databento_dbn import RType
10+
from databento_dbn import SymbolMappingMsg
11+
712
from databento import Dataset
813
from databento import Live
914
from databento import RecordFlags
1015
from databento import Schema
1116
from databento import SType
12-
from databento_dbn import ErrorMsg
13-
from databento_dbn import MBOMsg
14-
from databento_dbn import RType
15-
from databento_dbn import SymbolMappingMsg
1617

1718

1819
def parse_args() -> argparse.Namespace:

examples/reference_adjustment_factors.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from pprint import pprint
22

33
import pandas as pd
4+
45
from databento import Reference
56

67

examples/reference_corporate_actions.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from pprint import pprint
22

33
import pandas as pd
4+
45
from databento import Reference
56

67

examples/reference_security_master_get_last.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from pprint import pprint
22

33
import pandas as pd
4+
45
from databento import Reference
56

67

examples/reference_security_master_get_range.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from pprint import pprint
22

33
import pandas as pd
4+
45
from databento import Reference
56

67

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,4 +81,5 @@ testpaths = ["tests"]
8181
asyncio_mode = "auto"
8282

8383
[tool.ruff]
84+
extend = "../ruff.toml"
8485
target-version = "py310"

tests/conftest.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@
1212
from collections.abc import Generator
1313
from collections.abc import Iterable
1414

15-
import databento.live.session
1615
import pytest
16+
from databento_dbn import Schema
17+
18+
import databento.live.session
1719
from databento import historical
1820
from databento import live
1921
from databento import reference
2022
from databento.common.publishers import Dataset
21-
from databento_dbn import Schema
22-
2323
from tests import TESTS_ROOT
2424
from tests.mockliveserver.fixture import MockLiveServerInterface
2525
from tests.mockliveserver.fixture import fixture_mock_live_server # noqa

tests/data/generator.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@
1111
import warnings
1212
from typing import Final
1313

14-
import databento as db
15-
from databento.common.publishers import Dataset
1614
from databento_dbn import Schema
1715

16+
import databento as db
17+
from databento.common.publishers import Dataset
1818
from tests import TESTS_ROOT
1919

2020

0 commit comments

Comments
 (0)