-
-
Notifications
You must be signed in to change notification settings - Fork 370
Ruff format #998
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ruff format #998
Conversation
|
The main reason to replace these tools is speed (gained from using rust-based tools like uv & ruff) and wanting to introduce more consistent typing (next PR) |
|
@kellerza, thank you for these great enhancements and contributions! Wanted to mention that there's also a separate branch (py3-migration) where the migration of library to Python 3.6+ has been conducted, which includes several related improvements:
…along with a few other things_ My main concern is that if both branches continue to evolve separately (with similar Python 3 migration changes), merging them could become quite challenging down the road. I propose we merge this PR (and others?) into the This approach keeps all the modernization changes together and minimizes merge complexity. What are your thoughts on this plan? |
|
In that case this PR might not make sense. In the end I'd like to see:
What is the timeline to merge the py3-migration branch? I don't mid re-doing step 2 above after the merge, or even on the py3-migrations branch |
|
Great, thanks for your flexibility. I appreciate you're willing to re-apply those improvements after the migration. We're not in a hurry, would aiming to merge the py3-migration branch within the next week or two work for you? |
|
I'm ok with that timeline. Do you want me to apply step2 on the py3-migration branch so long, or rather wait till after the merge? |
|
Yes, please feel free to apply step 2 (ruff, etc.) directly to the If you happen to spot anything else that could use cleanup or modernization, feel free to flag it or make changes. The more eyes, the better! :) |
Summary
Use ruff formatting to replace black & pylint
The files of interest in this PR is:
All other changes are as a result of ruff formatting
Future enhancements
There are several ignored ruff rules that require explicit changes in the code. Rules that should probably not be ignored are documented with comments in pyproject.toml.
Copilot overview
This pull request makes several improvements to the codebase and project configuration, focusing on simplifying and standardizing code formatting and linting tools, as well as modernizing string formatting and improving code readability in the authentication examples. The most significant changes are the replacement of
blackandpylintwithrufffor formatting and linting, and the consistent use of f-strings and compact code in example scripts.Tooling and CI/CD improvements:
blackandpylintwithrufffor both linting and formatting in CI workflows (.github/workflows/python-app.yml), pre-commit hooks (.pre-commit-config.yaml), and documentation (CONTRIBUTING.md). Removed.isort.cfgas sorting is now handled byruff. [1] [2] [3] [4] [5]Code modernization and readability:
.format(), improving readability and consistency. [1] [2] [3] [4] [5] [6] [7]Docstring and style cleanup:
Minor code improvements:
"r"inopencalls when the default is sufficient) and simplified function arguments for clarity. [1] [2]These changes collectively modernize the codebase, improve developer experience, and ensure consistency across tooling and code examples.