Skip to content

Commit adaa367

Browse files
hugovkAnrijs
andauthored
Add support for Python 3.12-3.14 and drop EOL Python 3.9 (#66)
* Add support for Python 3.12-3.14 * Add python_requires to setup.py * ruff check --select UP --fix * Drop support for EOL Python 3.9 --------- Co-authored-by: Anrijs <Anrijs@users.noreply.github.com>
1 parent b14921f commit adaa367

5 files changed

Lines changed: 11 additions & 14 deletions

File tree

.github/workflows/python-package.yml

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,7 @@
33

44
name: Python package
55

6-
on:
7-
push:
8-
branches: [ "master" ]
9-
pull_request:
10-
branches: [ "master" ]
6+
on: [push, pull_request, workflow_dispatch]
117

128
jobs:
139
build:
@@ -16,12 +12,12 @@ jobs:
1612
strategy:
1713
fail-fast: false
1814
matrix:
19-
python-version: ["3.9", "3.10", "3.11"]
15+
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
2016

2117
steps:
22-
- uses: actions/checkout@v3
18+
- uses: actions/checkout@v6
2319
- name: Set up Python ${{ matrix.python-version }}
24-
uses: actions/setup-python@v3
20+
uses: actions/setup-python@v6
2521
with:
2622
python-version: ${{ matrix.python-version }}
2723
- name: Install dependencies

aranet4/client.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import re
66
import struct
77
import math
8-
from typing import List, NamedTuple
8+
from typing import NamedTuple
99

1010
from bleak import BleakClient
1111
from bleak import BleakScanner
@@ -547,7 +547,7 @@ class Record:
547547
version: str
548548
records_on_device: int
549549
filter: Filter
550-
value: List[RecordItem] = field(default_factory=list)
550+
value: list[RecordItem] = field(default_factory=list)
551551

552552

553553
@dataclass
@@ -1103,7 +1103,7 @@ async def stop(self):
11031103
await self.scanner.stop()
11041104

11051105

1106-
async def _find_nearby(detect_callback: callable, duration: int) -> List[BLEDevice]:
1106+
async def _find_nearby(detect_callback: callable, duration: int) -> list[BLEDevice]:
11071107
scanner = Aranet4Scanner(detect_callback)
11081108
await scanner.start()
11091109
await asyncio.sleep(duration)

examples/influx/import.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def main(argv):
2828
results = []
2929

3030
device_name = argv[1]
31-
with open(file=argv[0], mode="r", encoding="utf-8") as file:
31+
with open(file=argv[0], encoding="utf-8") as file:
3232
lines = file.readlines()
3333

3434
for ln in lines:

setup.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import setuptools
22

3-
with open(file="README.md", mode="r", encoding="utf-8") as file:
3+
with open(file="README.md", encoding="utf-8") as file:
44
long_description = file.read()
55

66
setuptools.setup(
@@ -11,6 +11,7 @@
1111
long_description_content_type="text/markdown",
1212
url="https://github.com/Anrijs/Aranet4-Python",
1313
packages=setuptools.find_packages(),
14+
python_requires=">=3.10",
1415
classifiers=[
1516
"Programming Language :: Python",
1617
"Programming Language :: Python :: 3",

tests/test_csv.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
def build_data():
1515
log_filter = client.Filter(1, 14, True, True, True, True, True, True, True, True)
1616
records = client.Record("mock_device", "v1234", 14, log_filter)
17-
with open(file=data_file, mode="r", encoding="utf-8") as csv_file:
17+
with open(file=data_file, encoding="utf-8") as csv_file:
1818
reader = csv.DictReader(csv_file)
1919
for row in reader:
2020
records.value.append(client.RecordItem(**row))

0 commit comments

Comments
 (0)