diff --git a/.gitignore b/.gitignore index 1712ed87f..e9e657075 100644 --- a/.gitignore +++ b/.gitignore @@ -21,3 +21,5 @@ __pycache__ \#*# .#* .coverage + +data_kernelspec diff --git a/.travis.yml b/.travis.yml index 5df5e3b5a..32869e485 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,18 +7,18 @@ python: - 3.3 - 2.7 sudo: false -before_install: - - git clone --quiet --depth 1 https://github.com/minrk/travis-wheels travis-wheels install: - - pip install -f travis-wheels/wheelhouse --pre -e . codecov nose_warnings_filters - - pip install -f travis-wheels/wheelhouse ipykernel[test] nose-timer - | - if [[ "$TRAVIS_PYTHON_VERSION" != "3.3" ]]; then + pip install --upgrade setuptools pip + pip install --pre . + pip install ipykernel[test] codecov + - | + if [[ "$TRAVIS_PYTHON_VERSION" == "3.6" || "$TRAVIS_PYTHON_VERSION" == "2.7" ]]; then pip install matplotlib fi - - python -c 'import ipykernel.kernelspec; ipykernel.kernelspec.install(user=True)' script: - - nosetests --with-coverage --with-timer --cover-package ipykernel ipykernel + - jupyter kernelspec list + - nosetests --with-coverage --with-timer --cover-package ipykernel ipykernel after_success: - codecov matrix: diff --git a/MANIFEST.in b/MANIFEST.in index 42edd273d..ce535d5dd 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -20,3 +20,5 @@ global-exclude *.pyc global-exclude *.pyo global-exclude .git global-exclude .ipynb_checkpoints + +prune data_kernelspec diff --git a/setup.cfg b/setup.cfg index 0c80d4cc5..60af4adf1 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,5 +1,5 @@ [bdist_wheel] -universal=1 +universal=0 [nosetests] warningfilters= default |.* |DeprecationWarning |ipykernel.* diff --git a/setup.py b/setup.py index 1060f3188..998a3744b 100644 --- a/setup.py +++ b/setup.py @@ -27,8 +27,9 @@ # get on with it #----------------------------------------------------------------------------- -import os from glob import glob +import os +import shutil from distutils.core import setup @@ -86,8 +87,22 @@ 'tornado>=4.0', ] +if any(a.startswith(('bdist', 'build', 'install')) for a in sys.argv): + from ipykernel.kernelspec import write_kernel_spec, make_ipkernel_cmd, KERNEL_NAME + + argv = make_ipkernel_cmd(executable='python') + dest = os.path.join(here, 'data_kernelspec') + if os.path.exists(dest): + shutil.rmtree(dest) + write_kernel_spec(dest, overrides={'argv': argv}) + + setup_args['data_files'] = [ + (pjoin('share', 'jupyter', 'kernels', KERNEL_NAME), glob(pjoin(dest, '*'))), + ] + extras_require = setuptools_args['extras_require'] = { - 'test:python_version=="2.7"': ['mock', 'nose_warnings_filters'], + 'test:python_version=="2.7"': ['mock'], + 'test': ['nose_warnings_filters', 'nose-timer'], } if 'setuptools' in sys.modules: