From a10d6a2d6d29c6bff37b837c9c2af7b4b00d1f2b Mon Sep 17 00:00:00 2001 From: Giles Knap Date: Sun, 11 Feb 2024 22:22:57 +0000 Subject: [PATCH] fix issues with QT_QPA_PLATFORM --- .devcontainer/Dockerfile | 36 ------------------------------------ .github/workflows/_test.yml | 2 ++ Dockerfile | 2 -- pyproject.toml | 2 +- 4 files changed, 3 insertions(+), 39 deletions(-) delete mode 100644 .devcontainer/Dockerfile diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile deleted file mode 100644 index 83d928f5..00000000 --- a/.devcontainer/Dockerfile +++ /dev/null @@ -1,36 +0,0 @@ -# ideas from https://www.docker.com/blog/containerized-python-development-part-1/ - -# This file is for use as a .vscode devcontainer as well as a runtime -# container. The devcontainer should be rootful and use podman or docker -# with user namespaces. - -ARG BASE="mcr.microsoft.com/vscode/devcontainers/python:0-3.10-bullseye" -FROM ${BASE} as base - -# use root to pin where the packages will install -USER root -ENV PATH=/root/.local/bin:$PATH - -# things to make pyQt5 work -RUN apt-get update && export DEBIAN_FRONTEND=noninteractive && \ - apt-get install -y --no-install-recommends \ - libqt5gui5 libxcb-xinerama0 && \ - rm -rf /var/lib/apt/lists/* - -ENV XDG_RUNTIME_DIR=/tmp/runtime-vscode - -FROM base as developer - -WORKDIR /workspace -COPY . . - -# install runtime from DIST if there is one -RUN mkdir -p /root/.local && \ - test -d dist && \ - requirements=$(test -f requirements.txt && echo -r requirements.txt) \ - pip install --user $requirements dist/*.whl || : - -FROM base as runtime -COPY --from=developer /root/.local /root/.local - -ENTRYPOINT ["dls-pmac-control"] diff --git a/.github/workflows/_test.yml b/.github/workflows/_test.yml index 9b1f21f2..de736fca 100644 --- a/.github/workflows/_test.yml +++ b/.github/workflows/_test.yml @@ -16,6 +16,8 @@ on: env: # https://github.com/pytest-dev/pytest/issues/2042 PY_IGNORE_IMPORTMISMATCH: "1" + # allow tests to run headless + ENV QT_QPA_PLATFORM: offscreen jobs: run: diff --git a/Dockerfile b/Dockerfile index 5e34e5e1..de52c8e9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,8 +13,6 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ RUN python -m venv /venv ENV PATH=/venv/bin:$PATH -# allow tests to run headless in the dev container -ENV QT_QPA_PLATFORM=offscreen ENV XDG_RUNTIME_DIR=/tmp/runtime-vscode # The build stage installs the context into the venv diff --git a/pyproject.toml b/pyproject.toml index 3d6cb2d8..16f15aa8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -40,7 +40,7 @@ dev = [ ] [project.scripts] -dls-pmac-control = "dls_pmac_control.motor:main" +dls-pmac-control = "dls_pmac_control.__main__:main" [project.urls] GitHub = "https://github.com/DiamondLightSource/dls-pmac-control"