deps: flutter 3.47.7, crdt-sync 0.9.2, freedays 0.3.1, pydantic 2.14.0, ruff 0.17.0
Some checks failed
dependency freshness / dependencies on newest stable (push) Has been cancelled
file-length / file length <= 250 lines (push) Has been cancelled
md-naming / markdown naming convention (push) Has been cancelled
pre-commit / pre-commit (${{ matrix.group }}) (mypy, mypy, ) (push) Has been cancelled
pre-commit / pre-commit (${{ matrix.group }}) (pylint, pylint, ) (push) Has been cancelled
pre-commit / pre-commit (${{ matrix.group }}) (rest, , mypy,pylint) (push) Has been cancelled
Tests / test (push) Has been cancelled
release-apk / release (APK) (push) Has been cancelled
repo-contract / repo contract (push) Has been cancelled

ruff 0.17 stabilised CPY001 (ignored: no per-file copyright headers here),
ISC004 and ICN001 (autofixed).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015npsYVB2PdtWkG7MPAi4tn
This commit is contained in:
Krzysztof Rudnicki 2026-10-10 20:27:52 +02:00
parent a118120047
commit f2606fe0ca
11 changed files with 37 additions and 27 deletions

2
.fvmrc
View File

@ -1,3 +1,3 @@
{ {
"flutter": "3.47.6" "flutter": "3.47.7"
} }

View File

@ -60,7 +60,7 @@ jobs:
- uses: subosito/flutter-action@v2 - uses: subosito/flutter-action@v2
with: with:
flutter-version: 3.47.6 flutter-version: 3.47.7
channel: stable channel: stable
cache: true cache: true

View File

@ -2,7 +2,7 @@ name: diet_guard_app
description: "Companion phone app for diet_guard: log meals on the go." description: "Companion phone app for diet_guard: log meals on the go."
publish_to: 'none' publish_to: 'none'
version: 1.0.110+1 version: 1.0.111+1
environment: environment:
sdk: ^3.12.2 sdk: ^3.12.2

View File

@ -72,8 +72,10 @@ def bodyfat_lines(view: BodyView) -> list[str]:
return ["Body fat: not logged (log one to use Katch-McArdle)."] return ["Body fat: not logged (log one to use Katch-McArdle)."]
day = max(view.body_fats) day = max(view.body_fats)
return [ return [
f"Body fat: {_num(view.body_fats[day], 1)}% on {day} " (
f"({len(view.body_fats)} readings) -- targets use Katch-McArdle." f"Body fat: {_num(view.body_fats[day], 1)}% on {day} "
f"({len(view.body_fats)} readings) -- targets use Katch-McArdle."
)
] ]
@ -85,8 +87,10 @@ def bmi_lines(view: BodyView) -> list[str]:
low, high = view.numbers.healthy low, high = view.numbers.healthy
return [ return [
f"BMI {_num(bmi.bmi, 1)} ({bmi.category})", f"BMI {_num(bmi.bmi, 1)} ({bmi.category})",
f"Healthy weight for your height (BMI 18.5-24.9): " (
f"{_num(low, 1)}-{_num(high, 1)} kg", f"Healthy weight for your height (BMI 18.5-24.9): "
f"{_num(low, 1)}-{_num(high, 1)} kg"
),
f"BMI Prime {_num(bmi.prime, 2)} Trefethen {_num(bmi.trefethen, 1)}", f"BMI Prime {_num(bmi.prime, 2)} Trefethen {_num(bmi.trefethen, 1)}",
*_wrap(BMI_PRIME_NOTE, " "), *_wrap(BMI_PRIME_NOTE, " "),
*_wrap(TREFETHEN_NOTE, " "), *_wrap(TREFETHEN_NOTE, " "),
@ -141,8 +145,10 @@ def target_lines(view: BodyView) -> list[str]:
target = view.numbers.target target = view.numbers.target
if target.kcal is None or target.tdee is None: if target.kcal is None or target.tdee is None:
return [ return [
f"{goal_sentence(view.goal)}: no workouts published yet " (
"(the PC publishes them on sync)." f"{goal_sentence(view.goal)}: no workouts published yet "
"(the PC publishes them on sync)."
)
] ]
lines = [f"{goal_sentence(view.goal)} eat {target.kcal} kcal a day."] lines = [f"{goal_sentence(view.goal)} eat {target.kcal} kcal a day."]
if target.below_floor: if target.below_floor:

View File

@ -103,8 +103,10 @@ def eaten_grams(
if unit is None: if unit is None:
return ( return (
portion.count * DEFAULT_ITEM_GRAMS, portion.count * DEFAULT_ITEM_GRAMS,
f"(assumed {DEFAULT_ITEM_GRAMS:g} g per item; " (
"pass --grams to be exact)", f"(assumed {DEFAULT_ITEM_GRAMS:g} g per item; "
"pass --grams to be exact)"
),
) )
return portion.count * unit, None return portion.count * unit, None
return portion.grams, None return portion.grams, None

View File

@ -7,7 +7,7 @@ through ``sys.modules`` instead of binding it at import time.
from __future__ import annotations from __future__ import annotations
import datetime import datetime as dt
import json import json
from typing import TYPE_CHECKING from typing import TYPE_CHECKING
from unittest.mock import patch from unittest.mock import patch
@ -28,7 +28,7 @@ from diet_guard.tests._kuchnia_fakes import (
if TYPE_CHECKING: if TYPE_CHECKING:
from pathlib import Path from pathlib import Path
DAY = datetime.date(2026, 8, 22) DAY = dt.date(2026, 8, 22)
@pytest.fixture @pytest.fixture

View File

@ -15,7 +15,7 @@ is testable with no thread at all.
from __future__ import annotations from __future__ import annotations
import datetime import datetime as dt
import queue import queue
from types import SimpleNamespace from types import SimpleNamespace
from typing import TYPE_CHECKING from typing import TYPE_CHECKING
@ -38,7 +38,7 @@ if TYPE_CHECKING:
from diet_guard._estimator import Nutrition from diet_guard._estimator import Nutrition
DAY = datetime.date(2026, 8, 22) DAY = dt.date(2026, 8, 22)
def _dish(name: str = "Kaszotto", priority: int = 1) -> Dish: def _dish(name: str = "Kaszotto", priority: int = 1) -> Dish:
@ -68,7 +68,7 @@ class TestWorker:
def test_a_raising_call_still_feeds_the_queue(self) -> None: def test_a_raising_call_still_feeds_the_queue(self) -> None:
# Without the finally, the poll waits forever with the button disabled # Without the finally, the poll waits forever with the button disabled
# and the user cannot get out from behind the lock. # and the user cannot get out from behind the lock.
def boom(_day: datetime.date) -> tuple[Sequence[Dish], str | None]: def boom(_day: dt.date) -> tuple[Sequence[Dish], str | None]:
msg = "kaboom" msg = "kaboom"
raise RuntimeError(msg) raise RuntimeError(msg)

View File

@ -9,7 +9,7 @@ that happens, so these assert on **call count** instead.
from __future__ import annotations from __future__ import annotations
import datetime import datetime as dt
from unittest.mock import patch from unittest.mock import patch
from diet_guard import _kuchnia_config, _kuchnia_import from diet_guard import _kuchnia_config, _kuchnia_import
@ -21,7 +21,7 @@ from diet_guard._kuchnia_parse import Dish
from diet_guard._kuchnia_spread import SlottedDish from diet_guard._kuchnia_spread import SlottedDish
from diet_guard._state_today import today_entries, today_total_kcal from diet_guard._state_today import today_entries, today_total_kcal
DAY = datetime.date(2026, 8, 22) DAY = dt.date(2026, 8, 22)
def _dish(name: str = "Kaszotto", kcal: float = 391.0, priority: int = 1) -> Dish: def _dish(name: str = "Kaszotto", kcal: float = 391.0, priority: int = 1) -> Dish:
@ -150,7 +150,7 @@ class TestRefreshOnce:
return_value=([_dish()], None), return_value=([_dish()], None),
) as refresh: ) as refresh:
_kuchnia_import.refresh_delivery_once(DAY) _kuchnia_import.refresh_delivery_once(DAY)
_kuchnia_import.refresh_delivery_once(DAY + datetime.timedelta(days=1)) _kuchnia_import.refresh_delivery_once(DAY + dt.timedelta(days=1))
assert refresh.call_count == 2 assert refresh.call_count == 2
def test_an_outage_does_not_suppress_the_retry(self) -> None: def test_an_outage_does_not_suppress_the_retry(self) -> None:

View File

@ -10,7 +10,7 @@ The endpoint shape here is not the obvious one: ``.../deliveries/{id}/details``
from __future__ import annotations from __future__ import annotations
import datetime import datetime as dt
from unittest.mock import patch from unittest.mock import patch
import pytest import pytest
@ -28,7 +28,7 @@ from diet_guard.tests._kuchnia_fakes import (
write_credentials, write_credentials,
) )
DAY = datetime.date(2026, 8, 22) DAY = dt.date(2026, 8, 22)
@pytest.fixture @pytest.fixture

View File

@ -5,8 +5,8 @@ description = "Tkinter/systemd log-to-unlock meal gate with calorie/macro budget
requires-python = ">=3.14" requires-python = ">=3.14"
dependencies = [ dependencies = [
"gatelock @ git+https://github.com/kuhyx/utils@gatelock-v0.9.0#subdirectory=gatelock", "gatelock @ git+https://github.com/kuhyx/utils@gatelock-v0.9.0#subdirectory=gatelock",
"crdt-sync @ git+https://github.com/kuhyx/utils@crdt-sync-v0.9.1#subdirectory=crdt-sync", "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.3.0#subdirectory=freedays", "freedays @ git+https://github.com/kuhyx/utils@freedays-v0.3.1#subdirectory=freedays",
"defusedxml==0.7.1", "defusedxml==0.7.1",
"requests==2.34.2", "requests==2.34.2",
] ]
@ -37,6 +37,8 @@ ignore = [
"COM812", "COM812",
"ISC001", "ISC001",
"S603", "S603",
# Stabilised in ruff 0.17; this personal repo carries no per-file copyright headers.
"CPY001",
] ]
fixable = ["ALL"] fixable = ["ALL"]
unfixable = [] unfixable = []

View File

@ -3,14 +3,14 @@
bandit==1.9.4 bandit==1.9.4
codespell==2.4.3 codespell==2.4.3
coverage==7.16.2 coverage==7.16.2
crdt-sync @ git+https://github.com/kuhyx/utils@crdt-sync-v0.9.1#subdirectory=crdt-sync crdt-sync @ git+https://github.com/kuhyx/utils@crdt-sync-v0.9.2#subdirectory=crdt-sync
defusedxml==0.7.1 defusedxml==0.7.1
freedays @ git+https://github.com/kuhyx/utils@freedays-v0.3.0#subdirectory=freedays freedays @ git+https://github.com/kuhyx/utils@freedays-v0.3.1#subdirectory=freedays
gatelock @ git+https://github.com/kuhyx/utils@gatelock-v0.9.0#subdirectory=gatelock gatelock @ git+https://github.com/kuhyx/utils@gatelock-v0.9.0#subdirectory=gatelock
mcp==2.3.0 mcp==2.3.0
mypy==2.4.0 mypy==2.4.0
pre-commit==4.6.2 pre-commit==4.6.2
pydantic==2.13.5 pydantic==2.14.0
pylint==4.1.2 pylint==4.1.2
pytest==9.1.1 pytest==9.1.1
pytest-cov==7.1.0 pytest-cov==7.1.0
@ -19,4 +19,4 @@ pytest-sugar==1.1.1
pytest-xdist==3.8.0 pytest-xdist==3.8.0
pytest-xvfb==3.1.1 pytest-xvfb==3.1.1
requests==2.34.2 requests==2.34.2
ruff==0.16.10 ruff==0.17.0