33VENV =venv
44PYTHON =$(VENV ) /bin/python
55PIP =$(VENV ) /bin/pip --disable-pip-version-check
6- PYLINT =$(VENV ) /bin/pylint
6+ FLAKE8 =$(VENV ) /bin/flake8
77MYPY =$(VENV ) /bin/mypy
8- BLACK =$(VENV ) /bin/black
98TOX =$(VENV ) /bin/tox
109PYTEST =$(VENV ) /bin/pytest
10+ DOCKER_COMPOSE =docker-compose
1111PRE_COMMIT =$(VENV ) /bin/pre-commit
1212WHEEL =$(VENV ) /bin/wheel
1313TWINE =$(VENV ) /bin/twine
@@ -31,23 +31,20 @@ all: help
3131$(PIP ) :
3232 python3 -m venv $(VENV )
3333
34- $(PYLINT ) : $(PIP )
35- $(PIP ) install pylint
34+ $(FLAKE8 ) : $(PIP )
35+ $(PIP ) install flake8==4.0.1
3636
3737$(MYPY ) : $(PIP )
38- $(PIP ) install mypy
39-
40- $(BLACK ) : $(PIP )
41- $(PIP ) install black
38+ $(PIP ) install mypy==0.812
4239
4340$(TOX ) : $(PIP )
4441 $(PIP ) install tox
4542
4643$(PYTEST ) : $(PIP )
47- $(PIP ) install pytest
44+ $(PIP ) install pytest==6.2.5 pytest-cov==3.0.0
4845
4946$(PRE_COMMIT ) : $(PIP )
50- $(PIP ) install pre-commit
47+ $(PIP ) install pre-commit==2.15.0
5148
5249$(WHEEL ) : $(PIP )
5350 $(PIP ) install wheel
@@ -59,19 +56,18 @@ ifdef TOXENV
5956toxparams? =-e $(TOXENV )
6057endif
6158
62- # # format - Code formatter.
63- format : $(BLACK )
64- $(BLACK ) -l120 -S -v $(PROJECT )
65-
66- # # lint - Lint and type checking.
67- lint : $(PYLINT ) $(MYPY ) $(BLACK )
68- $(PYLINT ) --rcfile pylintrc $(PROJECT )
69- $(MYPY ) $(PROJECT ) /
70- $(BLACK ) -l120 -S --check -v $(PROJECT ) || true
59+ # # install - Install dependencies.
60+ install : $(PIP )
61+ $(PIP ) install -r requirements.txt
7162
7263# # hooks - Run pre-commit hooks.
7364hooks : $(PRE_COMMIT )
74- $(PRE_COMMIT ) run -a
65+ $(PRE_COMMIT ) run --all-files --show-diff-on-failure
66+
67+ # # lint - Lint and type checking.
68+ lint : $(FLAKE8 ) $(MYPY )
69+ $(FLAKE8 ) $(PROJECT ) /
70+ $(MYPY ) $(PROJECT ) /
7571
7672# # test - Run all tests.
7773test : test.unit test.integration
@@ -82,11 +78,11 @@ test.unit: $(TOX) $(PYTEST)
8278
8379# # test.integration - Run integration tests.
8480test.integration :
85- docker-compose -f docker-compose.ci.yaml rm --stop --force
86- docker-compose -f docker-compose.ci.yaml pull
87- docker-compose -f docker-compose.ci.yaml build sut
88- docker-compose -f docker-compose.ci.yaml up --exit-code-from sut
89- docker-compose -f docker-compose.ci.yaml rm --stop --force
81+ $( DOCKER_COMPOSE ) -f docker-compose.ci.yaml rm --stop --force
82+ $( DOCKER_COMPOSE ) -f docker-compose.ci.yaml pull
83+ $( DOCKER_COMPOSE ) -f docker-compose.ci.yaml build sut
84+ $( DOCKER_COMPOSE ) -f docker-compose.ci.yaml up --exit-code-from sut
85+ $( DOCKER_COMPOSE ) -f docker-compose.ci.yaml rm --stop --force
9086
9187# # run - Run application.
9288run :
@@ -102,7 +98,8 @@ build: $(PIP) $(WHEEL) $(PKG_SDIST) $(PKG_WHEEL)
10298
10399$(PKG_SDIST ) :
104100 $(PYTHON ) setup.py sdist
105- $(PKG_WHEEL ) :
101+
102+ $(PKG_WHEEL ) : $(WHEEL )
106103 $(PYTHON ) setup.py bdist_wheel
107104
108105# # upload - Upload package to PyPI.
0 commit comments