2020-06-26 19:08:22 +02:00
|
|
|
image: "python:3.7"
|
|
|
|
|
2020-06-27 00:33:10 +02:00
|
|
|
variables:
|
|
|
|
# force pip cache dir
|
|
|
|
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
|
|
|
|
|
|
|
|
cache:
|
|
|
|
paths:
|
2020-06-27 00:56:38 +02:00
|
|
|
- .cache/pip # pip caching directory
|
2020-06-27 00:33:10 +02:00
|
|
|
|
2020-06-26 19:08:22 +02:00
|
|
|
# setup environemnt
|
|
|
|
before_script:
|
|
|
|
- python --version
|
|
|
|
- pip install -r requirements.txt
|
2020-06-27 00:56:38 +02:00
|
|
|
- pip install flake8 black
|
2020-06-26 19:08:22 +02:00
|
|
|
|
|
|
|
stages:
|
2020-06-26 23:31:15 +02:00
|
|
|
- syntax
|
2020-06-27 12:07:09 +02:00
|
|
|
- code consistency
|
|
|
|
- flake8
|
2020-06-26 19:08:22 +02:00
|
|
|
|
2020-06-26 23:31:15 +02:00
|
|
|
syntax:
|
|
|
|
stage: syntax
|
2020-06-26 19:08:22 +02:00
|
|
|
script:
|
2020-06-27 12:07:09 +02:00
|
|
|
# flake8 check only breaking errors ie syntax errors
|
2020-06-26 23:05:21 +02:00
|
|
|
- flake8 --select=E9,F63,F7,F82 --show-source
|
2020-06-26 23:31:15 +02:00
|
|
|
|
2020-06-27 00:56:38 +02:00
|
|
|
black:
|
2020-06-27 12:07:09 +02:00
|
|
|
stage: code consistency
|
2020-06-27 00:56:38 +02:00
|
|
|
script:
|
|
|
|
# code consistency
|
2020-06-27 12:07:09 +02:00
|
|
|
- black . --check
|
2020-06-27 00:56:38 +02:00
|
|
|
|
2020-06-26 23:31:15 +02:00
|
|
|
pep8:
|
2020-06-27 12:07:09 +02:00
|
|
|
stage: flake8
|
2020-06-26 23:31:15 +02:00
|
|
|
script:
|
2020-06-27 12:07:09 +02:00
|
|
|
# full flake8 test
|
|
|
|
- flake8 --show-source
|