Skip to content

Replace isort with ruff#123

Merged
rowanseymour merged 1 commit intomainfrom
replace-isort-with-ruff
Apr 2, 2026
Merged

Replace isort with ruff#123
rowanseymour merged 1 commit intomainfrom
replace-isort-with-ruff

Conversation

@rowanseymour
Copy link
Copy Markdown
Contributor

Summary

  • Remove isort dependency and use ruff's built-in import sorting (I rule) instead
  • Add [tool.ruff.lint.isort] config with combine-as-imports and known-first-party
  • Remove separate isort CI step (now covered by ruff check)

Copilot AI review requested due to automatic review settings April 2, 2026 21:40
@rowanseymour rowanseymour merged commit d10c31d into main Apr 2, 2026
10 checks passed
@codecov-commenter
Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.79%. Comparing base (53e909c) to head (b6ee49c).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #123   +/-   ##
=======================================
  Coverage   99.79%   99.79%           
=======================================
  Files           9        9           
  Lines        1443     1443           
=======================================
  Hits         1440     1440           
  Misses          3        3           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@rowanseymour rowanseymour deleted the replace-isort-with-ruff branch April 2, 2026 21:41
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the project’s Python tooling to remove isort and rely on Ruff’s import-sorting lint rule (I) for enforcing import order in the temba_client package.

Changes:

  • Removes isort from dev dependencies and uv.lock.
  • Enables Ruff’s import-sorting rule (I) and adds [tool.ruff.lint.isort] configuration.
  • Removes the dedicated isort CI step (import sorting is now checked via ruff check).

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated 2 comments.

File Description
uv.lock Drops the locked isort package and removes it from dev dependency metadata.
pyproject.toml Removes [tool.isort], enables Ruff’s I rule, and adds Ruff isort-lint configuration.
.github/workflows/ci.yml Removes the separate isort CI step, relying on Ruff instead.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@@ -28,9 +28,6 @@ jobs:
- name: Run ruff
run: uv run ruff check temba_client
Copy link

Copilot AI Apr 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pyproject.toml sets tool.ruff.fix = true, which causes ruff check to run in fix mode by default. In CI this can auto-modify the working tree and still succeed, which may allow lint/import-order issues to slip through without failing the job. Consider running ruff check --no-fix (or adding --exit-non-zero-on-fix) so CI fails when fixes would be applied.

Suggested change
run: uv run ruff check temba_client
run: uv run ruff check --no-fix temba_client

Copilot uses AI. Check for mistakes.
sections = ["FUTURE", "STDLIB", "THIRDPARTY", "FIRSTPARTY", "LOCALFOLDER"]
[tool.ruff.lint.isort]
combine-as-imports = true
known-first-party = ["temba_client"]
Copy link

Copilot AI Apr 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The prior [tool.isort] config set wrapping/formatting options (e.g., multi_line_output, include_trailing_comma, line_length). The new [tool.ruff.lint.isort] table only sets combine-as-imports and known-first-party, so Ruff will fall back to its defaults for the rest, which can change import formatting/order compared to what was previously enforced. Consider porting the relevant isort options to Ruff equivalents (or running ruff check --fix once and committing any resulting import reformat) to avoid unexpected churn later.

Suggested change
known-first-party = ["temba_client"]
known-first-party = ["temba_client"]
split-on-trailing-comma = true

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants