Skip to content

Commit

Permalink
feat(bindings/python): add ruff as linter (#4135)
Browse files Browse the repository at this point in the history
  • Loading branch information
asukaminato0721 committed Feb 3, 2024
1 parent 7688974 commit cabab15
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/bindings_python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Ruff Check
working-directory: "bindings/python"
run: |
pip install ruff
ruff check .
- uses: PyO3/maturin-action@v1
with:
working-directory: "bindings/python"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,17 @@

import greenify

greenify.greenify()

from gevent import monkey

monkey.patch_all()

import timeit

import gevent
from boto3 import client as boto3_client
from mypy_boto3_s3 import S3Client
from pydantic import BaseSettings

greenify.greenify()

monkey.patch_all()

class Config(BaseSettings):
aws_region: str
Expand Down
4 changes: 4 additions & 0 deletions bindings/python/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ benchmark = [
]
docs = ["pdoc"]
test = ["pytest", "python-dotenv", "pytest-asyncio"]
lint = ["ruff"]

[project.urls]
Documentation = "https://opendal.apache.org/docs/python/opendal.html"
Expand All @@ -52,3 +53,6 @@ Repository = "https://github.com/apache/opendal"
features = ["pyo3/extension-module"]
module-name = "opendal._opendal"
python-source = "python"

[tool.ruff.lint]
ignore = ["F403", "F405"]

0 comments on commit cabab15

Please sign in to comment.