Open provinzkraut opened 11 months ago
I find it a bit strange that fast-query-parsers
is included only with [standard]
, but standard also includes jinja2
.
But jinja2 is quite bloated and makes no sense for a JSON API (the typical use case of litestar I guess), so installing standard is not a good idea if you only need a JSON API. But then fast-query-parsers
has to be installed manually.
Currently, I'm installing it via:
litestar[sqlalchemy,cli]
fast-query-parsers
Some more data in https://github.com/litestar-org/litestar/issues/2844
mashumaro supports both yaml and messagepack, not sure about yaml version or efficiency tho
mashumaro supports both yaml and messagepack, not sure about yaml version or efficiency tho
Nsgspec also support both JSON, YAML and MessagePack, as we already using it, and it is performant.
In that case is pyYAML still necessary?
msgspec supports yaml via pyYAML.
Is this conversation really relevant to this issue? If you want to suggest changing the serialization library we support that should be in its own ticket.
Relevant but invalid. I thought Mashumaro supported YAML natively, in which case it would allow you to get rid of one dependency, but it doesn't.
Summary
Ideally we want the base
litestar
package to have as few dependencies as possible. Right now we install a lot of extra packages that aren't actually needed for the core functionality. These fall roughly into two groups: Speedups and additional features.Speedups include:
fast-query-parsers
(#2394)multidict
Additional features:
pyyaml
to support exporting the OpenAPI schema as YAMLhttpx
for theTestClient
polyfactory
to generate OpenAPI examples (#2390)Libraries required for Litestar to work
anyio
msgspec
The goal would be to exclude everything that's not strictly necessary from the base install and make it available through package extras, which could be included in the
standard
extra as well. This is a common practice and is used by packages likeuvicorn
,starlette
andfastapi
.The plan is to work on these without breaking anything, and removing the packages as required dependencies once we hit
3.0
.Basic Example
No response
Drawbacks and Impact
No response
Unresolved questions
No response
Funding