-
Notifications
You must be signed in to change notification settings - Fork 8
Poetry
Francis Li edited this page Feb 6, 2025
·
1 revision
Poetry is a tool for dependency management and packaging in Python. It allows you to declare the libraries your project depends on and it will manage (install/update) them for you. Poetry offers a lockfile to ensure repeatable installs, and can build your project for distribution.
This file controls which packages (and versions of said packages) we use for this project. The pyproject.toml file specifies the dependencies and their constraints, while poetry.lock records the exact versions of dependencies that were installed.
# Make sure docker and the "server" are running
docker compose up
# In another terminal, run this command to update the poetry.lock file
docker compose exec server poetry lock
If you upgrade something, you'll want to test it. But, before you test it, you'll need to rebuild the code.
docker compose stop
docker compose build
# assuming it builds with no errors, fire it up again
docker compose up
# In another terminal, get into the server's bash shell
docker compose exec server bash -l
# run the pytest suite
pytest
Then correct any failures and try to address any warnings (if possible).