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:
|
|
|
|
# utilize pip caching
|
|
|
|
- .cache/pip
|
2020-06-27 00:40:18 +02:00
|
|
|
# cache the virtual environment
|
2020-06-27 00:33:10 +02:00
|
|
|
- venv/
|
|
|
|
|
2020-06-26 19:08:22 +02:00
|
|
|
# setup environemnt
|
|
|
|
before_script:
|
|
|
|
- python --version
|
2020-06-27 00:33:10 +02:00
|
|
|
- pip install virtualenv
|
|
|
|
- virtualenv venv
|
|
|
|
- source venv/bin/activate
|
2020-06-26 19:08:22 +02:00
|
|
|
- pip install -r requirements.txt
|
2020-06-27 00:40:18 +02:00
|
|
|
- pip install flake8
|
2020-06-26 19:08:22 +02:00
|
|
|
|
|
|
|
stages:
|
2020-06-26 23:31:15 +02:00
|
|
|
- syntax
|
|
|
|
- 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
|
|
|
|
|
|
|
pep8:
|
|
|
|
stage: pep8
|
|
|
|
script:
|
|
|
|
# pep8 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
|