-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
Python Ruff support (config only) #29866
Conversation
…q/airbyte into python-ruff-config-only
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved with gotchas for Python 3.10 bump.
This also seems to be relatively safe (although I haven't tested, perhaps this would change the format that black outputs and then we would need to follow-up with a formatting fix).
Let's get this in, @aaronsteers!
.python-version
Outdated
@@ -1 +0,0 @@ | |||
3.9.11 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this deleted? Should we set Python 3.10 here? I think we use that in most cases and it's compatible with airbyte-ci, the CDK, and connectors.
@@ -50,6 +50,94 @@ force_grid_wrap = 0 | |||
use_parentheses = true | |||
skip_glob = ["**/connector_builder/generated/**"] | |||
|
|||
[tool.ruff] | |||
target-version = "py38" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
target-version = "py38" | |
target-version = "py310" |
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Ignored Deployment
|
I've merged master into this, and added ruff as explicit dev dependency at the root pyproject.toml. |
Co-authored-by: Natik Gadzhi <natik@respawn.io>
@@ -46,11 +47,11 @@ max-complexity = 20 | |||
max-line-length = 140 | |||
|
|||
extend-ignore = [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just formatting noise here. I'll revert.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why tho, let it. Whatever, not terrible.
"airbyte_cdk", | ||
"airbyte_protocol", | ||
"airbyte_api_client", | ||
"connector_ops", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ironically this is missing a bunch of those airbyte-ci packages, but I think this is alright. This is enough to start.
Co-authored-by: Natik Gadzhi <natik@respawn.io>
Co-authored-by: Natik Gadzhi <natik@respawn.io>
This can safely merge ahead of the large auto-fix PR:
This PR adds configuration for Ruff, allowing developers to applying their own auto-fixes and to see what changes or issues Ruff would find, without making it a breaking change and without impacting any existing workstreams.
To test in VS Code
Install the VS Code extension for Ruff: https://marketplace.visualstudio.com/items?itemName=charliermarsh.ruff
To test with the command line
Install Ruff with pip or pipx:
pipx install ruff
Run Ruff on the entire monorepo:
ruff check --fix .
OR run Ruff on any subproject's directory: