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

- name: Install
run: |
python -m pip install --upgrade pip
python -m pip install -e ".[dev]"

- name: Lint
run: ruff check .

- name: Test
run: pytest -q

build:
name: Build distributions
runs-on: ubuntu-latest
needs: test
steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: pip

- name: Build and check
run: |
python -m pip install --upgrade pip build twine
python -m build
python -m twine check dist/*
4 changes: 3 additions & 1 deletion omnibioai/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,9 @@ def _parse(self, response: requests.Response) -> Any:
if response.status_code == 404:
raise ResourceNotFoundError(message, status_code=404, response_body=body, trace_id=trace_id)
if response.status_code >= 500:
raise ServiceUnavailableError(message, status_code=response.status_code, response_body=body, trace_id=trace_id)
raise ServiceUnavailableError(
message, status_code=response.status_code, response_body=body, trace_id=trace_id
)
if response.status_code >= 400:
raise ValidationError(message, status_code=response.status_code, response_body=body, trace_id=trace_id)

Expand Down
15 changes: 13 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ classifiers = [
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
"License :: OSI Approved :: Apache Software License",
"Operating System :: OS Infrastructure Independent"
"Operating System :: OS Independent"
]

[project.optional-dependencies]
Expand All @@ -30,7 +30,8 @@ dev = [
"pytest-cov>=5.0",
"responses>=0.25",
"build>=1.2",
"twine>=5.1"
"twine>=5.1",
"ruff>=0.6"
]

[project.urls]
Expand All @@ -46,6 +47,16 @@ Issues = "https://github.com/man4ish/omnibioai_sdk/issues"
# import OmniBioAI`.
packages = ["omnibioai", "omnibioai_sdk"]

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

[tool.ruff.lint]
# pyflakes + pycodestyle errors. Formatting itself is black/isort's job
# (see CONTRIBUTING.md); the explicit selection keeps CI stable when a new
# ruff release changes its default rule set.
select = ["E", "F"]

[tool.pytest.ini_options]
testpaths = ["tests"]
addopts = [
Expand Down
Loading