Skip to content

Commit 213be83

Browse files
committed
Automate local dev setup
1 parent f8a74ec commit 213be83

File tree

6 files changed

+45
-12
lines changed

6 files changed

+45
-12
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ install:
1717
- pip install -r requirements.txt
1818
- pip install .
1919
- pip install -r requirements-test.txt
20+
- pip install codecov
2021
- python -m spylon_kernel install --user
2122

2223
script:

Makefile

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
.PHONY: test
2+
3+
SA:=source activate
4+
ENV:=spylon-kernel-dev
5+
6+
help:
7+
# http://marmelab.com/blog/2016/02/29/auto-documented-makefile.html
8+
@grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
9+
10+
activate: ## Make a conda activate command for eval `make activate`
11+
@echo "$(SA) $(ENV)"
12+
13+
clean: ## Make a clean source tree
14+
-rm -rf dist
15+
-rm -rf build
16+
-rm -rf *.egg-info
17+
-find . -name __pycache__ -exec rm -fr {} \;
18+
19+
env: ## Make a conda dev environment
20+
conda create -y -n $(ENV) python=3.5 notebook
21+
source activate $(ENV) && \
22+
pip install -r requirements.txt -r requirements-test.txt -e . && \
23+
python -m spylon_kernel install --sys-prefix
24+
25+
notebook: ## Make a development notebook
26+
$(SA) $(ENV) && jupyter notebook --notebook-dir=examples/ \
27+
--no-browser \
28+
--NotebookApp.token=''
29+
30+
nuke: ## Make clean + remove conda env
31+
-conda env remove -n $(ENV) -y
32+
33+
test: ## Make a test run
34+
$(SA) $(ENV) && coverage run run_tests.py -vrsx --capture=sys --color=yes

requirements-test.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
pytest
2-
codecov
32
coverage
43
jupyter_kernel_test

requirements.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1+
ipykernel
2+
jedi>=0.10
13
metakernel
24
spylon[spark]
3-
jedi>=0.10
45
tornado
5-
ipykernel

run_tests.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,6 @@
33
import pytest
44

55
if __name__ == '__main__':
6-
# show output results from every test function
7-
args = ['-vv']
8-
# show the message output for skipped and expected failure tests
9-
args.append('-rxs')
10-
args.append('--capture=sys')
11-
args.append('--color=yes')
12-
args.extend(sys.argv[1:])
136
# call pytest and exit with the return code from pytest so that
147
# travis will fail correctly if tests fail
15-
sys.exit(pytest.main(args))
8+
sys.exit(pytest.main(sys.argv[1:]))

setup.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,13 @@
1414
version=versioneer.get_version(),
1515
cmdclass=versioneer.get_cmdclass(),
1616
url='http://github.com/maxpoint/spylon-kernel',
17-
install_requires=['spylon[spark]', 'metakernel', 'jedi', 'tornado', 'ipykernel'],
17+
install_requires=[
18+
'ipykernel',
19+
'jedi>=0.10',
20+
'metakernel',
21+
'spylon[spark]',
22+
'tornado',
23+
],
1824
packages=list(find_packages()),
1925
author='Marius van Niekerk',
2026
author_email='[email protected]',

0 commit comments

Comments
 (0)