Using uv (the only recommended way )
👤
You
First, why is it recommended to use uv?
🐱
HAO
I know why! Because uv is probably the best Python package manager overall so far!
👤
You
Still, what about other package managers?
🐱
HAO
MEOW! Other package managers are not SOTA, uv is SOTA! I love SOTA!
The ways to install haolib:
First, you have to understand the concept of optional dependencies in Python. Since haolib is a monolith, it’s might be not the best idea to install it with all the dependencies, including the ones useless for your project. So we have to use optional dependencies. HAO, do you know what optional dependencies are?🐱
HAO
Optional dependencies are dependencies that are part of the project, but can be installed only if needed. For example, some libraries might utilize different message brokers like Kafka or RabbitMQ, but you most likely will not need them both in your project. So you can install only the one you need.
shell
- fastapi (the full FastAPI integration)
- sqlalchemy (the full SQLAlchemy integration)
- security (the security pack, including JWT (with PyJWT), password hashing (with bcrypt), symmetric Fernet encryption (with pyca/cryptography), and more)
The full list of optional dependencies:
dishka- Dishka integrationfastapi- FastAPI integrationfaststream- FastStream integrationfastmcp- FastMCP integrationsqlalchemy- SQLAlchemy integrationsecurity- the security pack, including JWT (with PyJWT), password hashing (with bcrypt), symmetric Fernet encryption (with pyca/cryptography), and more)redis- Redis integrationtaskiq- TaskIQ integrationobservability- the observability pack, including OpenTelemetry for distributed tracing and monitoring
How to understand that installation was successful?
Well, despite the fact that uv will show an error message if something goes wrong, the next lines should appear in yourpyproject.toml file:
pyproject.toml
Exercises
Why is uv the only recommended way to install haolib?
Why is uv the only recommended way to install haolib?
Because it is SOTA package manager for Python. And haolib is designed to be SOTA!
What is the difference between a "framework" and a "library"?
What is the difference between a "framework" and a "library"?
The first one is more rigid and provides less freedom, but also less responsibility to the user.
What is "SOTA"?
What is "SOTA"?
It stands for "State of the Art".