Skip to content

Commit 017371e

Browse files
committed
Update to mypy 1.16 and add typecheck to CI
1 parent 13cf1ad commit 017371e

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

.github/workflows/test.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,7 @@ jobs:
1818
run: make .venv
1919
- name: Run lint
2020
run: make lint
21+
- name: Run typecheck
22+
run: make typecheck
2123
- name: Run tests
2224
run: make test

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ dependencies = [
2828
debug = ["bluetooth-data-tools ~= 1.15"]
2929
dev = [
3030
"async-timer ~= 1.1.6",
31-
"mypy ~= 1.15.0",
31+
"mypy ~= 1.16.0",
3232
"pytest ~= 8.3",
3333
"pytest-asyncio ~= 1.0.0",
3434
"python-dbusmock ~= 0.34.3",

src/pb_ble/messages.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,14 @@ def unpack_pnp_id(data: bytes) -> Tuple[Literal["BT", "USB"], int, int, int]:
102102
:return: Tuple containing the vendor ID type (`BT` or `USB`), the vendor
103103
ID, the product ID and the product revision.
104104
"""
105+
vid_type: int
106+
vid: int
107+
pid: int
108+
rev: int
109+
105110
vid_type, vid, pid, rev = unpack("<BHHH", data)
106-
vid_type = "BT" if vid_type else "USB"
107-
return vid_type, vid, pid, rev
111+
112+
return "BT" if vid_type else "USB", vid, pid, rev
108113

109114

110115
def pack_pnp_id(

0 commit comments

Comments
 (0)