From 4e4b6578bdff2373d16c5d13505b9aac483b0741 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A6var=20=C3=96fj=C3=B6r=C3=B0=20Magn=C3=BAsson?= Date: Mon, 20 Jun 2022 20:30:32 +0000 Subject: [PATCH] Adding a dynamic way to include arbitrary dependencies of Wagtail --- Dockerfile | 10 +++++----- README.md | 8 +++++--- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/Dockerfile b/Dockerfile index ff8202d..b49a07d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -21,8 +21,8 @@ COPY ./wagtail /code/wagtail/ RUN cd /code/wagtail/ \ && pip install -e .[testing,docs] -# Install Willow from the host. This folder will be overwritten by a volume mount during run time (so that code -# changes show up immediately), but it also needs to be copied into the image now so that Willow can be pip install'd. -COPY ./libs/Willow /code/willow/ -RUN cd /code/willow/ \ - && pip install -e .[testing] +# Install Willow and possibly other dependencies from the host. This folder will be overwritten by a volume mount during +# run time (so that code changes show up immediately), but it also needs to be copied into the image now so that Willow +# can be pip install'd. +COPY ./libs /code/libs +RUN cd /code/libs/ && pip install -e $(find * -maxdepth 0 -type d) diff --git a/README.md b/README.md index ad1ddc3..646bb1e 100644 --- a/README.md +++ b/README.md @@ -230,12 +230,14 @@ git remote add upstream git@github.com:wagtail/wagtail.git git pull --all ``` -Contributing to Willow ----------------------- +Contributing to Willow and other Wagtail dependencies +----------------------------------------------------- -You can use the same setup to contribute to Willow. +You can use the same setup to contribute to Willow and other Wagtail dependencies. You simply do the same operations to fork the Willow project and point your local copy of Willow to your fork. +You can add dependencies by cloning the repository into the `libs` folder and then rebuild your container. +The Dockerfile should pick up your library and install it from the local source. TODO ----