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 00:56:38 +02:00
|
|
|
- black
|
2020-06-26 23:31:15 +02:00
|
|
|
- pep8
|
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-26 23:31:15 +02:00
|
|
|
# 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:
|
|
|
|
stage: black
|
|
|
|
script:
|
|
|
|
# code consistency
|
|
|
|
- black . --check --line-length 120
|
|
|
|
|
2020-06-26 23:31:15 +02:00
|
|
|
pep8:
|
|
|
|
stage: pep8
|
|
|
|
script:
|
2020-06-27 00:56:38 +02:00
|
|
|
# pep8 warnings and other non breaking warnings
|
2020-06-26 23:05:21 +02:00
|
|
|
- flake8 --max-complexity=10 --max-line-length=120 --show-source
|
2020-06-26 23:31:15 +02:00
|
|
|
allow_failure: true
|