-
Notifications
You must be signed in to change notification settings - Fork 150
/
Makefile
86 lines (62 loc) · 2.76 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
PROJECTNAME = allensdk
DISTDIR = dist
BUILDDIR = build
export RELEASE=dev$(BUILD_NUMBER)
RELEASEDIR = $(PROJECTNAME)-$(VERSION).$(RELEASE)
EGGINFODIR = $(PROJECTNAME).egg-info
DOCDIR = doc
COVDIR = htmlcov
TEST_THREADS ?= 4
DOC_URL=http://alleninstitute.github.io/AllenSDK
#ZIP_FILENAME=AllenSDK-master.zip
#TGZ_FILENAME=AllenSDK-master.tar.gz
#ZIP_URL=https:\/\/github.com\/AllenInstitute\/AllenSDK\/archive\/master.zip
#TGZ_URL=https:\/\/github.com\/AllenInstitute\/AllenSDK\/archive\/master.tar.gz
NOTEBOOKS = $(shell find ./doc_template/examples_root/examples/nb ./doc_template/examples_root/examples/nb/summer_workshop_2015 -maxdepth 1 -name '*.ipynb')
.PHONY: clean $(NOTEBOOKS) notebooks
build:
mkdir -p $(DISTDIR)/$(PROJECTNAME)
cp -r allensdk setup.py README.md $(DISTDIR)/$(PROJECTNAME)/
cd $(DISTDIR); tar czvf $(PROJECTNAME).tgz --exclude .git $(PROJECTNAME)
distutils_build: clean
python setup.py build
setversion:
sed -i --expression 's/'\''[0-9]\+.[0-9]\+.[0-9]\+'\''/'\''${VERSION}.${RELEASE}'\''/g' allensdk/__init__.py
sdist: distutils_build
python setup.py sdist
pypi_register:
python setup.py register --repository https://testpypi.python.org/pypi
pypi_deploy:
python setup.py sdist upload --repository https://testpypi.python.org/pypi
pytest_lax:
py.test -s --boxed --cov=allensdk --cov-config coveragerc --cov-report html --junitxml=test-reports/test.xml -n $(TEST_THREADS) --durations=0
pytest: pytest_lax
test: pytest
pytest_pep8:
find -L . -name "test_*.py" -exec py.test --boxed --pep8 --cov-config coveragerc --cov=allensdk --cov-report html --junitxml=test-reports/test.xml {} \+
pytest_lite:
find -L . -name "test_*.py" -exec py.test --boxed --assert=reinterp --junitxml=test-reports/test.xml {} \+
pylint:
pylint --disable=C allensdk > htmlcov/pylint.txt || exit 0
grep import-error htmlcov/pylint.txt > htmlcov/pylint_imports.txt
flake8:
flake8 --ignore=E201,E202,E226 --max-line-length=200 --filename 'allensdk/**/*.py' allensdk | grep -v "local variable '_' is assigned to but never used" > htmlcov/flake8.txt
grep -i "import" htmlcov/flake8.txt > htmlcov/imports.txt || exit 0
EXAMPLES=doc/_static/examples
doc: FORCE
mkdir -p $(DOCDIR)
cp -r doc_template/* $(DOCDIR)
cd $(DOCDIR); sphinx-build -b html . _build/html;
$(NOTEBOOKS):
jupyter-nbconvert --to notebook --execute --ExecutePreprocessor.timeout=$(timeout) --ExecutePreprocessor.kernel_name=$(python_kernel) $@
notebooks: $(NOTEBOOKS)
notebooks-neuron:
jupyter-nbconvert --to notebook --execute --ExecutePreprocessor.timeout=$(timeout) --ExecutePreprocessor.kernel_name=$(python_kernel) ./doc_template/examples_root/examples/nb/neuron/pulse_stimulus.ipynb
FORCE:
clean:
rm -rf $(DISTDIR)
rm -rf $(BUILDDIR)
rm -rf $(RELEASEDIR)
rm -rf $(EGGINFODIR)
rm -rf $(DOCDIR)
rm -rf $(COVDIR)