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

Upgrade Ruff to v0.3.0 #20647

Merged
merged 2 commits into from
Mar 7, 2024
Merged

Conversation

krishnan-chandra
Copy link
Contributor

@krishnan-chandra krishnan-chandra commented Mar 6, 2024

This version stabilizes the Ruff formatter, which is something we should pull in to Pants - see more details here. This causes some divergences from Black's formatting, but the differences seem reasonable and users will not realistically use both.

There are some changes to formatting of type declarations in this release like the one below, so users will see some changes:

-    description: Optional[
-        Annotated[str, StringConstraints(strip_whitespace=True)]
-    ] = None
+    description: Optional[Annotated[str, StringConstraints(strip_whitespace=True)]] = (
+        None
+    )

However, this seems like a definite improvement over the previous style / easier to read.

This version stabilizes the Ruff formatter, which is
something we should pull in to Pants - see more details
[here](https://astral.sh/blog/ruff-v0.3.0).
@krishnan-chandra krishnan-chandra added category:internal CI, fixes for not-yet-released features, etc. backend: Python Python backend-related issues labels Mar 6, 2024
Copy link
Contributor

@huonw huonw left a comment

Choose a reason for hiding this comment

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

Thank you 👍

For the breaking changes/differences, Pants is "just" a tool runner for things like this: it's not our problem if the underlying tool makes breaking changes. It may impact users if they're using it without pinning, but I think that's out of scope of Pants' stability promise (although maybe not explicitly so), and the resolution there is for the user to take over management of the tool via their own install_from_resolve configuration (etc.)

@huonw
Copy link
Contributor

huonw commented Mar 6, 2024

That said, there is the possibility of user-visible changes, so I think we should be flagging this as a category that appears release notes. I don't know if user api change is perfect, but it's close enough, I think.

@huonw huonw added category:user api change and removed category:internal CI, fixes for not-yet-released features, etc. labels Mar 6, 2024
@krishnan-chandra
Copy link
Contributor Author

it's not our problem if the underlying tool makes breaking changes

Yeah hard agree there - I think if you're using a formatter tool you should just delegate decisions to the tool and I have no objections to keeping it that way. My main reason for adding this change to Pants is to get onto the stable formatter ASAP to minimize future changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend: Python Python backend-related issues category:user api change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants