Skip to content
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.

pyproject.toml

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.

Generating a new poetry.lock file

# 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

Testing after a major upgrade

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).

Clone this wiki locally