From 647ec375ee8984f2f6897c10a94bb2bfac5be6f1 Mon Sep 17 00:00:00 2001 From: Wolfgang Walther Date: Wed, 8 Jul 2020 11:18:11 +0200 Subject: [PATCH] Add Dockerfile and docker-compose.yml to run tests and linter Just run `docker-compose up test` and `docker-compose up lint` to run tests and the linter without setting up a local python environment. --- Dockerfile | 7 +++++++ docker-compose.yml | 18 ++++++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 Dockerfile create mode 100644 docker-compose.yml diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..25ae64d --- /dev/null +++ b/Dockerfile @@ -0,0 +1,7 @@ +# Dockerfile to run the test suite and linter +FROM python:slim +RUN pip install flake8 flake8-import-order doc8 yamllint \ + && apt-get update \ + && apt-get install -y locales \ + && rm -rf /var/lib/apt/lists/* \ + && localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8 diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..9f33d47 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,18 @@ +# Docker Compose file to run the test suite and linter +--- +version: "3" + +services: + test: + build: . + working_dir: /app + volumes: + - ./:/app + command: python setup.py test + + lint: + build: . + working_dir: /app + volumes: + - ./:/app + command: sh -c "flake8 . ; yamllint --strict . ; doc8 -e .rst ."