-
Notifications
You must be signed in to change notification settings - Fork 15
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 ruff
linter and code formatter
#166
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
❌ Your project status has failed because the head coverage (69.58%) is below the target coverage (80.00%). You can increase the head coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #166 +/- ##
==========================================
+ Coverage 69.56% 69.58% +0.01%
==========================================
Files 135 135
Lines 10857 10864 +7
==========================================
+ Hits 7553 7560 +7
Misses 3304 3304 ☔ View full report in Codecov by Sentry. |
@@ -31,28 +31,16 @@ jobs: | |||
python-version: ${{ matrix.python-version }} | |||
cache: "pip" | |||
cache-dependency-path: | | |||
**/setup.cfg | |||
**/pyproject.toml | |||
**/requirements*.txt | |||
**/test-requirements*.txt | |||
|
|||
- name: Install dependencies | |||
run: pip install -r test-requirements.txt --upgrade pip | |||
|
|||
- if: matrix.python-version == '3.10' |
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.
- if: matrix.python-version == '3.10' | |
- if: matrix.python-version == '3.10' |
Should we make it so that only testing happens on 3.10 and the linting and such run on latest (3.12 in this case?)
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.
Same for uploading to Codecov and releasing below
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.
👋 Thanks for your review!
Should we make it so that only testing happens on 3.10 and the linting and such run on latest (3.12 in this case?)
It's probably best for us to keep any linters targeting 3.10
, as it's our minimum supported target. Running with later versions could potentially result in linter suggestions that leverage language features unavailable in older versions.
In terms of testing, I think there are two significant advantages to running them against our full gauntlet of supported runtimes: avoiding incorporating language features that aren't supported across all our targets and catching potential compatibility issues with dependencies that could be installed differently between those various runtimes.
Same for uploading to Codecov and releasing below
For releasing, it's best to build in an environment configured for the minimum supported runtime version just to guarantee the built package will work as intended.
24d73b5
to
fe5ae46
Compare
fe5ae46
to
2ec56b1
Compare
Description
This pull request does not include any functionality changes. It introduces a faster and more streamlined linter and code formatted tool and applies some suggested code formatting rules.
Changes include:
Updates the linter and code formatting tools used.
ruff
linter and code formatted tool.pyupgrade
,isort
,autoflake
andblack
tools.setup.cfg
file with a modernpyproject.toml
equivalent.Applies improvements suggested by the tool:
__all__
definitions to the__init__.py
files as a best practice for exposing the SDK's public API to developer IDEs.Fixes a few minor issues in the examples and unit tests I identified while working on updating things:
setup.py
files using incorrect header comment blocks.api_test
, which may have causedtest_500_error_retry
not to be run as intended.Ensures the
partial_header
block is imported in all Python source files.References
Please review
DXAZT-368
for additional context.Generated from: openfga/sdk-generator#478
Review Checklist
main