Pin earned-time v0.19.0 (focus project)

Tests isolate FOCUS_PROJECT_DATA so a live project never leaks in.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WzxdWYcmik6APnHfc9gEVy
This commit is contained in:
Krzysztof Rudnicki 2026-11-02 08:34:03 +01:00
parent aa56bc219e
commit 124f0506e2
5 changed files with 14 additions and 8 deletions

View File

@ -137,7 +137,7 @@ repos:
# than merely an old one.
- gatelock @ git+https://github.com/kuhyx/utils@gatelock-v0.11.0#subdirectory=gatelock
- crdt-sync @ git+https://github.com/kuhyx/utils@crdt-sync-v0.9.2#subdirectory=crdt-sync
- earned-time @ git+https://github.com/kuhyx/utils@earned-time-v0.18.0#subdirectory=earned_time
- earned-time @ git+https://github.com/kuhyx/utils@earned-time-v0.19.0#subdirectory=earned_time
- freedays @ git+https://github.com/kuhyx/utils@freedays-v0.4.0#subdirectory=freedays
- sickdays @ git+https://github.com/kuhyx/utils@sickdays-v0.3.0#subdirectory=sickdays
# Same pin as workout_app/tools/render_finish_chime.sh installs.
@ -160,7 +160,7 @@ repos:
# than merely an old one.
- gatelock @ git+https://github.com/kuhyx/utils@gatelock-v0.11.0#subdirectory=gatelock
- crdt-sync @ git+https://github.com/kuhyx/utils@crdt-sync-v0.9.2#subdirectory=crdt-sync
- earned-time @ git+https://github.com/kuhyx/utils@earned-time-v0.18.0#subdirectory=earned_time
- earned-time @ git+https://github.com/kuhyx/utils@earned-time-v0.19.0#subdirectory=earned_time
- freedays @ git+https://github.com/kuhyx/utils@freedays-v0.4.0#subdirectory=freedays
- sickdays @ git+https://github.com/kuhyx/utils@sickdays-v0.3.0#subdirectory=sickdays
- mcp>=2,<3

View File

@ -10,7 +10,7 @@ dependencies = [
"gatelock @ git+https://github.com/kuhyx/utils@gatelock-v0.11.0#subdirectory=gatelock",
"crdt-sync @ git+https://github.com/kuhyx/utils@crdt-sync-v0.9.2#subdirectory=crdt-sync",
"freedays @ git+https://github.com/kuhyx/utils@freedays-v0.4.0#subdirectory=freedays",
"earned-time @ git+https://github.com/kuhyx/utils@earned-time-v0.18.0#subdirectory=earned_time",
"earned-time @ git+https://github.com/kuhyx/utils@earned-time-v0.19.0#subdirectory=earned_time",
"sickdays @ git+https://github.com/kuhyx/utils@sickdays-v0.3.0#subdirectory=sickdays",
]

View File

@ -4,7 +4,7 @@ bandit==1.9.4
codespell==2.4.3
coverage==7.17.0
crdt-sync @ git+https://github.com/kuhyx/utils@crdt-sync-v0.9.2#subdirectory=crdt-sync
earned-time @ git+https://github.com/kuhyx/utils@earned-time-v0.18.0#subdirectory=earned_time
earned-time @ git+https://github.com/kuhyx/utils@earned-time-v0.19.0#subdirectory=earned_time
freedays @ git+https://github.com/kuhyx/utils@freedays-v0.4.0#subdirectory=freedays
gatelock @ git+https://github.com/kuhyx/utils@gatelock-v0.11.0#subdirectory=gatelock
mcp==2.3.0

View File

@ -215,3 +215,9 @@ def _no_real_ntp() -> Iterator[None]:
"""
with patch("screen_locker._time_check._query_ntp_offset", return_value=None):
yield
@pytest.fixture(autouse=True)
def _no_live_focus_project(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> None:
"""No live focus project reshapes the registry (earned_time >= 0.19)."""
monkeypatch.setenv("FOCUS_PROJECT_DATA", str(tmp_path / "focus_project"))

View File

@ -21,7 +21,7 @@ import pytest
from screen_locker import _sync_client
from screen_locker._degraded_sources import clear_degraded_sources
from screen_locker._earned import flat_earners
from screen_locker._earned import watched_earners
from screen_locker.tests._gatelock_fixtures import (
FAKE_OUTPUTS,
TWO_OUTPUTS,
@ -183,8 +183,8 @@ def _isolate_state_files(tmp_path: Path) -> Iterator[None]:
yield
# Every registered flat earner's live-pass stamp, so a future one is seeded too.
_SEEDED_STAMPS = ("last_reset_date", *(f"{e.name}_bonus_date" for e in flat_earners()))
# Every registry's flat earners (a live focus project hides some today).
_BONUS = [f"{e.name}_bonus_date" for e in watched_earners() if e.kind == "flat"]
@pytest.fixture(autouse=True)
@ -200,7 +200,7 @@ def _isolate_shutdown_base(tmp_path: Path) -> Iterator[None]:
"""
target = tmp_path / "shutdown_base.json"
today = datetime.now(tz=UTC).strftime("%Y-%m-%d")
target.write_text(json.dumps(dict.fromkeys(_SEEDED_STAMPS, today)))
target.write_text(json.dumps(dict.fromkeys(["last_reset_date", *_BONUS], today)))
with (
patch("screen_locker._constants.SHUTDOWN_BASE_FILE", target),
patch("screen_locker._startup_checks.SHUTDOWN_BASE_FILE", target),