Skip to content

Migrate CI to Ruff for Code Formatting and Linting#170

Merged
slashmili merged 17 commits intoslashmili:mainfrom
5j9:ruff
Oct 13, 2025
Merged

Migrate CI to Ruff for Code Formatting and Linting#170
slashmili merged 17 commits intoslashmili:mainfrom
5j9:ruff

Conversation

@5j9
Copy link
Contributor

@5j9 5j9 commented Oct 11, 2025

This pull request introduces a migration from flake8 and isort
to Ruff, a fast Python linter and formatter.
The goal is to streamline the code quality tooling and improve
CI performance, code readability and consistency.

Changes:

  • Removed flake8 and isort from the test workflow.
  • Added Ruff to the CI pipeline (.github/workflows/test.yml).
  • Introduced pyproject.toml with Ruff configuration:
  • Reformatted codebase using Ruff’s auto-formatting.
  • Replaced legacy string formatting ("%s" % var) with f-strings.
  • Standardized quote styles across all modules.
    (I chose single quotes, but it can easily be changed to double)
  • Updated setup.py to use setuptools instead of distutils.
  • Minor test enhancements
  • Added Python 3.14 to the test matrix.
  • Merge setup.cfg and setup.py into pyproject.toml.

Possible future steps:

  • Use uv build instead of pip and build in publish-to-pypi.yml workflow.

5j9 added 7 commits October 11, 2025 15:32
fix some formatting issues.

add ruff settings to pyproject.toml

use setuptools.setup instead

disutils setup in setup.py.

replace isort with ruff in test.yml workflow.

use f-strings instead of %-strings.
ruff already does almost every
thing that flake8 does.
I'll probably migrate setup.py to
pyproject.toml completely later
It recommended to add it but I'm not sure if others agree yet.
I can add it back later.
@5j9 5j9 marked this pull request as draft October 11, 2025 13:40
@5j9 5j9 marked this pull request as ready for review October 11, 2025 14:39
setup.cfg line length was set to 110.
5j9 added 5 commits October 12, 2025 01:50
remove flake8 and isort references
add py314 to gh-actions and envlist.
New pyproject.toml uses dynamic versioning, meaning it will detect
the version in ``__init__.py`` automatically and use that for
publishing.
@slashmili slashmili requested a review from hramezani October 13, 2025 07:54
@slashmili
Copy link
Owner

Thanks @5j9 for you work and initiative!

@hramezani could you kindly review the changes?

@hramezani
Copy link
Collaborator

ُThanks @5j9 LGTM 👍

@slashmili
Copy link
Owner

Thanks!

@5j9 let me know when it's final and I can merge it.

@5j9
Copy link
Contributor Author

5j9 commented Oct 13, 2025

I think this pull request is ready to be merged. Migrating publish-to-pypi.yml to use uv can be handled in a separate PR. I also have some type hint improvements in mind, but those can be addressed in another one as well.

@slashmili
Copy link
Owner

Thanks!

@slashmili slashmili merged commit db90c99 into slashmili:main Oct 13, 2025
7 checks passed
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