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

Apply ruff/pyupgrade rules (UP) #786

Merged
merged 4 commits into from
Aug 8, 2024
Merged

Conversation

DimitriPapadopoulos
Copy link
Contributor

@DimitriPapadopoulos DimitriPapadopoulos commented Mar 10, 2024

UP030 Use implicit references for positional format fields

https://docs.astral.sh/ruff/rules/format-literals/

UP031 Use format specifiers instead of percent format

https://docs.astral.sh/ruff/rules/printf-string-formatting/

UP032 Use f-string instead of `format` call

https://docs.astral.sh/ruff/rules/f-string/

@DimitriPapadopoulos DimitriPapadopoulos changed the title Fix ruff/pyupgrade issues (UP) Apply ruff/pyupgrade rules (UP) May 8, 2024
Copy link
Member

@pradyunsg pradyunsg left a comment

Choose a reason for hiding this comment

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

I don't think UP032 is a good rule to be enforcing as-is, at least not without changing the surrounding logic to keep it valid.

tasks/check.py Outdated Show resolved Hide resolved
tests/test_requirements.py Outdated Show resolved Hide resolved
src/packaging/tags.py Outdated Show resolved Hide resolved
src/packaging/tags.py Outdated Show resolved Hide resolved
Comment on lines 453 to 450
yield "macosx_{major}_{minor}_{binary_format}".format(
major=major_version, minor=0, binary_format=binary_format
)
yield f"macosx_{major_version}_0_{binary_format}"
Copy link
Member

Choose a reason for hiding this comment

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

Same as above.

src/packaging/tags.py Outdated Show resolved Hide resolved
Copy link
Member

@brettcannon brettcannon left a comment

Choose a reason for hiding this comment

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

I'm fine w/ the changes if @pradyunsg is.

@pradyunsg
Copy link
Member

Fatal Python error: Segmentation fault

Wow.

	UP030 Use implicit references for positional format fields
	UP031 Use format specifiers instead of percent format
	UP032 Use f-string instead of `format` call
@brettcannon brettcannon merged commit 2c885fe into pypa:main Aug 8, 2024
32 checks passed
@brettcannon
Copy link
Member

Thanks!

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

3 participants