2015-12-08 02:13:40 +08:00
|
|
|
# simple makefile to simplify repetitive build env management tasks under posix
|
2010-08-08 19:41:03 +08:00
|
|
|
|
2010-10-06 20:06:25 +08:00
|
|
|
# caution: testing won't work on windows, see README
|
|
|
|
|
|
2010-08-27 14:51:10 +08:00
|
|
|
PYTHON ?= python
|
2011-09-03 19:05:10 +08:00
|
|
|
CYTHON ?= cython
|
2017-11-17 03:20:35 +08:00
|
|
|
PYTEST ?= pytest
|
2010-10-31 19:50:08 +08:00
|
|
|
CTAGS ?= ctags
|
2010-08-27 14:51:10 +08:00
|
|
|
|
2015-11-05 23:27:48 +08:00
|
|
|
# skip doctests on 32bit python
|
|
|
|
|
BITS := $(shell python -c 'import struct; print(8 * struct.calcsize("P"))')
|
|
|
|
|
|
2011-08-24 18:32:17 +08:00
|
|
|
all: clean inplace test
|
2010-08-08 19:41:03 +08:00
|
|
|
|
2010-10-31 19:50:08 +08:00
|
|
|
clean-ctags:
|
|
|
|
|
rm -f tags
|
|
|
|
|
|
2013-10-13 22:34:13 +08:00
|
|
|
clean: clean-ctags
|
2013-10-13 02:12:08 +08:00
|
|
|
$(PYTHON) setup.py clean
|
|
|
|
|
rm -rf dist
|
2010-08-08 19:41:03 +08:00
|
|
|
|
2010-08-17 20:01:47 +08:00
|
|
|
in: inplace # just a shortcut
|
2010-08-08 19:41:03 +08:00
|
|
|
inplace:
|
2010-08-27 14:51:10 +08:00
|
|
|
$(PYTHON) setup.py build_ext -i
|
2010-08-08 19:41:03 +08:00
|
|
|
|
2011-08-24 18:32:17 +08:00
|
|
|
test-code: in
|
2018-08-22 17:07:13 +08:00
|
|
|
$(PYTEST) --showlocals -v sklearn --durations=20
|
2014-05-21 09:44:46 +08:00
|
|
|
test-sphinxext:
|
2017-11-17 03:20:35 +08:00
|
|
|
$(PYTEST) --showlocals -v doc/sphinxext/
|
2010-09-29 22:07:34 +08:00
|
|
|
test-doc:
|
2015-11-05 23:27:48 +08:00
|
|
|
ifeq ($(BITS),64)
|
2017-11-17 03:20:35 +08:00
|
|
|
$(PYTEST) $(shell find doc -name '*.rst' | sort)
|
2015-11-05 23:27:48 +08:00
|
|
|
endif
|
2019-06-14 04:47:12 +08:00
|
|
|
test-code-parallel: in
|
|
|
|
|
$(PYTEST) -n auto --showlocals -v sklearn --durations=20
|
2010-10-14 22:32:23 +08:00
|
|
|
|
|
|
|
|
test-coverage:
|
2012-07-25 16:51:48 +08:00
|
|
|
rm -rf coverage .coverage
|
2017-11-23 18:02:05 +08:00
|
|
|
$(PYTEST) sklearn --showlocals -v --cov=sklearn --cov-report=html:coverage
|
2019-06-14 04:47:12 +08:00
|
|
|
test-coverage-parallel:
|
|
|
|
|
rm -rf coverage .coverage .coverage.*
|
|
|
|
|
$(PYTEST) sklearn -n auto --showlocals -v --cov=sklearn --cov-report=html:coverage
|
2010-10-31 19:50:08 +08:00
|
|
|
|
2014-05-21 09:44:46 +08:00
|
|
|
test: test-code test-sphinxext test-doc
|
2010-10-31 19:50:08 +08:00
|
|
|
|
2010-11-06 22:46:50 +08:00
|
|
|
trailing-spaces:
|
2014-03-27 22:56:40 +08:00
|
|
|
find sklearn -name "*.py" -exec perl -pi -e 's/[ \t]*$$//' {} \;
|
2010-11-06 22:46:50 +08:00
|
|
|
|
2011-09-03 19:05:10 +08:00
|
|
|
cython:
|
2016-11-15 15:12:19 +08:00
|
|
|
python setup.py build_src
|
2011-09-03 19:05:10 +08:00
|
|
|
|
2010-10-31 19:50:08 +08:00
|
|
|
ctags:
|
|
|
|
|
# make tags for symbol based navigation in emacs and vim
|
|
|
|
|
# Install with: sudo apt-get install exuberant-ctags
|
2015-07-16 18:15:17 +08:00
|
|
|
$(CTAGS) --python-kinds=-i -R sklearn
|
2011-10-04 21:44:17 +08:00
|
|
|
|
|
|
|
|
doc: inplace
|
2013-12-05 19:59:38 +08:00
|
|
|
$(MAKE) -C doc html
|
2011-10-04 21:44:17 +08:00
|
|
|
|
|
|
|
|
doc-noplot: inplace
|
2013-12-05 19:59:38 +08:00
|
|
|
$(MAKE) -C doc html-noplot
|
2012-10-31 23:34:22 +08:00
|
|
|
|
|
|
|
|
code-analysis:
|
|
|
|
|
flake8 sklearn | grep -v __init__ | grep -v external
|
|
|
|
|
pylint -E -i y sklearn/ -d E1103,E0611,E1101
|
2016-08-30 10:59:57 +08:00
|
|
|
|
|
|
|
|
flake8-diff:
|
2021-01-22 22:19:48 +08:00
|
|
|
git diff upstream/main -u -- "*.py" | flake8 --diff
|