From 9fd0fd4f7baeb925cb3daffbe60819708d6fd8f8 Mon Sep 17 00:00:00 2001 From: Alex Pyrgiotis Date: Tue, 10 Jan 2023 23:59:32 +0200 Subject: [PATCH] FIXUP: Do not use --no-root flag The `make test` command relies on importing the dangerzone library, which is why we must do `poetry install` without the `--no-root` flag. See: https://github.com/python-poetry/poetry/issues/1868 --- dev_scripts/env.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/dev_scripts/env.py b/dev_scripts/env.py index 5cd719995..baa24703d 100755 --- a/dev_scripts/env.py +++ b/dev_scripts/env.py @@ -94,12 +94,18 @@ RUN echo user:2000:2000 > /etc/subuid RUN echo user:2000:2000 > /etc/subgid +# XXX: We need the empty source folder, so that we can trick Poetry to create a +# link to the project's path. This way, we should be able to do `import +# dangerzone` from within the container. +RUN mkdir -p /home/user/dangerzone/dangerzone +RUN touch /home/user/dangerzone/dangerzone/__init__.py + USER user WORKDIR /home/user VOLUME /home/user/dangerzone COPY pyproject.toml poetry.lock /home/user/dangerzone/ -RUN cd /home/user/dangerzone && poetry install --no-root +RUN cd /home/user/dangerzone && poetry install """ DOCKERFILE_BUILD_DEBIAN_DEPS = r"""