From 3c49c9a1334839208f0814b56e2b35d393ec2320 Mon Sep 17 00:00:00 2001 From: Krzysztof kuhy Rudnicki Date: Sat, 10 Oct 2026 08:23:34 +0200 Subject: [PATCH] deps: earned_time 0.6.1 (tutor cutover), ruff 0.17.0 (CPY001 ignored: no copyright policy) Co-Authored-By: Claude Opus 5.5 (1M context) --- .pre-commit-config.yaml | 10 +++++----- pyproject.toml | 3 ++- requirements.txt | 4 ++-- .../tests/test_budget_resolve_reading.py | 12 +++++++++--- 4 files changed, 18 insertions(+), 11 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 621136e..5066755 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -68,7 +68,7 @@ repos: # RUFF - Linter + formatter # =========================================================================== - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.15.2 + rev: v0.17.0 hooks: - id: ruff exclude: ^scripts/file_length/ @@ -110,7 +110,7 @@ repos: - --disable-error-code=list-item additional_dependencies: - types-requests - - earned-time @ git+https://github.com/kuhyx/utils@earned-time-v0.6.0#subdirectory=earned_time + - earned-time @ git+https://github.com/kuhyx/utils@earned-time-v0.6.1#subdirectory=earned_time # =========================================================================== # PYLINT @@ -130,12 +130,12 @@ repos: # (steam_backlog_enforcer._mcp_server). additional_dependencies: - aiohttp==3.14.4 - - earned-time @ git+https://github.com/kuhyx/utils@earned-time-v0.6.0#subdirectory=earned_time - - howlongtobeatpy==1.0.23 + - earned-time @ git+https://github.com/kuhyx/utils@earned-time-v0.6.1#subdirectory=earned_time + - howlongtobeatpy==1.0.24 - mcp==2.3.0 - pytest - requests - - websockets==17.1 + - websockets==17.2 # =========================================================================== # BANDIT - Security linter diff --git a/pyproject.toml b/pyproject.toml index a2e0238..dedf116 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -16,7 +16,7 @@ dependencies = [ "websockets==17.2", # The earner registry (gaming budget terms); stdlib-only, so the root # daemon imports it from the desktop user's site-packages. - "earned-time @ git+https://github.com/kuhyx/utils@earned-time-v0.6.0#subdirectory=earned_time", + "earned-time @ git+https://github.com/kuhyx/utils@earned-time-v0.6.1#subdirectory=earned_time", ] # Optional extras. The `mcp` group is ONLY needed by the MCP server @@ -54,6 +54,7 @@ ignore = [ "COM812", # formatter handles this "ISC001", # formatter may create these "S603", # prone to false positives + "CPY001", # personal repo, no copyright policy (ruff 0.17 made CPY001 stable under select=ALL) # Conflicts with SIM117. A `pytest.raises` that needs patches in scope has # no legal form: combine them into one `with` and PT012 objects to the # extra context managers; nest `raises` inside and SIM117 objects to the diff --git a/requirements.txt b/requirements.txt index b49ee0e..0b09d74 100644 --- a/requirements.txt +++ b/requirements.txt @@ -5,7 +5,7 @@ aiohttp==3.14.4 bandit==1.9.4 codespell==2.4.3 coverage==7.16.2 -earned-time @ git+https://github.com/kuhyx/utils@earned-time-v0.6.0#subdirectory=earned_time +earned-time @ git+https://github.com/kuhyx/utils@earned-time-v0.6.1#subdirectory=earned_time howlongtobeatpy==1.0.24 mcp==2.3.0 mypy==2.4.0 @@ -18,6 +18,6 @@ pytest-sugar==1.1.1 pytest-timeout==2.4.0 pytest-xdist==3.8.0 requests==2.34.2 -ruff==0.16.10 +ruff==0.17.0 types-requests==2.33.0.20261006 websockets==17.2 diff --git a/steam_backlog_enforcer/tests/test_budget_resolve_reading.py b/steam_backlog_enforcer/tests/test_budget_resolve_reading.py index c0becbb..21bf954 100644 --- a/steam_backlog_enforcer/tests/test_budget_resolve_reading.py +++ b/steam_backlog_enforcer/tests/test_budget_resolve_reading.py @@ -41,13 +41,19 @@ _HOUR = 3600.0 def _later_penalised(day: date) -> list[earned_time.Earner]: - """Earners in force on ``day`` whose penalty starts after reading's cut.""" - cut = earned_time.READING.penalty_from + """Earners in force on ``day`` whose penalty starts after reading's cut. + + The start is ``penalty_start(e, None)``: no ledger is wired here, so an + earner nobody has confirmed (``confirmed_on`` unset) has not started its + penalty yet -- the same fail-closed rule the budget itself applies. + """ + cut = earned_time.penalty_start(earned_time.READING, None) assert cut is not None + starts = {e.name: earned_time.penalty_start(e, None) for e in registry_for(day)} return [ e for e in registry_for(day) - if e.penalty_from is not None and cut < e.penalty_from <= day + if (start := starts[e.name]) is not None and cut < start <= day ]