Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancement: Minimize package size #2844

Closed
JacobCoffee opened this issue Dec 5, 2023 · 1 comment
Closed

Enhancement: Minimize package size #2844

JacobCoffee opened this issue Dec 5, 2023 · 1 comment
Labels
Enhancement This is a new feature or request Package This is related to the overall `litestar` package

Comments

@JacobCoffee
Copy link
Member

JacobCoffee commented Dec 5, 2023

Summary

The Litestar wheel is noticeably larger than others

And the installed size is painfully large

  • Django: 44MB
  • Flask: 10MB
  • FastAPI: 16MB
  • Litestar: 46MB
  • Sanic: 14MB
  • Quart: 14MB

Most of this is caused by faker and pygments, I guess.
It would be nice to do some things to shrink this, and also introduce a [minimal] target that removes things we add by default

Basic Example

python3 pip install litestar[minimal]

Drawbacks and Impact

  • Probably not able to do anything "by default" until 3.x

Unresolved questions

Looking at the default dependencies, I'm not sure we can do anything until 3.x.. but the size is quite ridiculous.

dependencies = [
  "anyio>=3",
  "httpx>=0.22",
  "importlib-metadata; python_version < \"3.10\"",
  "importlib-resources>=5.12.0; python_version < \"3.9\"",
  "msgspec>=0.18.2",
  "multidict>=6.0.2",
  "polyfactory>=2.6.3",
  "pyyaml",
  "typing-extensions",
  "click",
  "rich>=13.0.0",
  "rich-click",
]

In my mind click, rich, rich-click, polyfactory, and maybe some more things could be taken out here for a minimal option (See below).


Note

While we are open for sponsoring on GitHub Sponsors and
OpenCollective, we also utilize Polar.sh to engage in pledge-based sponsorship.

Check out all issues funded or available for funding on our Polar.sh Litestar dashboard

  • If you would like to see an issue prioritized, make a pledge towards it!
  • We receive the pledge once the issue is completed & verified
  • This, along with engagement in the community, helps us know which features are a priority to our users.
Fund with Polar
@JacobCoffee JacobCoffee added Enhancement This is a new feature or request Package This is related to the overall `litestar` package labels Dec 5, 2023
@JacobCoffee
Copy link
Member Author

This is already a thing: #2397

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement This is a new feature or request Package This is related to the overall `litestar` package
Projects
None yet
Development

No branches or pull requests

1 participant