8 Commits
Author SHA1 Message Date
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
5 changed files with 4 additions and 65 deletions
-36
View File
@@ -1,36 +0,0 @@
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/*
+2 -8
View File
@@ -1,7 +1,7 @@
[project]
name = "utils"
version = "0.1.3"
description = "Some hopefully useful utilities to use in everyday coding"
version = "0.1.1"
description = "This is a test version bump with only minor improvements"
readme = "README.md"
authors = [
{ name = "Mathias Schneider", email = "mathias.schneider@d-fine.com" }
@@ -30,12 +30,6 @@ 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"
Regular → Executable
-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)
Regular → Executable
-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" },