Skip to content

ci: target Python 3.10 in ruff to fix the failing lint step - #188

Merged
husthunterpy01 merged 1 commit into
mainfrom
fix/martin/ruff-target-version
Oct 11, 2026
Merged

husthunterpy01 merged 1 commit into
mainfrom
fix/martin/ruff-target-version

Conversation

@husthunterpy01

Copy link
Copy Markdown
Owner

Problem

The backend CI "Check convention" step failed on main with 16 UP017 errors ("use datetime.UTC alias"). The scrapers CI runs the same unpinned ruff check . and fails the same way.

CI installs the latest ruff each run. Ruff 0.17.0 assumes a newer Python when the project does not say which one it targets, and now suggests datetime.UTC. That alias only exists in Python 3.11+, and both the backend and the scrapers run on Python 3.10 (CI and the Docker image), so applying the "fix" would break the app.

Fix

Add backend/ruff.toml and scrapers/ruff.toml with target-version = "py310", so ruff judges the code against the Python it actually runs on. No application code changes.

Testing

  • Reproduced the 16 backend errors with ruff 0.17.0, then checked that ruff check . passes in backend/ and in scrapers/ with both 0.17.0 and 0.16.7.

Note

The workflows still run an unpinned pip install ruff, so a future release can add new rules and fail CI again without any code change. Pinning the version (for example ruff==0.17.0) would prevent that; left out here to keep the fix minimal.

@husthunterpy01
husthunterpy01 merged commit f20ce22 into main Oct 11, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant