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

[chore] add UP rule to ruff #25703

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

danielgafni
Copy link
Contributor

@danielgafni danielgafni commented Nov 1, 2024

Summary & Motivation

Hello, I really like running ruff on Dagster.

This PR adds the pyupgrade rule which automatically updates Python syntax & usage to the minimal supported Python version (3.9 in our case).

See pyproject.toml diff:

diff --git a/pyproject.toml b/pyproject.toml
index 7fcaa156fe..3c8882cc1a 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -248,6 +248,9 @@ select = [
 
   # (invalid escape sequence) flag errant backslashes
   "W605",
+
+  # pyupgrade - automatically upgrade Python syntax to newer versions
+  "UP",
 ]
 
 [tool.ruff.lint.flake8-builtins]

All other changes are automated. Curious to find out how unsafe is --unsafe-fixes! These are the only fixes which were unsafe:

❯ ruff check --statistics
457	UP008	[*] super-call-with-parameters
 92	UP031	[*] printf-string-formatting
 15	UP028	[*] yield-in-for-loop
  6	UP036	[*] outdated-version-block

Buildkite is happy!

Copy link
Contributor Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @danielgafni and the rest of your teammates on Graphite Graphite

@danielgafni danielgafni marked this pull request as ready for review November 1, 2024 23:42
Copy link

github-actions bot commented Nov 2, 2024

Deploy preview for dagster-docs-beta ready!

Preview available at https://dagster-docs-beta-owcusk788-elementl.vercel.app

Direct link to changed pages:

@cmpadden
Copy link
Contributor

cmpadden commented Nov 3, 2024

I think this is great, and am in favor of inclusion of pyupgrade rules.

Will wait for approval from at least one other though to ensure consensus.

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.

2 participants