File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Load Diff Large diffs are not rendered by default.
Original file line number Diff line number Diff line change 1+ FROM python:alpine
2+
3+ ARG TARGET=development
4+
5+ ADD . /code
6+ WORKDIR /code
7+ RUN pip install --no-cache-dir --upgrade -r requirements/base.txt -r requirements/$TARGET.txt
Original file line number Diff line number Diff line change 1+ # target config
2+ TARGET =development
3+ CFLAGS = -c -g -D $(TARGET )
4+
5+ # Content of the pre-commit hook
6+ define PRECOMMIT
7+ # !/bin/sh
8+ make lint
9+ endef
10+ export PRECOMMIT
11+
12+ all : images up
13+
14+ images :
15+ docker-compose build
16+
17+ up :
18+ docker-compose up mongo rabbitmq postgres
19+
20+ lint :
21+ docker-compose run --rm py find . -name " *.py" -exec pylint -ry {} +
22+
23+ install_pre_commit :
24+ echo " $$ PRECOMMIT" > .git/hooks/pre-commit
25+ chmod +x .git/hooks/pre-commit
26+
27+ test :
28+ docker-compose run --rm py python -m unittest
29+
30+ coverage :
31+ docker-compose run --rm py sh -c ' coverage run -m unittest && coverage html && coverage report'
Original file line number Diff line number Diff line change 1+ version : ' 2'
2+ services :
3+ py :
4+ build : .
5+ image : " py"
6+ volumes :
7+ - .:/code
8+ # command: python main.py
9+ # other handy stuff:
10+ mongo :
11+ image : " mongo"
12+ # ports:
13+ # - "27017:27017"
14+ rabbitmq :
15+ image : " rabbitmq:management-alpine"
16+ # admin dashboard http://localhost:8080/ user:guest pw:guest
17+ ports :
18+ - " 8080:15672"
19+ postgres :
20+ image : postgres
21+ # ports:
22+ # - "5432:5432"
23+ environment :
24+ - POSTGRES_PASSWORD=postgres
25+ - POSTGRES_DB=postgres
Original file line number Diff line number Diff line change 1+ coverage
2+ ipython
3+ pylint
Original file line number Diff line number Diff line change 1+ coverage
2+ pylint
You can’t perform that action at this time.
0 commit comments