Skip to content

Commit cc6c120

Browse files
authored
feat: setup ci (#1)
* feat: setup ci * install properly uv * install deps
1 parent c0c55fd commit cc6c120

5 files changed

Lines changed: 460 additions & 7 deletions

File tree

.github/workflows/quality.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Linters
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
8+
jobs:
9+
quality:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout repository
13+
uses: actions/checkout@v4
14+
15+
- name: Install uv
16+
uses: astral-sh/setup-uv@v6
17+
with:
18+
activate-environment: true
19+
python-version: "3.13"
20+
21+
- name: install dependencies
22+
run: uv pip install -e ".[dev]"
23+
24+
- name: Run formatter check with Black
25+
run: uv run black --check .
26+
27+
- name: Lint with Ruff
28+
run: uv run ruff check .
29+
30+
- name: Type check with mypy
31+
run: uv run mypy src

.github/workflows/tests.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Tests
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
8+
jobs:
9+
test:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout repository
14+
uses: actions/checkout@v4
15+
16+
- name: Install uv
17+
uses: astral-sh/setup-uv@v6
18+
with:
19+
activate-environment: true
20+
python-version: "3.13"
21+
22+
- name: Install dependencies
23+
run: uv pip install -e ".[dev]"
24+
25+
- name: Run tests with pytest
26+
run: uv run pytest

pyproject.toml

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,31 @@
11
[build-system]
2-
requires = ["hatchling"]
3-
build-backend = "hatchling.build"
2+
requires = ["setuptools"]
3+
build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "mode-sdk"
77
version = "0.1.0"
88
description = "A Python SDK for the Mode API."
99
authors = [{ name = "Daniil Merkulov", email = "daniil.merkulov@gmail.com" }]
1010
readme = "README.md"
11-
requires-python = ">=3.11"
11+
requires-python = ">=3.13"
1212
classifiers = [
1313
"Programming Language :: Python :: 3",
1414
"Operating System :: OS Independent",
1515
]
16-
dependencies = ["requests>=2.20.0", "pydantic>=2.0"]
16+
dependencies = [
17+
"requests==2.32.4",
18+
"pydantic==2.11.7",
19+
"python-dotenv",
20+
"types-requests>=2.32.4",
21+
]
1722

1823
[project.optional-dependencies]
19-
dev = ["pytest", "pytest-mock", "requests-mock", "uv"]
24+
dev = ["pytest", "pytest-mock", "requests-mock", "black", "ruff", "mypy"]
25+
26+
[tool.ruff]
27+
line-length = 120
28+
target-version = "py313"
29+
30+
[tool.ruff.lint]
31+
ignore = ["E501"]

tests/test_client.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
import pytest
2-
import requests
3-
import requests_mock
42

53
from mode_sdk.client import ModeAPIClient
64
from mode_sdk.exceptions import AuthenticationError, APIError

0 commit comments

Comments
 (0)