From 673281ed71cce97277edb2b251dfaf7377179597 Mon Sep 17 00:00:00 2001 From: Alexandre Detiste Date: Wed, 18 Feb 2026 10:48:45 +0100 Subject: [PATCH 1/2] use tomllib from standard library on Python3.11+ --- apps/auracast.py | 9 +++++++-- pyproject.toml | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/apps/auracast.py b/apps/auracast.py index 0a86b01..59cedbb 100644 --- a/apps/auracast.py +++ b/apps/auracast.py @@ -24,13 +24,18 @@ import dataclasses import functools import logging import secrets +import sys from collections.abc import AsyncGenerator, Awaitable, Callable, Iterable, Sequence from typing import ( Any, ) import click -import tomli + +if sys.version_info >= (3, 11): + import tomllib +else: + import tomli as tomllib try: import lc3 # type: ignore # pylint: disable=E0401 @@ -114,7 +119,7 @@ def parse_broadcast_list(filename: str) -> Sequence[Broadcast]: broadcasts: list[Broadcast] = [] with open(filename, "rb") as config_file: - config = tomli.load(config_file) + config = tomllib.load(config_file) for broadcast in config.get("broadcasts", []): sources = [] for source in broadcast.get("sources", []): diff --git a/pyproject.toml b/pyproject.toml index 60c7f12..7fbb3ac 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -37,7 +37,7 @@ dependencies = [ "pyserial-asyncio >= 0.5; platform_system!='Emscripten'", "pyserial >= 3.5; platform_system!='Emscripten'", "pyusb >= 1.2; platform_system!='Emscripten'", - "tomli ~= 2.2.1; platform_system!='Emscripten'", + "tomli ~= 2.2.1; platform_system!='Emscripten'; python_version<'3.11'", "websockets >= 15.0.1; platform_system!='Emscripten'", ] From f8aa3091118034e6bb01762d8028bd943b41f1ad Mon Sep 17 00:00:00 2001 From: Alexandre Detiste Date: Wed, 18 Feb 2026 16:39:09 +0100 Subject: [PATCH 2/2] fix pyproject.toml format --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 7fbb3ac..601c336 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -37,7 +37,7 @@ dependencies = [ "pyserial-asyncio >= 0.5; platform_system!='Emscripten'", "pyserial >= 3.5; platform_system!='Emscripten'", "pyusb >= 1.2; platform_system!='Emscripten'", - "tomli ~= 2.2.1; platform_system!='Emscripten'; python_version<'3.11'", + "tomli ~= 2.2.1; platform_system!='Emscripten' and python_version<'3.11'", "websockets >= 15.0.1; platform_system!='Emscripten'", ]