Managing Dependencies
We use UV as our Python package manager instead of pip/poetry. It has very good docs you should use for everyday stuff, but the one thing to know about it is that to use it you need to shell into the docker image.
So, once the docker image is running, do something like this:
docker exec -it --user root cl-django bash
Then you can do things as described below.
Adding a new dependency
Once you're inside the image, you'll then be able to do:
uv add some-new-package
That will do two things. First, it will add the dependency while you're using the container. That's cool, but will go away if you restart docker or the container. The second thing it does is update pyproject.toml and uv.lock. With that done, you can make new docker images as described by the README's in the docker folders.
Updating a dependency
If you want to update a dependency, without update other things as well. What you should do is:
uv lock --upgrade-package some-package
That'll just update the one you want.
Updating all transitive dependencies
These are the dependencies of our dependencies. To update them, use:
uv lock --upgrade
This tells uv to:
- Resolve all dependencies again
- Upgrade transitive dependencies where allowed by the constraints in pyproject.toml
- Re-write the uv.lock file