Makefile 1.19 KB
Newer Older
1
PY_SRC:=$(wildcard dmt/asn2dataModel.py dmt/aadl2glueC.py dmt/smp2asn.py dmt/*mappers/[a-zA-Z]*py dmt/commonPy/[a-zA-Z]*py)
2
PY_SRC:=$(filter-out dmt/B_mappers/antlr.main.py dmt/A_mappers/Stubs.py, ${PY_SRC})
3

4
5
6
7
8
9
10
# Python3.5 includes an older version of typing, which by default has priority over
# the one installed in $HOME/.local via setup.py.
#
# To address this, we find where our pip-installed typing lives:
TYPING_FOLDER:=$(shell pip3 show typing | grep ^Location | sed 's,^.*: ,,')
export PYTHONPATH=${TYPING_FOLDER}

11
# all:	flake8 pylint mypy coverage testDB
12
all:	flake8 mypy coverage testDB
13
14

flake8:
15
16
	@echo Performing syntax checks via flake8...
	@flake8 ${PY_SRC} || exit 1
17
18

pylint:
19
	@echo Performing static analysis via pylint...
20
	@pylint --disable=I --rcfile=pylint.cfg ${PY_SRC}  | grep -v '^$$' | sed -n '/^Report/q;p'
21
22

mypy:
23
	@echo Performing type analysis via mypy...
24
	@mypy --disallow-untyped-defs --check-untyped-defs ${PY_SRC} || exit 1
25

26
27
28
29
coverage:
	@echo Performing coverage checks...
	@$(MAKE) -C tests-coverage  || exit 1

30
testDB:
31
	@echo Installing DMT for local user...
32
	@pip3 install .
33
34
35
	@echo Performing database tests...
	@$(MAKE) -C tests-sqlalchemy  || exit 1

36
.PHONY:	flake8 pylint mypy coverage