-
-
Notifications
You must be signed in to change notification settings - Fork 151
Managing dependencies
We use Poetry as our Python package manager instead of pip. It's pretty good, but nobody is used to it yet. 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.
Once you're inside the image, you'll then be able to do:
poetry 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 poetry.lock
. With that done, you can make new docker images as described by the README's in the docker folders.
If you want to update a dependency, you might try using poetry update some-package
, but that will update other things as well. Instead, what you should do is:
poetry add some-package@latest
That'll just update the one you want.
These are the dependencies of our dependencies. To update these, there are two tricks. This one will give you a list of our transitive dependencies:
join -o 1.1 -v 1 <(poetry show -o) <(poetry show --top-level)
And this will install them:
join -o 1.1 -v 1 <(poetry show -o) <(poetry show --top-level) | xargs -r poetry update --