Repository navigation
ci: target Python 3.10 in ruff to fix the failing lint step - #188
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The backend CI "Check convention" step failed on
mainwith 16UP017errors ("usedatetime.UTCalias"). The scrapers CI runs the same unpinnedruff 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.tomlandscrapers/ruff.tomlwithtarget-version = "py310", so ruff judges the code against the Python it actually runs on. No application code changes.Testing
ruff check .passes inbackend/and inscrapers/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 exampleruff==0.17.0) would prevent that; left out here to keep the fix minimal.