Shipping FastAPI applications with Hatch
Packaging and shipping a FastAPI application as a distributable package are essential for deploying and sharing your application efficiently.
Hatch is a modern Python project management tool that simplifies the packaging, versioning, and distribution process. In this recipe, we’ll explore how to use Hatch to build and ship a package containing a FastAPI application. This will ensure that your application is portable, easy to install, and maintainable, making it easier to deploy and share with others.
Getting ready
Hatch facilitates the use of multiple virtual environments for our project. It uses the venv
package under the hood.
To run the recipe, you need to install Hatch on your local machine. The installation process may vary depending on your operating system. Detailed instructions can be found on the official documentation page: https://hatch.pypa.io/1.9/install/.
Once the installation is complete, verify that it has...