Skip to content
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

Enforce ruff/pyupgrade rules (UP) #4379

Open
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

DimitriPapadopoulos
Copy link
Contributor

Summary of changes

Enforce ruff/pyupgrade rules (UP).

Follow-up of #4125.

Pull Request Checklist

@Avasam
Copy link
Contributor

Avasam commented May 22, 2024

You should ignore UP038 too ! astral-sh/ruff#7871

ruff.toml Outdated Show resolved Hide resolved
@DimitriPapadopoulos DimitriPapadopoulos changed the title Enforce ruff/pyupgrade rules Enforce ruff/pyupgrade rules (UP) Jun 28, 2024
@DimitriPapadopoulos DimitriPapadopoulos marked this pull request as ready for review June 28, 2024 18:48
Copy link
Contributor

@Avasam Avasam left a comment

Choose a reason for hiding this comment

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

Some comments and imo potential non-automated improvements I noticed from also having applied UP03 in other projects

pkg_resources/__init__.py Show resolved Hide resolved
pkg_resources/__init__.py Show resolved Hide resolved
pkg_resources/tests/test_pkg_resources.py Outdated Show resolved Hide resolved
setuptools/command/easy_install.py Outdated Show resolved Hide resolved
setuptools/package_index.py Outdated Show resolved Hide resolved
setuptools/package_index.py Outdated Show resolved Hide resolved
setuptools/tests/config/test_setupcfg.py Outdated Show resolved Hide resolved
pkg_resources/__init__.py Outdated Show resolved Hide resolved
pkg_resources/__init__.py Outdated Show resolved Hide resolved
DimitriPapadopoulos and others added 8 commits July 3, 2024 08:57
UP030 Use implicit references for positional format fields
UP031 Use format specifiers instead of percent format
UP032 Use f-string instead of `format` call
Detect explicit `str` conversions in f-strings:
	grep -R '{str(' --exclude-dir=_distutils --exclude-dir=_vendor
Then make them implicit. Change `{str(x)!r}` to `'{x}'`.

Co-authored-by: Avasam <[email protected]>
DimitriPapadopoulos and others added 4 commits July 3, 2024 08:57
As an alternative to .format(), I have added extra variables.
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.

None yet

2 participants