Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 9 additions & 17 deletions .github/workflows/pylint.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,15 @@
name: Pylint

on: [push]

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pylint
- name: Analysing the code with pylint
run: |
pylint $(git ls-files '*.py')
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v3
with:
python-version: "3.13"
- name: Install dependencies
run: uv sync --dev
- name: Analysing the code with pylint
run: uv run pylint app tests
3 changes: 0 additions & 3 deletions app/config.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@

import os
from openai import OpenAI
from dotenv import load_dotenv

load_dotenv()
MAX_REQUEST_LIMIT = 10
RATE_LIMIT_WINDOW = 60

client = OpenAI(
api_key=os.environ.get('DEEPSEEK_API_KEY'),
base_url="https://api.deepseek.com")

5 changes: 0 additions & 5 deletions app/main.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
from fastapi import FastAPI
from app.api import analyze

# if item.sender in r.get("numbers"):
# return
#

app = FastAPI()
app.include_router(analyze.router)

14 changes: 14 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,17 @@ dependencies = [
[tool.pytest.ini_options]
pythonpath = ["."]
testpaths = ["tests"]

[dependency-groups]
dev = [
"pylint>=4.0.6",
"pytest>=9.1.1",
"pytest-asyncio>=1.4.0",
]
[tool.pylint.'MESSAGES CONTROL']
disable = [
"missing-module-docstring",
"missing-function-docstring",
"missing-class-docstring",
"redefined-outer-name",
]
9 changes: 3 additions & 6 deletions tests/test_main.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
from app.main import app
from fastapi.testclient import TestClient
import asyncio
import pytest
from websockets.asyncio.client import connect
import json

from app.main import app
client = TestClient(app)


Expand Down Expand Up @@ -41,9 +38,9 @@ def audio():
yield audio.read()


def test1(audio):
def test1(audiofile):
with client.websocket_connect("/ws") as websocket:
websocket.send_bytes(audio)
websocket.send_bytes(audiofile)
result = websocket.receive_json()
assert "label" in result
assert "score" in result
Expand Down
141 changes: 141 additions & 0 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading