You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
AstraAPI 0.2.1 is a stability and compatibility release for our FastAPI-compatible web framework powered by a compiled C++20 core. This release fixes editor IntelliSense, resolves Windows build failures, hardens CI/CD pipelines, and raises the minimum Python version to **3.14**.
11
-
12
-
```python
13
-
from astraapi import AstraAPI
14
-
15
-
app = AstraAPI()
16
-
17
-
@app.get("/")
18
-
defhello():
19
-
return {"message": "Hello World"}
20
-
21
-
if__name__=="__main__":
22
-
app.run(port=8000, workers=4)
23
-
```
24
-
25
-
---
26
-
27
-
## Breaking Changes
28
-
29
-
### Minimum Python Version Raised to 3.14
30
-
-**Dropped support for Python 3.12 and 3.13.**
31
-
- The codebase leverages `annotationlib` (PEP 649 deferred annotations) and other 3.14-specific runtime features that are not back-portable.
32
-
- Wheels are now built **exclusively** for `cp314` (Linux x86_64/aarch64, macOS arm64, Windows x64).
33
-
- Updated all docs, Docker examples, and CI matrices to reflect `python:3.14-slim`.
10
+
Patch release that fixes a runtime compatibility issue where endpoints returning `list[PydanticModel]` could crash with `'dict' object has no attribute 'name'` during response validation/serialization.
34
11
35
12
---
36
13
37
-
## What's New
38
-
39
-
### Editor IntelliSense & Static Analysis
40
-
-**Added `astraapi/py.typed`** — PEP 561 marker so Pylance, Pyright, and mypy recognize the package as fully typed.
41
-
-**Added `astraapi/__init__.pyi`** — Stub file with explicit re-exports of all 20 public symbols (`AstraAPI`, `Depends`, `HTTPException`, `Request`, `Response`, `APIRouter`, `WebSocket`, etc.).
42
-
-**Root cause:**`astraapi/__init__.py` used `__getattr__` lazy loading for fast cold-start (~1 s vs ~4.7 s). While great for runtime, it completely broke static resolution. The `.pyi` stub restores autocomplete, "Go to Definition", and type checking without changing runtime behavior.
43
-
44
-
### Windows Build Fixes
45
-
-**`cpp_core/src/app.cpp`** — Added `#define NOMINMAX` before `Python.h` to prevent Windows `min`/`max` macros from clashing with `std::min`/`std::max` (MSVC `C2589` / `C2059`).
-**`cpp_core/include/streaming_multipart.hpp`** — Renamed enum value `ERROR` → `ERR` in both `MultipartState` and `FeedResult`. Windows defines `ERROR` as a macro (`0`), causing `FeedResult::ERROR` to expand to `FeedResult::0` (syntax error).
48
-
-**`scripts/build_core.sh`** — Now passes `-DPython3_EXECUTABLE="$(python -c 'import sys; print(sys.executable)')"` to CMake to guarantee the C++ extension is built against the same Python that runs it.
49
-
50
-
### CI/CD Hardening
51
-
-**`.github/workflows/tests.yml`** — Switched from `pip` to `uv` for faster installs. Installs `".[dev,standard]"` to ensure `httpx`, `jinja2`, `python-multipart`, and other standard extras are present during testing. Uses Python 3.14 explicitly (matching local dev and `uv`'s managed Python).
52
-
-**`.github/workflows/publish.yml`** — `CIBW_BUILD` narrowed to `cp314-*` only. Fixed CMake Python version mismatch that caused segfaults when the runtime Python differed from the build-time Python.
14
+
## Bug Fixes
53
15
54
-
### Test Stability
55
-
-**`astraapi/_testclient.py`** — TestClient shared server registry now uses `_app_instance_id` (monotonic counter) instead of `id(app)`. Python's allocator recycles object addresses, causing servers to be incorrectly reused across tests.
56
-
-**`astraapi/applications.py`** — Custom route classes now pass `dep_inject_mask=0x07` so the C++ core injects `__raw_headers__`, `__method__`, `__path__` directly into kwargs, eliminating a ContextVar fallback race in `_asgi_shim`.
16
+
### Response Model Validation/Serialization Robustness
57
17
58
-
### Documentation
59
-
-**VitePress `base` path** — Changed from `/Astraapi/` to `/` to support custom root domains (e.g., `https://astraapi.lumoslab.tech/`). Previously CSS/assets 404'd when the site was served at a domain root instead of a GitHub Pages subdirectory.
-**`astraapi/_compat/v2.py`** — `ModelField.validate()` now catches `TypeError` and `AttributeError` in addition to `ValidationError`. Pydantic v2's `validate_python(..., from_attributes=True)` can raise these exceptions when re-validating model instances that contain nested dicts (e.g., `model_construct` bypass) or when computed fields access missing attributes.
19
+
-**`astraapi/applications.py`** — Both `_make_response_model_shim` and `_make_response_class_shim` now wrap `response_field.serialize()` in try-except to catch `TypeError` and `AttributeError` and convert them to `ResponseValidationError` instead of letting raw exceptions propagate and crash the request.
90
20
91
21
---
92
22
@@ -96,6 +26,4 @@ if __name__ == "__main__":
96
26
pip install astraapi
97
27
```
98
28
99
-
Requires **Python 3.14+** and a C++20-capable compiler (GCC 10+, Clang 12+, MSVC 2019+). Pre-built wheels are provided for Linux x86_64/aarch64, macOS arm64, and Windows x64. The C++ extension builds automatically from source if a wheel is not available for your platform.
100
-
101
-
---
29
+
Requires **Python 3.14+** and a C++20-capable compiler (GCC 10+, Clang 12+, MSVC 2019+). Pre-built wheels are provided for Linux x86_64/aarch64, macOS arm64, and Windows x64.
0 commit comments