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
45 changes: 45 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: CI

on:
push:
branches: [main]
pull_request:
branches: [main]

permissions:
contents: read

jobs:
test:
name: Lint & test (Python ${{ matrix.python-version }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13"]
steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: pip

# Install the runtime dependencies declared in pyproject.toml rather
# than the package itself: setup.py compiles the Cython extensions,
# and the tests exercise the Python sources from the repository root.
- name: Install dependencies
run: |
python -m pip install --upgrade pip tomli
python - > requirements-ci.txt <<'PY'
import tomli
with open("pyproject.toml", "rb") as f:
print("\n".join(tomli.load(f)["project"]["dependencies"]))
PY
python -m pip install -r requirements-ci.txt pytest pytest-asyncio ruff

- name: Lint
run: ruff check .

- name: Test
run: pytest -q
11 changes: 10 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,13 @@ dependencies = [
"redis",
"pyjwt",
"starlette"
]
]

[tool.ruff]
line-length = 120
target-version = "py310"

[tool.ruff.lint]
# pyflakes + pycodestyle errors only; the explicit selection keeps CI stable
# when a new ruff release changes its default rule set.
select = ["E", "F"]
2 changes: 1 addition & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
Developer: Manish Kumar <manish@omnibioai.org>
"""
import pytest
from unittest.mock import AsyncMock, MagicMock, patch
from unittest.mock import AsyncMock, patch


@pytest.fixture
Expand Down
1 change: 0 additions & 1 deletion tests/test_auth_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

Developer: Manish Kumar <manish@omnibioai.org>
"""
import pytest


def test_auth_service_module_importable():
Expand Down
1 change: 0 additions & 1 deletion tests/test_policy_middleware.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import sys
import types
import importlib
import pytest
from unittest.mock import AsyncMock, MagicMock, patch
from starlette.testclient import TestClient
from starlette.applications import Starlette
Expand Down
1 change: 0 additions & 1 deletion tests/test_s2s_middleware.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import types
import importlib
import jwt
import pytest
from starlette.testclient import TestClient
from starlette.applications import Starlette
from starlette.responses import JSONResponse
Expand Down
Loading