Implemented modular code structure

Refactored repository into kaya-core and kaya-rsgi packages
This commit is contained in:
2026-07-15 22:18:45 +08:00
parent eca6da3dc3
commit fa3ff32f66
33 changed files with 238 additions and 387 deletions
+23 -5
View File
@@ -1,6 +1,15 @@
# kaya
A lightweight ASGI/RSGI web framework with method-aware routing, path matching, and recursive wildcard support.
A lightweight ASGI web framework with method-aware routing, path matching, and recursive wildcard support.
## Packages
This repository is a monorepo for the Kaya framework. The code is split into independent packages under `packages/`:
- **kaya-core** — core routing, HTTP/WS abstractions, and ASGI adapter (`packages/kaya-core/`)
- **kaya-rsgi** — RSGI/Granian integration (`packages/kaya-rsgi/`)
Additional `kaya-*` packages can be added as new directories under `packages/`.
## Build & run locally
@@ -10,10 +19,10 @@ Install dev dependencies:
pip install --index-url https://gitea.woggioni.net/api/packages/woggioni/pypi/simple --extra-index-url https://pypi.org/simple -r requirements-dev.txt
```
Build the package:
Install the packages in development mode:
```bash
python -m build
pip install -e packages/kaya-core -e packages/kaya-rsgi
```
Run the example:
@@ -25,11 +34,20 @@ python example/hello.py
## Tests
```bash
PYTHONPATH=src python -m unittest discover tests
python -m unittest discover -s packages/kaya-core/tests
python -m unittest discover -s packages/kaya-rsgi/tests
```
## Static analysis
```bash
mypy src/kaya
mypy -p kaya.core
mypy -p kaya.rsgi
```
## Building packages
```bash
python -m build packages/kaya-core
python -m build packages/kaya-rsgi
```