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

Python Ruff support (config only) #29866

Merged
merged 9 commits into from
Apr 23, 2024
Merged

Python Ruff support (config only) #29866

merged 9 commits into from
Apr 23, 2024

Conversation

aaronsteers
Copy link
Collaborator

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:

ruff check --fix airbyte-ci/connectors/pipelines
ruff check --fix airbyte-cdk/python

@octavia-squidington-iii octavia-squidington-iii added the area/documentation Improvements or additions to documentation label Aug 25, 2023
@octavia-squidington-iii octavia-squidington-iii removed the area/documentation Improvements or additions to documentation label Aug 25, 2023
@aaronsteers aaronsteers mentioned this pull request Aug 28, 2023
Copy link
Contributor

@natikgadzhi natikgadzhi left a 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
Copy link
Contributor

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.

pyproject.toml Outdated Show resolved Hide resolved
@@ -50,6 +50,94 @@ force_grid_wrap = 0
use_parentheses = true
skip_glob = ["**/connector_builder/generated/**"]

[tool.ruff]
target-version = "py38"
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
target-version = "py38"
target-version = "py310"

@natikgadzhi natikgadzhi marked this pull request as ready for review April 20, 2024 23:37
Copy link

vercel bot commented Apr 20, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
airbyte-docs ⬜️ Ignored (Inspect) Visit Preview Apr 22, 2024 7:30pm

@natikgadzhi
Copy link
Contributor

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 = [
Copy link
Collaborator Author

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.

Copy link
Contributor

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",
Copy link
Contributor

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.

@natikgadzhi natikgadzhi merged commit 5d5b1e3 into master Apr 23, 2024
33 checks passed
@natikgadzhi natikgadzhi deleted the python-ruff-config-only branch April 23, 2024 05:22
strosek pushed a commit that referenced this pull request Apr 24, 2024
Co-authored-by: Natik Gadzhi <natik@respawn.io>
FVidalCarneiro pushed a commit to AgiData/airbyte that referenced this pull request May 2, 2024
Co-authored-by: Natik Gadzhi <natik@respawn.io>
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.

None yet

3 participants