A small REST API to manage products. The objective is to show the good guidelines for creating pretty code and teach the different layers that a project has.
NOTE: This project is a refactoring of the original project created for various talks
- Python 3.10.12 or higher
- Poetry
curl -sSL https://install.python-poetry.org | python3 -Make sure poetry is in your PATH. You may need to restart your terminal.
poetry installThis installs all project dependencies listed in pyproject.toml.
Make sure you are in the root of the project.
Create a .env file in the app folder with the following content:
DATABASE_PATH=path_to_your_database.sqlite
ORM=sqlalchemy
# ORM=ponyorm
BLUELYTICS_API_URL=https://api.bluelytics.com.ar/v2/latestThen run the following command at the root of the project to start the app:
poetry run uvicorn app.main:app --reloadMake sure you are in the root of the project. To run the tests, use the following command:
make run_all_testsTo run an specific test, use the following command:
make run_specific_test test=test_nameWe use # pragma: no cover to avoid coverage warnings for the abstract classes that are not covered by tests.
make run_tests_with_coverage