Skip to content

Commit fc11794

Browse files
committed
BLD: Update ruff pre-commit to 0.14.0
1 parent 227be02 commit fc11794

File tree

12 files changed

+37
-35
lines changed

12 files changed

+37
-35
lines changed

databento/common/dbnstore.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import logging
88
import warnings
99
import zoneinfo
10+
from collections.abc import Callable
1011
from collections.abc import Generator
1112
from collections.abc import Iterator
1213
from collections.abc import Mapping
@@ -18,7 +19,6 @@
1819
from typing import TYPE_CHECKING
1920
from typing import Any
2021
from typing import BinaryIO
21-
from typing import Callable
2222
from typing import Final
2323
from typing import Literal
2424
from typing import Protocol

databento/common/enums.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
from __future__ import annotations
22

3+
from collections.abc import Callable
34
from enum import Enum
45
from enum import Flag
56
from enum import IntFlag
67
from enum import unique
7-
from typing import Callable
88
from typing import TypeVar
99

1010

databento/common/types.py

Lines changed: 24 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,36 @@
11
import datetime as dt
2-
from typing import Callable
2+
from collections.abc import Callable
33
from typing import Generic
44
from typing import TypedDict
55
from typing import TypeVar
6-
from typing import Union
76

87
import databento_dbn
98
import pandas as pd
109

1110

12-
DBNRecord = Union[
13-
databento_dbn.BBOMsg,
14-
databento_dbn.CBBOMsg,
15-
databento_dbn.CMBP1Msg,
16-
databento_dbn.MBOMsg,
17-
databento_dbn.MBP1Msg,
18-
databento_dbn.MBP10Msg,
19-
databento_dbn.TradeMsg,
20-
databento_dbn.OHLCVMsg,
21-
databento_dbn.ImbalanceMsg,
22-
databento_dbn.InstrumentDefMsg,
23-
databento_dbn.InstrumentDefMsgV1,
24-
databento_dbn.InstrumentDefMsgV2,
25-
databento_dbn.StatMsg,
26-
databento_dbn.StatMsgV1,
27-
databento_dbn.StatusMsg,
28-
databento_dbn.SymbolMappingMsg,
29-
databento_dbn.SymbolMappingMsgV1,
30-
databento_dbn.SystemMsg,
31-
databento_dbn.SystemMsgV1,
32-
databento_dbn.ErrorMsg,
33-
databento_dbn.ErrorMsgV1,
34-
]
11+
DBNRecord = (
12+
databento_dbn.BBOMsg
13+
| databento_dbn.CBBOMsg
14+
| databento_dbn.CMBP1Msg
15+
| databento_dbn.MBOMsg
16+
| databento_dbn.MBP1Msg
17+
| databento_dbn.MBP10Msg
18+
| databento_dbn.TradeMsg
19+
| databento_dbn.OHLCVMsg
20+
| databento_dbn.ImbalanceMsg
21+
| databento_dbn.InstrumentDefMsg
22+
| databento_dbn.InstrumentDefMsgV1
23+
| databento_dbn.InstrumentDefMsgV2
24+
| databento_dbn.StatMsg
25+
| databento_dbn.StatMsgV1
26+
| databento_dbn.StatusMsg
27+
| databento_dbn.SymbolMappingMsg
28+
| databento_dbn.SymbolMappingMsgV1
29+
| databento_dbn.SystemMsg
30+
| databento_dbn.SystemMsgV1
31+
| databento_dbn.ErrorMsg
32+
| databento_dbn.ErrorMsgV1
33+
)
3534

3635
RecordCallback = Callable[[DBNRecord], None]
3736
ExceptionCallback = Callable[[Exception], None]

pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,3 +78,6 @@ plugins = ["numpy.typing.mypy_plugin"]
7878
[tool.pytest.ini_options]
7979
testpaths = ["tests"]
8080
asyncio_mode = "auto"
81+
82+
[tool.ruff]
83+
target-version = "py310"

tests/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
import random
99
import string
1010
from collections.abc import AsyncGenerator
11+
from collections.abc import Callable
1112
from collections.abc import Generator
1213
from collections.abc import Iterable
13-
from typing import Callable
1414

1515
import databento.live.session
1616
import pytest

tests/mockliveserver/fixture.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
import sys
66
from asyncio.subprocess import Process
77
from collections.abc import AsyncGenerator
8+
from collections.abc import Callable
89
from collections.abc import Generator
9-
from typing import Callable
1010
from typing import TypeVar
1111

1212
import pytest

tests/test_bento_data_source.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import pathlib
2-
from typing import Callable
2+
from collections.abc import Callable
33

44
import pytest
55
from databento.common.dbnstore import FileDataSource

tests/test_common_symbology.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
import json
44
import pathlib
5+
from collections.abc import Callable
56
from collections.abc import Iterable
67
from collections.abc import Sequence
7-
from typing import Callable
88
from typing import NamedTuple
99

1010
import databento_dbn

tests/test_historical_bento.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
import datetime as dt
33
import decimal
44
import zoneinfo
5+
from collections.abc import Callable
56
from io import BytesIO
67
from pathlib import Path
78
from typing import Any
8-
from typing import Callable
99
from typing import Literal
1010
from unittest.mock import MagicMock
1111

tests/test_historical_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from __future__ import annotations
22

33
import pathlib
4-
from typing import Callable
4+
from collections.abc import Callable
55
from unittest.mock import MagicMock
66

77
import databento as db

0 commit comments

Comments
 (0)