Author SHA1 Message Date
mathias2784 5e2842e9b5 Merge branch 'master' into publish-workflow
Tests / test_and_lint (push) Successful in 8s
Publish Package to Gitea / publish (push) Failing after 7s
2026-10-01 21:57:35 +02:00
mathias2784 2ad038211c publish workflow fix
Tests / test_and_lint (push) Successful in 8s
2026-10-01 21:55:01 +02:00
mathias2784 fd36654d58 pyproject.toml
Tests / test_and_lint (push) Successful in 8s
2026-10-01 21:33:28 +02:00
mathias2784 0197339eb0 publish workflow
Tests / test_and_lint (push) Successful in 7s
2026-10-01 21:29:55 +02:00
mathias2784 34186463fc ignore EXE002 in project ruff config and drop exec bits from two python files
Tests / test_and_lint (push) Successful in 6s
2026-10-01 21:11:31 +02:00
mathias2784 5af8d7f443 ignore EXE002 in project ruff config and drop exec bits from two python files 2026-10-01 21:11:11 +02:00
mathias2784 2349439fcc uv add ruff black
Tests / test_and_lint (push) Failing after 7s
2026-10-01 20:45:16 +02:00
mathias2784 d20c0a4076 headless-safe filedialog tests with optional live dialog tests and ruff fixes
Tests / test_and_lint (push) Failing after 7s
2026-10-01 20:36:59 +02:00
mathias2784 605f423ff0 gitea workflow
Tests / test_and_lint (push) Failing after 6s
2026-10-01 17:27:50 +02:00
mathias2784 e78d55759c fix some tests concerning logging 2026-10-01 17:27:29 +02:00
mathias2784 0cb912466e test data 2026-10-01 17:18:24 +02:00
mathias2784 36eff17046 filedialogs 2026-10-01 17:18:04 +02:00
mathias2784 5d34b8eeaf misc 2026-10-01 17:17:36 +02:00
mathias2784 6696ff900e pyproject update 2026-10-01 17:17:07 +02:00
4 changed files with 3 additions and 22 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
[project]
name = "utils"
version = "0.1.3"
version = "0.1.2"
description = "Some hopefully useful utilities to use in everyday coding"
readme = "README.md"
authors = [
-4
View File
@@ -72,10 +72,6 @@ class LoggingSettings(BaseSettingsConfig):
root_logger = logging.getLogger()
root_logger.setLevel(level)
# Keep Uvicorn's own debug output from following the application's level.
for logger_name in ("uvicorn", "uvicorn.error", "uvicorn.access"):
logging.getLogger(logger_name).setLevel(logging.INFO)
# Replace and close existing handlers to avoid duplicate output and resource leaks.
for handler in root_logger.handlers[:]:
root_logger.removeHandler(handler)
-15
View File
@@ -13,7 +13,6 @@ from uvicorn.logging import DefaultFormatter
from utils.logging_config import LoggingSettings
SECONDS_PER_DAY = 24 * 60 * 60
UVICORN_LOGGER_NAMES = ("uvicorn", "uvicorn.error", "uvicorn.access")
@pytest.fixture
@@ -21,8 +20,6 @@ def restore_root_logger() -> Generator[None]:
root = logging.getLogger()
old_handlers = root.handlers[:]
old_level = root.level
uvicorn_loggers = [logging.getLogger(name) for name in UVICORN_LOGGER_NAMES]
old_uvicorn_levels = [logger.level for logger in uvicorn_loggers]
for handler in old_handlers:
root.removeHandler(handler)
@@ -35,8 +32,6 @@ def restore_root_logger() -> Generator[None]:
for handler in old_handlers:
root.addHandler(handler)
root.setLevel(old_level)
for logger, level in zip(uvicorn_loggers, old_uvicorn_levels):
logger.setLevel(level)
def test_sets_valid_log_level(restore_root_logger: None) -> None:
@@ -45,16 +40,6 @@ def test_sets_valid_log_level(restore_root_logger: None) -> None:
assert logging.getLogger().level == logging.DEBUG
def test_keeps_uvicorn_loggers_at_info_with_debug_root(
restore_root_logger: None,
) -> None:
LoggingSettings(LOG_LEVEL="DEBUG", LOG_TO_FILE=False)
assert all(
logging.getLogger(name).level == logging.INFO for name in UVICORN_LOGGER_NAMES
)
def test_invalid_log_level_falls_back_to_info(restore_root_logger: None) -> None:
with patch("utils.logging_config.logger.error") as log_error:
LoggingSettings(LOG_LEVEL="NOT_A_LEVEL", LOG_TO_FILE=False)
Generated
+2 -2
View File
@@ -1,5 +1,5 @@
version = 1
revision = 5
revision = 3
requires-python = ">=3.14"
[[package]]
@@ -751,7 +751,7 @@ wheels = [
[[package]]
name = "utils"
version = "0.1.3"
version = "0.1.1"
source = { editable = "." }
dependencies = [
{ name = "black" },