From 85e2cec298081ae97d2bc33cd6ad059a8e469bc7 Mon Sep 17 00:00:00 2001 From: Mike Fiedler Date: Tue, 12 Nov 2024 16:46:32 -0500 Subject: [PATCH 1/4] chore: also reformat tests They are being linted, so also apply formatting. Signed-off-by: Mike Fiedler --- bin/reformat | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/reformat b/bin/reformat index 4849217..edd92a6 100755 --- a/bin/reformat +++ b/bin/reformat @@ -10,5 +10,5 @@ export LANG="${ENCODING:-en_US.UTF-8}" # Print all the following commands set -x -python -m isort inspector/ -python -m black inspector/ +python -m isort inspector/ tests/ +python -m black inspector/ tests/ From ec39d2168dedc7a3af2f80ecc016550534a2a92d Mon Sep 17 00:00:00 2001 From: Mike Fiedler Date: Tue, 12 Nov 2024 16:47:03 -0500 Subject: [PATCH 2/4] chore: remove deprecated key from compose config Signed-off-by: Mike Fiedler --- docker-compose.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index c5abf75..1bdfa38 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,4 +1,3 @@ -version: "3.9" services: #db: # image: postgres:10.1 From 362fa8d791aec7c92e0e9c48a128df89e04d7b96 Mon Sep 17 00:00:00 2001 From: Mike Fiedler Date: Tue, 12 Nov 2024 16:54:00 -0500 Subject: [PATCH 3/4] chore: reorder commands and cleanup This also fixes the ability to run `make` commands again, since we're in the correct `WORKDIR` after the compilation step. Signed-off-by: Mike Fiedler --- Dockerfile | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/Dockerfile b/Dockerfile index de00291..4680082 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,9 +13,6 @@ ENV PYTHONPATH /app # test dependencies. ARG DEVEL=no -# Copy local code to the container image. -WORKDIR /app - # Install System level requirements, this is done before everything else # because these are rarely ever going to change. RUN set -x \ @@ -27,15 +24,17 @@ RUN set -x \ && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* # Install pycdc and pycdas... -RUN git clone "https://github.com/zrax/pycdc.git" - -WORKDIR ./pycdc -RUN cmake . -RUN cmake --build . --config release -RUN mv ./pycdc /usr/local/bin -RUN mv ./pycdas /usr/local/bin -RUN rm -rf ./pycdc +WORKDIR /tmp +RUN git clone "https://github.com/zrax/pycdc.git" && \ + cd pycdc && \ + cmake . && \ + cmake --build . --config release && \ + mv ./pycdc /usr/local/bin && \ + mv ./pycdas /usr/local/bin && \ + cd .. && rm -rf ./pycdc +# Copy local code to the container image. +WORKDIR /app # Copy in requirements files COPY ./requirements ./requirements From 42567278f6186279958fb27a051ab22519bea228 Mon Sep 17 00:00:00 2001 From: Mike Fiedler Date: Tue, 12 Nov 2024 17:00:37 -0500 Subject: [PATCH 4/4] chore: don't create pyc files Saves another ~14 MB from the image. Signed-off-by: Mike Fiedler --- Dockerfile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Dockerfile b/Dockerfile index 4680082..318a73f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,6 +5,9 @@ FROM python:3.11.8-slim-bullseye # Allow statements and log messages to immediately appear in the logs ENV PYTHONUNBUFFERED True +# Don't create .pyc files +ENV PYTHONDONTWRITEBYTECODE True + # Put our application on the PYTHONPATH ENV PYTHONPATH /app