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 force-pushed the UP branch 2 times, most recently from 251929a to 434fdb5 Compare March 12, 2024 22:08
@DimitriPapadopoulos DimitriPapadopoulos force-pushed the UP branch 2 times, most recently from d313f80 to ee69be5 Compare May 8, 2024 18:01
@DimitriPapadopoulos DimitriPapadopoulos changed the title Fix ruff/pyupgrade issues (UP) Apply ruff/pyupgrade rules (UP) May 8, 2024
@DimitriPapadopoulos DimitriPapadopoulos force-pushed the UP branch 3 times, most recently from 24efab4 to c0522ef Compare May 8, 2024 18:28
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.

@DimitriPapadopoulos DimitriPapadopoulos force-pushed the UP branch 5 times, most recently from 686766c to 59be934 Compare July 13, 2024 06:23
@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.

3 participants