forked from fatiando/fatiando
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
63 lines (52 loc) · 1.93 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# Build, package, test, and clean Fatiando
TESTDIR=tmp-test-dir
COVDIR=tmp-cov-dir
PYTEST_ARGS=--doctest-modules -v --pyargs
PYTEST_COV_ARGS=--cov-config=../.coveragerc --cov-report=term-missing
help:
@echo "Commands:"
@echo ""
@echo " develop install fatiando in editable mode"
@echo " cython generate C code from Cython files"
@echo " test run the test suite (including doctests)"
@echo " pep8 check for PEP8 style compliance"
@echo " lint run static analysis using pylint"
@echo " check3 check for compatibility with Python 3"
@echo " check run all code quality checks (pep8, lint, check3)"
@echo " coverage calculate test coverage using Coverage"
@echo " clean clean up build and generated files"
@echo ""
develop:
pip install --no-deps -e .
cython:
python setup.py build_ext --inplace --cython
test:
# Run a tmp folder to make sure the tests are run on the installed version
mkdir -p $(TESTDIR)
cd $(TESTDIR); python -c "import fatiando; fatiando.test(verbose=True)"
rm -r $(TESTDIR)
coverage:
# Run a tmp folder to make sure the tests are run on the installed version
mkdir -p $(COVDIR)
cd $(COVDIR); pytest $(PYTEST_COV_ARGS) --cov=fatiando $(PYTEST_ARGS) fatiando
cp $(COVDIR)/.coverage* .
rm -r $(COVDIR)
pep8:
flake8 fatiando gallery setup.py
lint:
pylint fatiando gallery setup.py
check3:
pylint fatiando gallery setup.py --py3k
check: pep8 check3 lint
clean:
find . -name "*.so" -exec rm -v {} \;
find . -name "*.pyc" -exec rm -v {} \;
rm -rvf build dist MANIFEST fatiando.egg-info __pycache__ .coverage .cache
# Trash generated by the doctests
rm -rvf mydata.txt mylogfile.log
# The stuff fetched by the cookbook recipes
rm -rvf logo.png cookbook/logo.png
rm -rvf crust2.tar.gz cookbook/crust2.tar.gz
rm -rvf bouguer_alps_egm08.grd cookbook/bouguer_alps_egm08.grd
rm -rvf *.gdf cookbook/*.gdf
rm -rvf $(TESTDIR) $(COVDIR)