From bf3831e3aa55b7990497186a5a0a417800a61582 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Ha=CC=88cker?= Date: Tue, 26 Nov 2024 11:59:18 +0100 Subject: [PATCH] Ensure that the import problem is reproducible --- docker/ubuntu/docker-compose.yml | 44 ++++++++++++----------- docker/ubuntu/dockerfile | 19 ++++++---- docker/ubuntu/import_fail_reproduction.py | 11 ++++++ 3 files changed, 47 insertions(+), 27 deletions(-) create mode 100644 docker/ubuntu/import_fail_reproduction.py diff --git a/docker/ubuntu/docker-compose.yml b/docker/ubuntu/docker-compose.yml index bb77852e3..f492bebd8 100755 --- a/docker/ubuntu/docker-compose.yml +++ b/docker/ubuntu/docker-compose.yml @@ -1,23 +1,25 @@ -version: "3.7" services: - zms5: - build: . - image: zms5:ubuntu - ports: - - 8085:8085 - - 8086:8086 - - 8080:8080 - - 5678:5678 - environment: - - PYTHONUNBUFFERED="1" - - CONFIG_FILE="/home/zope/etc/zope.ini" - - INSTANCE_HOME="/home/zope" - - CLIENT_HOME="/home/zope" - - PYTHON="/home/zope/venv/bin/python" - - SOFTWARE_HOME="/home/zope/venv/bin" - volumes: - - ./etc/:/home/zope/etc/ - - ./Extensions/:/home/zope/Extensions/:rw - - ./var/:/home/zope/var/ + zms5: + image: zms5:ubuntu + pull_policy: build + build: + context: ../../ + dockerfile: docker/ubuntu/dockerfile + ports: + - 8085:8085 + - 8086:8086 + - 8080:8080 + - 5678:5678 + environment: + - PYTHONUNBUFFERED="1" + - CONFIG_FILE="/home/zope/etc/zope.ini" + - INSTANCE_HOME="/home/zope" + - CLIENT_HOME="/home/zope" + - PYTHON="/home/zope/venv/bin/python" + - SOFTWARE_HOME="/home/zope/venv/bin" + volumes: + - ./etc/:/home/zope/etc/ + - ./Extensions/:/home/zope/Extensions/:rw + - ./var/:/home/zope/var/ - # command: /home/zope/etc/start.sh + # command: /home/zope/etc/start.sh diff --git a/docker/ubuntu/dockerfile b/docker/ubuntu/dockerfile index d055aa8b8..222f2ea76 100755 --- a/docker/ubuntu/dockerfile +++ b/docker/ubuntu/dockerfile @@ -24,8 +24,15 @@ ENV LANGUAGE=en_US.UTF-8 RUN python3 -m venv venv RUN pip install -U pip wheel setuptools -RUN pip install -U -e git+https://github.com/zopefoundation/Zope.git@master#egg=Zope -RUN pip install -U -e git+https://github.com/zms-publishing/ZMS.git#egg=ZMS +# RUN pip install -U -e git+https://github.com/zopefoundation/Zope.git@master#egg=Zope +# RUN pip install -U -e git+https://github.com/zms-publishing/ZMS.git#egg=ZMS +RUN pip install Zope +COPY --chown=zope:zope Products Products +COPY --chown=zope:zope pyproject.toml setup.cfg setup.py requirements.txt \ + README.rst requirements-zeo.txt \ + . +RUN pip install -e . + RUN pip install -r https://raw.githubusercontent.com/zms-publishing/ZMS5/master/requirements-full.txt RUN pip install ZEO RUN pip install itsdangerous @@ -34,9 +41,9 @@ RUN pip install itsdangerous # Create Zope Instance RUN mkwsgiinstance -d . -u admin:admin -COPY ./etc etc -COPY ./var var -COPY ./Extensions Extensions +COPY docker/ubuntu/etc etc +COPY docker/ubuntu/var var +COPY docker/ubuntu/Extensions Extensions EXPOSE 8085 EXPOSE 8086 @@ -45,4 +52,4 @@ EXPOSE 5678 # Finally Start ZEO/Zope by Script # ENTRYPOINT ["/bin/sh -c"] -CMD ["/home/zope/etc/start.sh"] \ No newline at end of file +CMD ["/home/zope/etc/start.sh"] diff --git a/docker/ubuntu/import_fail_reproduction.py b/docker/ubuntu/import_fail_reproduction.py new file mode 100644 index 000000000..a87845f42 --- /dev/null +++ b/docker/ubuntu/import_fail_reproduction.py @@ -0,0 +1,11 @@ +import importlib +import pkgutil +from pprint import pprint + +import Products +# what the __path__ contains +pprint(Products.__path__) +# what python packaging suggests +pprint(list(pkgutil.iter_modules(Products.__path__, Products.__name__ + "."))) +# what the __path__ contains +pprint(Products.__path__)