Author SHA1 Message Date
mathias2784 0f819e649d black
Tests / test_and_lint (push) Successful in 14s
2026-10-18 10:23:53 +02:00
mathias2784 f24e628e5b version bump
Tests / test_and_lint (push) Failing after 13s
2026-10-18 10:22:29 +02:00
mathias2784 0880bdcafd set uvicorn log level to INFO to de-clutter application logs on DEGUG level 2026-10-18 10:21:48 +02:00
mathias2784 5e76bf8a37 Publish workflow (#4)
Tests / test_and_lint (push) Successful in 7s
Reviewed-on: #4
Co-authored-by: Mathias Scheider <mathias2784@web.de>
2026-10-01 19:57:59 +00:00
mathias2784 9f85c0034f Publish workflow (#3)
Tests / test_and_lint (push) Successful in 7s
Publish Package to Gitea / publish (push) Failing after 6s
Reviewed-on: #3
Co-authored-by: Mathias Scheider <mathias2784@web.de>
2026-10-01 19:35:04 +00:00
mathias2784 d56a4cdf34 Publish workflow (#2)
Tests / test_and_lint (push) Successful in 7s
Reviewed-on: #2
Co-authored-by: Mathias Scheider <mathias2784@web.de>
2026-10-01 19:31:35 +00:00
mathias2784 9d13c6ec14 File utils1 (#1)
Tests / test_and_lint (push) Successful in 7s
Reviewed-on: #1
Co-authored-by: Mathias Scheider <mathias2784@web.de>
2026-10-01 19:13:45 +00:00
5 changed files with 65 additions and 4 deletions
+36
View File
@@ -0,0 +1,36 @@
name: Publish Package to Gitea
on:
push:
tags:
- "v*" # This triggers the workflow when you push a tag like v1.0.0
jobs:
publish:
runs-on: ubuntu-latest # Or your specific runner label
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.x"
- name: Install build dependencies
run: |
python -m pip install --upgrade pip
pip install build twine
- name: Build package
run: python -m build
- name: Publish to Gitea PyPI
env:
# These secrets must match the names you created in Gitea
TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }}
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
# REPLACE THIS URL with your actual Gitea PyPI endpoint
TWINE_REPOSITORY_URL: "https://gitea.schneiderserver.site/api/packages/mathias2784/pypi"
run: |
twine upload --repository-url $TWINE_REPOSITORY_URL dist/*
+8 -2
View File
@@ -1,7 +1,7 @@
[project]
name = "utils"
version = "0.1.1"
description = "This is a test version bump with only minor improvements"
version = "0.1.3"
description = "Some hopefully useful utilities to use in everyday coding"
readme = "README.md"
authors = [
{ name = "Mathias Schneider", email = "mathias.schneider@d-fine.com" }
@@ -30,6 +30,12 @@ markers = [
"live: opens a real GUI dialog, intended for local manual testing",
]
[tool.ruff.lint]
# File modes are unreliable in this environment (/mnt/anbau mounts force 0777),
# which makes EXE002 report every file locally. Ignore it deliberately instead of
# relying on a personal global config that CI does not have.
ignore = ["EXE002"]
[build-system]
requires = ["uv_build>=0.12.20,<0.13.0"]
build-backend = "uv_build"
Executable → Regular
+4
View File
@@ -72,6 +72,10 @@ 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)
Executable → Regular
+15
View File
@@ -13,6 +13,7 @@ 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
@@ -20,6 +21,8 @@ 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)
@@ -32,6 +35,8 @@ 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:
@@ -40,6 +45,16 @@ 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 = 3
revision = 5
requires-python = ">=3.14"
[[package]]
@@ -751,7 +751,7 @@ wheels = [
[[package]]
name = "utils"
version = "0.1.1"
version = "0.1.3"
source = { editable = "." }
dependencies = [
{ name = "black" },