Migrate from Poetry and pyenv to uv

This commit is contained in:
2026-10-12 15:48:26 +02:00
parent c399a6aed3
commit c69f5f9166
93 changed files with 13068 additions and 2401 deletions
+11 -6
View File
@@ -15,7 +15,6 @@ from src.constants import (
get_version,
)
# ---------------------------------------------------------------------------
# get_version()
# ---------------------------------------------------------------------------
@@ -42,15 +41,19 @@ def test_get_version_fallback_when_toml_missing(tmp_path: Path) -> None:
assert len(result) > 0
def test_get_version_unknown_fallback(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> None:
def test_get_version_unknown_fallback(
tmp_path: Path, monkeypatch: pytest.MonkeyPatch
) -> None:
"""get_version() returns '0.0.0-unknown' when all sources are unavailable."""
missing = tmp_path / "nonexistent.toml"
monkeypatch.setattr("src.constants._PYPROJECT_PATH", missing)
# Patch _version import to also fail
with patch("src.constants.Path.write_text", side_effect=OSError):
with patch.dict("sys.modules", {"src._version": None}):
result = get_version()
with (
patch("src.constants.Path.write_text", side_effect=OSError),
patch.dict("sys.modules", {"src._version": None}),
):
result = get_version()
assert isinstance(result, str)
@@ -131,7 +134,9 @@ def test_app_title_dev_suffix_when_debug(monkeypatch: pytest.MonkeyPatch) -> Non
assert title.endswith("-DEV")
def test_app_title_no_dev_suffix_when_not_debug(monkeypatch: pytest.MonkeyPatch) -> None:
def test_app_title_no_dev_suffix_when_not_debug(
monkeypatch: pytest.MonkeyPatch,
) -> None:
"""APP_TITLE does not end with '-DEV' when ENV_DEBUG is False."""
import src.constants as consts