Skip to content

Apply ruff/pyupgrade rules (UP)#786

Merged
brettcannon merged 4 commits into
pypa:mainfrom
DimitriPapadopoulos:UP
Aug 8, 2024
Merged

Apply ruff/pyupgrade rules (UP)#786
brettcannon merged 4 commits into
pypa:mainfrom
DimitriPapadopoulos:UP

Conversation

@DimitriPapadopoulos

@DimitriPapadopoulos DimitriPapadopoulos commented Mar 10, 2024

Copy link
Copy Markdown
Contributor
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

@pradyunsg pradyunsg left a comment

Copy link
Copy Markdown
Member

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.

Comment thread tasks/check.py Outdated
Comment thread tests/test_requirements.py Outdated
Comment thread src/packaging/tags.py Outdated
Comment thread src/packaging/tags.py Outdated
Comment thread src/packaging/tags.py Outdated
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
Copy Markdown
Member

Choose a reason for hiding this comment

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

Same as above.

Comment thread src/packaging/tags.py Outdated

@brettcannon brettcannon left a comment

Copy link
Copy Markdown
Member

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
Copy Markdown
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
@brettcannon

Copy link
Copy Markdown
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