From 1987cc7f22a139fbd2ead1223ab878cddccd3f96 Mon Sep 17 00:00:00 2001 From: Andrea Censi Date: Sun, 27 Feb 2022 13:07:33 +0100 Subject: fix --- .devcontainer/Dockerfile | 15 ++++++++++++--- .devcontainer/act4e-check | 16 ++++++++++++++++ .devcontainer/requirements.txt | 2 ++ Dockerfile | 2 +- Makefile | 12 ++++++------ requirements.txt | 2 -- 6 files changed, 37 insertions(+), 12 deletions(-) create mode 100644 .devcontainer/act4e-check create mode 100644 .devcontainer/requirements.txt delete mode 100644 requirements.txt diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index f50f4d2..120994e 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -10,9 +10,8 @@ RUN if [ "${NODE_VERSION}" != "none" ]; then su vscode -c "umask 0002 && . /usr/ RUN pip3 --disable-pip-version-check --no-cache-dir install -U pip pre-commit - # [Optional] If your pip requirements rarely change, uncomment this section to add them to the image. -COPY requirements.txt /tmp/pip-tmp/ +COPY .devcontainer/requirements.txt /tmp/pip-tmp/ RUN pip3 --disable-pip-version-check --no-cache-dir install -r /tmp/pip-tmp/requirements.txt \ && rm -rf /tmp/pip-tmp @@ -21,4 +20,14 @@ RUN pip3 --disable-pip-version-check --no-cache-dir install -r /tmp/pip-tmp/requ # && apt-get -y install --no-install-recommends # [Optional] Uncomment this line to install global node packages. -# RUN su vscode -c "source /usr/local/share/nvm/nvm.sh && npm install -g " 2>&1 \ No newline at end of file +# RUN su vscode -c "source /usr/local/share/nvm/nvm.sh && npm install -g " 2>&1 + +COPY .devcontainer/act4e-check /usr/local/bin +RUN chmod +x /usr/local/bin/act4e-check + + +COPY src src +COPY setup.py . + +RUN python3 -m pip install -e . + diff --git a/.devcontainer/act4e-check b/.devcontainer/act4e-check new file mode 100644 index 0000000..d4fd9e7 --- /dev/null +++ b/.devcontainer/act4e-check @@ -0,0 +1,16 @@ +#!/bin/bash +set -eux +if [ $# -eq 0 ] + then + act4e-test --collections act4e_checks --module act4e_solutions +else +if [ $# -eq 1 ] + then + act4e-test --collections act4e_checks --module act4e_solutions --group $1 +else + echo "Need to pass either 0 or 1 argument" + exit 3 +fi +fi + + diff --git a/.devcontainer/requirements.txt b/.devcontainer/requirements.txt new file mode 100644 index 0000000..28fee9e --- /dev/null +++ b/.devcontainer/requirements.txt @@ -0,0 +1,2 @@ +ACT4E-exercises +pre-commit \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index d029f7f..e131248 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,7 +6,7 @@ RUN python3 -m pip install -U pip -v WORKDIR /ACT4E RUN uname -a -COPY requirements.txt . +COPY .devcontainer/requirements.txt . RUN python3 -m pip install -r requirements.txt COPY src src diff --git a/Makefile b/Makefile index 3090a59..9c80517 100644 --- a/Makefile +++ b/Makefile @@ -1,9 +1,9 @@ all: -tag=mytag +tag=act4e-image build: - docker build --build-arg DOCKER_REGISTRY=${DOCKER_REGISTRY} -t $(tag) . + docker build -f .devcontainer/Dockerfile --build-arg DOCKER_REGISTRY=${DOCKER_REGISTRY} -t $(tag) . docker-check: build docker run -it --rm -v $(PWD)/out-results:/ACT4E/out-results $(tag) \ @@ -14,8 +14,8 @@ docker-check-%: build docker run -it --rm -v $(PWD)/out-results:/ACT4E/out-results $(tag) \ act4e-test --collections act4e_checks --module act4e_solutions --group $* -check: - act4e-test --collections act4e_checks --module act4e_solutions +# check: +# act4e-test --collections act4e_checks --module act4e_solutions -check-%: - act4e-test --collections act4e_checks --module act4e_solutions --group $* \ No newline at end of file +# check-%: +# act4e-test --collections act4e_checks --module act4e_solutions --group $* \ No newline at end of file diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index 28fee9e..0000000 --- a/requirements.txt +++ /dev/null @@ -1,2 +0,0 @@ -ACT4E-exercises -pre-commit \ No newline at end of file -- cgit v1.2.1