Ruff lint surfaced 23 violations across three rules; all addressed:
UP017 (Use datetime.UTC alias):
Replaced 13 sites of datetime.now(timezone.utc) with datetime.now(UTC),
also adjusted from-imports accordingly. UTC is a Python 3.11+ alias for
timezone.utc that ruff's pyupgrade rules prefer.
UP042 (StrEnum):
Replaced `class TagKind(str, Enum)` and `class SkipReason(str, Enum)`
with `class Foo(StrEnum)`. StrEnum was added in Python 3.11 stdlib and
is the modern idiom. Behavior is equivalent for our usage (the .value
attribute, str(member) semantics).
I001 (Import sorting):
Added `known-first-party = ["backend"]` to ruff.toml's [lint.isort] so
ruff groups `backend.*` imports correctly. Without it, ruff treated
them as third-party and demanded a different grouping. The existing
import order is stdlib → third-party → first-party → local relative,
which ruff now accepts.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Per FabledRulebook forgejo.md, toolchain versions live on the runner
image, not in the workflow. Two changes here, paired with the runner
image bump (RUFF_VERSION 0.9.7 -> 0.15.13 in CI-Runner/CI-python):
- Drop "ruff>=0.9,<1.0" from ci.yml's pip install — the runner image's
pre-installed ruff is authoritative now. Previously this constraint
matched the existing 0.9.7 in the image so pip never upgraded.
- Flip ruff.toml's target-version back to py314 now that the runner
has a ruff new enough to know about it.
Next bump path: edit RUFF_VERSION in CI-Runner/CI-python/Dockerfile,
'make push', done. No workflow churn.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The python-ci runner image ships ruff 0.9.7, which only recognizes
target-version values up to py313. Code still runs on Python 3.14;
this only affects which UP-rule suggestions ruff produces.
Durable fix is bumping RUFF_VERSION in CI-Runner/CI-python/Dockerfile
to 0.13+ and re-pushing the runner image — at which point we can flip
this back to py314. Inline comment in ruff.toml flags the future bump.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Forward-looking pin per operator direction ("build for the future and not
rebuild the past"). Touches everywhere a version is named so all
downstream artifacts (Dockerfiles, ruff config, package.json engines)
agree.
Python 3.14 (released Oct 2025) is the current stable. Node 22 is the
most recent LTS line still receiving updates (Maintenance LTS since
Oct 2025); Node 24 (released Apr 2026) goes Active LTS in Oct 2026 and
will be the natural next bump.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Pins runtime and ML deps separately so the regular web image stays lean.
Configures ruff for py312 with bugbear, async, and pyupgrade lints enabled.
psycopg sync driver included up-front for alembic.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>