Skip to content

Move ruff linter settings to pyproject.toml - #5386

Merged
peterjc merged 4 commits into
biopython:masterfrom
peterjc:isort-settings
Nov 26, 2026
Merged

peterjc merged 4 commits into
biopython:masterfrom
peterjc:isort-settings

Conversation

@peterjc

@peterjc peterjc commented Oct 21, 2026

Copy link
Copy Markdown
Member

This facilitates running flake8 with flake8-isort, ruff, or isort directly (outside of the pre-commit framework but with consistent settings).

  • I hereby agree to dual licence this and any previous contributions under both
    the Biopython License Agreement AND the BSD 3-Clause License.

  • I have read the CONTRIBUTING.rst file, have run pre-commit
    locally, and understand that continuous integration checks will be used to
    confirm the Biopython unit tests and style checks pass with these changes.

  • I have added my name to the alphabetical contributors listings in the files
    NEWS.rst and CONTRIB.rst as part of this pull request, am listed
    already, or do not wish to be listed. (This acknowledgement is optional.)

Closes #2828.

@peterjc

peterjc commented Oct 21, 2026

Copy link
Copy Markdown
Member Author

I think we can/should move all the ruff settings there too (their current location pre-dates our move to using pyproject.toml).

@codecov

codecov Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.46%. Comparing base (8b80756) to head (c6072ce).
⚠️ Report is 14 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5386      +/-   ##
==========================================
+ Coverage   85.58%   86.46%   +0.87%     
==========================================
  Files         281      281              
  Lines       59561    59563       +2     
==========================================
+ Hits        50978    51501     +523     
+ Misses       8583     8062     -521     

☔ View full report in Codecov by Harness.
📢 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.

@peterjc peterjc changed the title Move flake8/ruff isort settings to pyproject.toml Move ruff linter settings to pyproject.toml Oct 21, 2026
Comment thread .pre-commit-config.yaml
- id: check-executables-have-shebangs
files: \.(py|sh)$
- id: check-json
- id: check-toml

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This is overdue with pyproject.toml

@peterjc

peterjc commented Oct 21, 2026

Copy link
Copy Markdown
Member Author

Cross reference #5354, there are still a bunch of new linter codes in the latest ruff to review (to either add to our ignore list or apply). Having the settings here makes running ruff check outside of pre-commit run easier.

Comment thread pyproject.toml

[tool.ruff.lint]
isort.force-single-line=true
isort.order-by-type=false

@peterjc peterjc Oct 21, 2026 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

As far as I could tell, we need the isort settings twice - once if using isort directly at the command line, and once again for using ruff's implementation of isort.

ruff EXE001 Shebang is present but file is not executable
This facilitates running flake8 with flake8-isort, ruff, or isort
directly (outside of the pre-commit framework but with consistent
settings.

Closes biopython#2828.

Move ruff lint settings to pyproject.toml
Shortened comments in Doc/examples/nmr/simplepredict.py imports.

Dropped some redundant comments
@peterjc

peterjc commented Nov 2, 2026

Copy link
Copy Markdown
Member Author

Rebasing for the trivial merge conflict from a deprecation removal...

@peterjc
peterjc merged commit 9c53254 into biopython:master Nov 26, 2026
55 of 78 checks passed
@peterjc
peterjc deleted the isort-settings branch November 26, 2026 12:08
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.

Adopt code formatting tool isort for code style?

1 participant