neva-fastapi
The FastAPI integration for the Neva
framework. It marries FastAPI to neva's dishka-based dependency-injection
container so that route handlers resolve injected services, while keeping all
HTTP concerns out of the framework-agnostic python-neva core.
Most consumers pull this in transitively via the python-neva[fastapi] extra
rather than depending on it directly.
What it provides
Everything is re-exported from neva.fastapi:
App— a subclass offastapi.FastAPIthat owns aneva.arch.Application(the DI container) and drives it: builds the container, reads app metadata from neva config (app.*), wires neva providers'lifespan()hooks, and installs per-request DI scoping middleware.APIRouter— a subclass offastapi.APIRouterthat forcesroute_class=DishkaRouteso injection works inside handlers.Inject— a re-export ofdishka.FromDishka. Annotate handler params asInject[SomeService].Injectonly works on this package'sAPIRouter(orApp's routes) — a vanillafastapi.APIRouterlacksDishkaRouteand injection silently won't happen.
neva is a namespace package (no top-level neva/__init__.py); this repo
owns neva/fastapi/ and shares the neva.* namespace with python-neva.
Testing helpers
Fixtures in neva/fastapi/fixtures.py ship as a pytest plugin — opt in with
pytest_plugins = ["neva.fastapi.fixtures"] in your conftest.py. It provides
webapp (an App built from a test_config path you supply) and http_client
(an httpx.AsyncClient wired to the app via ASGITransport).
Develop
uv sync # install/refresh deps
poe lint # ruff check
poe fmt # ruff format
poe tc # pyrefly check
poe test # pytest
poe test-cov # pytest --cov=neva --cov-report=term-missing
asyncio_mode = "auto" is set, so async tests need no @pytest.mark.asyncio.
Contributing
Commits follow Conventional Commits
with gitmoji prefixes, enforced by
cz_gitmoji. Commitizen is
a dev dependency — run cz commit for the guided wizard, or format manually as
:gitmoji: type(scope): subject.
Releases are cut per-repo with commitizen from the repo root:
cz bump # bump version in pyproject, write CHANGELOG, tag v<version>
git push --follow-tags origin main
uv build && uv publish # build + publish the wheel/sdist
cz bump derives the level from the commits since the last tag, updates
CHANGELOG.md, and runs scripts/retag-with-changelog.sh to rewrite the new
tag with the rendered changelog as its annotation.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file neva_fastapi-1.1.2.tar.gz.
File metadata
- Download URL: neva_fastapi-1.1.2.tar.gz
- Upload date:
- Size: 162.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
uv/0.8.22
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1a110370a8f3cab3f572eae0b8d803a0c36125a53b919ed3ab333728682f96d2
|
|
| MD5 |
f992884092414b55ea1a57c0137852d1
|
|
| BLAKE2b-256 |
4338024fa1020bad22e80d1ca42aa72230a43bd1bb8f22a331dd82c31e69a2ff
|
File details
Details for the file neva_fastapi-1.1.2-py3-none-any.whl.
File metadata
- Download URL: neva_fastapi-1.1.2-py3-none-any.whl
- Upload date:
- Size: 8.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
uv/0.8.22
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
70ed364c0289c9a8cd0aae93f44eb803d70581871c6c777eaf99617f1fe4b454
|
|
| MD5 |
a4d0d6000e1b4cfc83a30db03d1598a1
|
|
| BLAKE2b-256 |
382642153c5d7204357ea1adf9b90fc68932d7376a1e584495d3b30f753541a1
|