Skip to content

Commit cabab15

Browse files
feat(bindings/python): add ruff as linter (#4135)
1 parent 7688974 commit cabab15

File tree

3 files changed

+12
-5
lines changed

3 files changed

+12
-5
lines changed

.github/workflows/bindings_python.yml

+5
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,11 @@ jobs:
4040
runs-on: ubuntu-latest
4141
steps:
4242
- uses: actions/checkout@v4
43+
- name: Ruff Check
44+
working-directory: "bindings/python"
45+
run: |
46+
pip install ruff
47+
ruff check .
4348
- uses: PyO3/maturin-action@v1
4449
with:
4550
working-directory: "bindings/python"

bindings/python/benchmark/async_origin_s3_benchmark_with_gevent.py

+3-5
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,17 @@
1717

1818
import greenify
1919

20-
greenify.greenify()
21-
2220
from gevent import monkey
2321

24-
monkey.patch_all()
25-
2622
import timeit
27-
2823
import gevent
2924
from boto3 import client as boto3_client
3025
from mypy_boto3_s3 import S3Client
3126
from pydantic import BaseSettings
3227

28+
greenify.greenify()
29+
30+
monkey.patch_all()
3331

3432
class Config(BaseSettings):
3533
aws_region: str

bindings/python/pyproject.toml

+4
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ benchmark = [
4242
]
4343
docs = ["pdoc"]
4444
test = ["pytest", "python-dotenv", "pytest-asyncio"]
45+
lint = ["ruff"]
4546

4647
[project.urls]
4748
Documentation = "https://opendal.apache.org/docs/python/opendal.html"
@@ -52,3 +53,6 @@ Repository = "https://github.com/apache/opendal"
5253
features = ["pyo3/extension-module"]
5354
module-name = "opendal._opendal"
5455
python-source = "python"
56+
57+
[tool.ruff.lint]
58+
ignore = ["F403", "F405"]

0 commit comments

Comments
 (0)