diff --git a/.vscode/settings.json b/.vscode/settings.json index 021db9e5..f0f7caeb 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -17,7 +17,7 @@ "editor.codeActionsOnSave": { "source.organizeImports": "explicit" }, - "editor.defaultFormatter": "ms-python.autopep8" + "editor.defaultFormatter": "charliermarsh.ruff" }, "[cpp]": { "editor.formatOnSave": true diff --git a/pyproject.toml b/pyproject.toml index 644c933d..86f30c7d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -29,4 +29,11 @@ dev-dependencies = [ "wheel~=0.40.0", "auditwheel~=5.4.0", "pytest~=7.3.2", + "ruff>=0.1.14", ] + +[tool.ruff] +line-length = 100 +indent-width = 4 + +exclude = [".venv", "run.py", "pypath.py", "setup.py"] \ No newline at end of file diff --git a/requirements-dev.lock b/requirements-dev.lock index e76205f4..c38a48ce 100644 --- a/requirements-dev.lock +++ b/requirements-dev.lock @@ -5,6 +5,7 @@ # pre: false # features: [] # all-features: false +# with-sources: false -e file:. auditwheel==5.4.0 @@ -17,6 +18,7 @@ pluggy==1.3.0 pyelftools==0.30 pyproject-hooks==1.0.0 pytest==7.3.2 +ruff==0.1.14 tomli==2.0.1 wheel==0.40.0 # The following packages are considered to be unsafe in a requirements file: diff --git a/requirements.lock b/requirements.lock index aa6be96b..8f230963 100644 --- a/requirements.lock +++ b/requirements.lock @@ -5,5 +5,6 @@ # pre: false # features: [] # all-features: false +# with-sources: false -e file:. diff --git a/tests/test_recvonly.py b/tests/test_recvonly.py index 7ad35a61..3eb57ccc 100644 --- a/tests/test_recvonly.py +++ b/tests/test_recvonly.py @@ -5,7 +5,7 @@ def on_disconnect(error_code, message: str): - print(f'on_disconnect: error_code: {error_code}, message: {message}') + print(f"on_disconnect: error_code: {error_code}, message: {message}") def test_sendonly(): @@ -15,7 +15,7 @@ def test_sendonly(): signaling_urls=[os.environ.get("TEST_SIGNALING_URL")], role="recvonly", channel_id=os.environ.get("TEST_CHANNEL_ID_PREFIX") + "sora-python-sdk-test", - metadata={"access_token": os.environ.get("TEST_SECRET_KEY")} + metadata={"access_token": os.environ.get("TEST_SECRET_KEY")}, ) conn.on_disconnect = on_disconnect