Makefile 1.38 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
# 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:
8
TYPING_FOLDER:=$(shell pip3 show typing 2>/dev/null | grep ^Location | sed 's,^.*: ,,')
9 10
export PYTHONPATH=${TYPING_FOLDER}

11 12 13 14 15 16 17 18 19 20
all:	tests

tests:	flake8 pylint mypy coverage testDB

configure:
	./configure

install:	configure
	pip3 uninstall -y dmt || exit 0  # Uninstall if there, but don't abort if not installed
	pip3 install --user .
21 22

flake8:
23 24
	@echo Performing syntax checks via flake8...
	@flake8 ${PY_SRC} || exit 1
25 26

pylint:
27
	@echo Performing static analysis via pylint...
28
	@pylint --disable=I --rcfile=pylint.cfg ${PY_SRC}  | grep -v '^$$' | sed -n '/^Report/q;p'
29 30

mypy:
31
	@echo Performing type analysis via mypy...
32
	@mypy --disallow-untyped-defs --check-untyped-defs --ignore-missing-imports ${PY_SRC} || exit 1
33

34 35 36 37
coverage:
	@echo Performing coverage checks...
	@$(MAKE) -C tests-coverage  || exit 1

38
testDB:
39
	@echo Installing DMT for local user...
40
	@pip3 install .
41 42 43
	@echo Performing database tests...
	@$(MAKE) -C tests-sqlalchemy  || exit 1

44
.PHONY:	flake8 pylint mypy coverage install configure