Skip to content

Commit c857e6c

Browse files
committed
feat: initial event loop
1 parent 9aca336 commit c857e6c

11 files changed

Lines changed: 611 additions & 41 deletions

File tree

.github/workflows/ci.yaml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,22 @@ permissions:
1212
jobs:
1313
python:
1414
runs-on: ubuntu-latest
15+
strategy:
16+
matrix:
17+
python-version: ["3.10", "3.11", "3.12", "3.13"]
18+
1519
steps:
1620
- uses: actions/checkout@v5
1721
- name: "Set up Python"
1822
uses: actions/setup-python@v6
1923
with:
20-
python-version-file: "pyproject.toml"
24+
python-version: ${{ matrix.python-version }}
2125
- name: Install uv
2226
uses: astral-sh/setup-uv@v6
2327
with:
2428
enable-cache: true
2529
- name: Sync dependencies
26-
run: uv sync --all-packages --all-groups
30+
run: uv sync --group type-checking --group lint
2731
- name: Run tests
2832
run: uv run pytest
2933
- name: Run linter

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
/dist
22
/site
33
/.venv
4+
/.nox
45
__pycache__

Makefile

Lines changed: 0 additions & 14 deletions
This file was deleted.

flake.nix

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,16 @@
2929
devShells = {
3030
default = pkgs.mkShell {
3131
buildInputs = with pkgs; [
32-
gnumake
33-
(python313.withPackages (
32+
(python3.withPackages (
3433
p: with p; [
34+
nox
3535
uv
3636
]
3737
))
3838
];
39+
env = {
40+
UV_PYTHON = pkgs.python310.interpreter;
41+
};
3942
};
4043
};
4144

main.py

Lines changed: 0 additions & 6 deletions
This file was deleted.

noxfile.py

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
from __future__ import annotations
2+
3+
import nox
4+
5+
nox.options.default_venv_backend = "uv"
6+
7+
ALL_PYTHON = ["3.13", "3.12", "3.11", "3.10"]
8+
9+
10+
def install_deps(s: nox.Session, groups: list[str]):
11+
s.env["UV_PROJECT_ENVIRONMENT"] = s.virtualenv.location
12+
cmd = ["uv", "sync", "--frozen"]
13+
for g in groups:
14+
cmd.extend(("--group", g))
15+
_ = s.run_install(*cmd)
16+
17+
18+
@nox.session(python=ALL_PYTHON)
19+
def test(s: nox.Session) -> None:
20+
install_deps(s, [])
21+
_ = s.run("pytest")
22+
23+
24+
@nox.session(python=ALL_PYTHON)
25+
def type_check(s: nox.Session) -> None:
26+
install_deps(s, ["type-checking"])
27+
_ = s.run("mypy", ".")
28+
_ = s.run("basedpyright", "--venvpath", s.virtualenv.location, ".")
29+
30+
31+
@nox.session
32+
def lint(s: nox.Session) -> None:
33+
install_deps(s, ["lint"])
34+
_ = s.run("ruff", "check", ".")
35+
_ = s.run("ruff", "format", "--check", ".")
36+
37+
38+
@nox.session
39+
def docs(s: nox.Session) -> None:
40+
install_deps(s, ["docs"])
41+
_ = s.run("mkdocs", "build")

pyproject.toml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ readme = "README.md"
66
requires-python = ">=3.10"
77
dependencies = [
88
"pydantic>=2.11.7",
9+
"typing-extensions>=4.15.0",
910
]
1011

1112
[build-system]
@@ -14,10 +15,15 @@ build-backend = "uv_build"
1415

1516
[dependency-groups]
1617
dev = [
17-
"basedmypy>=2.10.0",
18-
"basedpyright>=1.31.2",
1918
"pytest>=7.0",
2019
"pytest-asyncio>=0.21",
20+
]
21+
type-checking = [
22+
"basedmypy>=2.10.0",
23+
"basedpyright>=1.31.2",
24+
"nox>=2025.5.1",
25+
]
26+
lint = [
2127
"ruff>=0.12.8",
2228
]
2329
docs = [
@@ -49,7 +55,8 @@ disable_error_code = [
4955
]
5056

5157
[tool.pyright]
52-
venv = ".venv"
53-
venvPath = "."
58+
venv = "."
59+
venvPath = ".venv"
5460
reportAny = false
5561
reportExplicitAny = false
62+
reportUnreachable = false

0 commit comments

Comments
 (0)