refactor: format python backend code (#1132)

Co-authored-by: bytecii <bytecii@users.noreply.github.com>
Co-authored-by: Wendong-Fan <133094783+Wendong-Fan@users.noreply.github.com>
This commit is contained in:
bytecii 2026-02-03 05:40:28 -08:00 committed by GitHub
parent 649bdc6822
commit 42ce1d96be
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
45 changed files with 1639 additions and 826 deletions

View file

@ -30,21 +30,31 @@ jobs:
run: uv sync --group dev
- name: Run pre-commit
run: >-
uv run pre-commit run --files
app/agent/README.md
app/agent/__init__.py
app/agent/factory/__init__.py
app/agent/factory/social_media.py
app/service/chat_service.py
app/service/task.py
app/utils/toolkit/google_calendar_toolkit.py
app/utils/toolkit/google_gmail_mcp_toolkit.py
app/utils/toolkit/linkedin_toolkit.py
app/utils/toolkit/reddit_toolkit.py
app/utils/toolkit/slack_toolkit.py
app/utils/toolkit/twitter_toolkit.py
app/utils/toolkit/whatsapp_toolkit.py
tests/app/agent/factory/test_social_media.py
run: |
uv run pre-commit run --files \
$(find \
app/agent \
app/controller \
app/exception \
app/middleware \
app/model \
app/service \
tests/app \
-type f ! -path '*__pycache__*') \
app/__init__.py \
app/router.py \
app/component/__init__.py \
app/component/pydantic/__init__.py \
app/utils/listen/__init__.py \
app/utils/server/__init__.py \
app/utils/toolkit/__init__.py \
app/utils/toolkit/google_calendar_toolkit.py \
app/utils/toolkit/google_gmail_mcp_toolkit.py \
app/utils/toolkit/linkedin_toolkit.py \
app/utils/toolkit/reddit_toolkit.py \
app/utils/toolkit/slack_toolkit.py \
app/utils/toolkit/twitter_toolkit.py \
app/utils/toolkit/whatsapp_toolkit.py \
tests/conftest.py
env:
SKIP: no-commit-to-branch

39
.github/workflows/test.yml vendored Normal file
View file

@ -0,0 +1,39 @@
name: Test
'on':
pull_request:
branches:
- main
push:
branches:
- main
permissions:
contents: read
jobs:
pytest:
name: Run Python Tests
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
enable-cache: true
- name: Set up Python
run: uv python install 3.10
- name: Install dependencies
run: |
cd backend
uv sync
- name: Run unit tests
run: |
cd backend
uv run pytest tests/app -v