chore: bump ruff to 0.14.1 and fix new lint warnings (fixes #4780) #4782
+21
−17
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.
Description
Updates ruff from 0.6.9 to 0.14.1 to catch newer warnings that are triggered only in newer versions, as requested in the linked issue. The newer ruff version introduced additional PLC0415 warnings for imports that are intentionally placed inside functions/try-except blocks for conditional behaviour.
Added
# noqa: PLC0415
to the conditional Django import indocs/examples/django/manage.py
since this import is intentionally insidemain()
with try/except to provide a helpful ImportError when Django is not installed.Fixes #4780
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
tox -e ruff
locally to verify ruff linting passes with the new versionDoes This PR Require a Contrib Repo Change?
Checklist: