Skip to content

Commit 761bd9c

Browse files
authored
Merge pull request #138 from juhasch/update
Update tests and bump version to 0.5.0
2 parents 0c0c5db + 551b8d5 commit 761bd9c

File tree

6 files changed

+187
-15
lines changed

6 files changed

+187
-15
lines changed

.bumpversion.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[bumpversion]
2-
current_version = 0.4.1
2+
current_version = 0.5.0
33
commit = True
44
message = release {new_version}
55
tag = False

.travis.yml

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
# http://travis-ci.org/#!/jupyter-contrib/jupyter_nbextensions_configurator
2+
language: python
3+
sudo: false
4+
addons:
5+
firefox: latest
6+
dist: trusty
7+
matrix:
8+
fast_finish: true
9+
# Use the built-in venv for linux builds
10+
# 3.5 as it isn't installed by default. Let tox handle other versions.
11+
include:
12+
# python linting
13+
- os: linux
14+
python: '3.6'
15+
env: TOXENV=lint
16+
# check that conda build/install works
17+
- os: linux
18+
python: '3.7'
19+
env: TOXENV=condarecipe
20+
# linux, various python and notebook versions
21+
- os: linux
22+
python: '3.6'
23+
env: TOXENV=py36-notebook
24+
- os: linux
25+
python: '3.7'
26+
env: TOXENV=py37-notebook
27+
- os: linux
28+
python: 'pypy'
29+
env: TOXENV=pypy-notebook
30+
allow_failures:
31+
- env: TOXENV=lint
32+
- env: TOXENV=pypy-notebook
33+
- env: TOXENV=py36-notebook
34+
env:
35+
global:
36+
- LD_PRELOAD=/lib/x86_64-linux-gnu/libSegFault.so
37+
- SEGFAULT_SIGNALS=all
38+
before_install:
39+
- uname -a
40+
- id -un
41+
- id -Gn
42+
# stuff for conda recipe
43+
- 'if [[ ${TOXENV} == "condarecipe" ]]; then wget https://repo.anaconda.com/miniconda/Miniconda3-4.7.12.1-Linux-x86_64.sh -O miniconda.sh; fi'
44+
- 'if [[ ${TOXENV} == "condarecipe" ]]; then ( echo "bfe34e1fa28d6d75a7ad05fd02fa5472275673d5f5621b77380898dee1be15d2 miniconda.sh" | sha256sum -c - ); fi'
45+
- 'if [[ ${TOXENV} == "condarecipe" ]]; then bash miniconda.sh -b -p $HOME/miniconda; fi'
46+
- 'if [[ ${TOXENV} == "condarecipe" ]]; then export PATH="$HOME/miniconda/bin:$PATH"; fi'
47+
- 'if [[ ${TOXENV} == "condarecipe" ]]; then hash -r; fi'
48+
- 'if [[ ${TOXENV} == "condarecipe" ]]; then conda config --set always_yes yes --set changeps1 no; fi'
49+
- 'if [[ ${TOXENV} == "condarecipe" ]]; then conda info -a; fi # Useful for debugging any issues with conda'
50+
# update conda
51+
- 'if [[ ${TOXENV} == "condarecipe" ]]; then conda update --all; fi'
52+
- 'if [[ ${TOXENV} == "condarecipe" ]]; then conda install conda-build; fi'
53+
- 'if [[ ${TOXENV} == "condarecipe" ]]; then conda info -a; fi # Useful for debugging any issues with conda'
54+
- 'if [[ ${TOXENV} == "condarecipe" ]]; then git fetch --unshallow; fi'
55+
# also install npm configurable proxy for jupyterhub!
56+
- 'if [[ ${TOXENV} == "jupyterhub" ]]; then npm install -g configurable-http-proxy; fi;'
57+
# decide whether js tests will run
58+
- 'if [[ ${TRAVIS_OS_NAME} == "linux" ]] && [[ ${TOXENV} == py* || ${TOXENV} == jupyterhub ]]; then JS_TESTS="true"; else JS_TESTS="false"; fi;'
59+
- 'echo "\${JS_TESTS}=$JS_TESTS";'
60+
# for js tests (which we do on linux only), selenium 3 requires geckodriver
61+
- 'if [[ ${JS_TESTS} == "true" ]]; then GECKODRIVER_VERSION="0.16.1"; fi;'
62+
- 'if [[ ${JS_TESTS} == "true" ]]; then wget "https://github.com/mozilla/geckodriver/releases/download/v$GECKODRIVER_VERSION/geckodriver-v$GECKODRIVER_VERSION-linux64.tar.gz"; fi;'
63+
- 'if [[ ${JS_TESTS} == "true" ]]; then mkdir geckodriver; fi;'
64+
- 'if [[ ${JS_TESTS} == "true" ]]; then tar -xzf "geckodriver-v$GECKODRIVER_VERSION-linux64.tar.gz" -C geckodriver; fi;'
65+
- 'if [[ ${JS_TESTS} == "true" ]]; then export PATH="$PATH:$PWD/geckodriver"; fi;'
66+
# remove the downloaded archive, don't care if this fails
67+
- 'if [[ ${JS_TESTS} == "true" ]]; then rm "geckodriver-v$GECKODRIVER_VERSION-linux64.tar.gz" || true; fi;'
68+
# from https://docs.travis-ci.com/user/gui-and-headless-browsers/#Using-xvfb-to-Run-Tests-That-Require-a-GUI
69+
# we need to start xvfb for selenium to work correctly
70+
- 'if [[ ${JS_TESTS} == "true" ]]; then export DISPLAY=":99.0"; fi;'
71+
- 'if [[ ${JS_TESTS} == "true" ]]; then sh -e /etc/init.d/xvfb start && sleep 3; fi;'
72+
install:
73+
- python -m pip install tox
74+
- virtualenv --version
75+
- firefox --version
76+
script:
77+
- 'if [[ ${TOXENV} != "condarecipe" ]]; then tox -v -e ${TOXENV}; fi'
78+
# don't actually use tox for condarecipe :S
79+
- 'if [[ ${TOXENV} == "condarecipe" ]]; then conda config --append channels conda-forge; fi'
80+
- 'if [[ ${TOXENV} == "condarecipe" ]]; then conda config --get channels; fi'
81+
- 'if [[ ${TOXENV} == "condarecipe" ]]; then conda build conda.recipe/; fi'
82+
- 'if [[ ${TOXENV} == "condarecipe" ]]; then conda install --use-local jupyter_nbextensions_configurator; fi'
83+
after_script:
84+
# test if TOXENV not in set
85+
# see http://unix.stackexchange.com/a/111518
86+
- 'if ! [[ ${TOXENV} =~ ^(appveyorartifacts|check|lint|condarecipe)$ ]]; then tox -e coveralls,codecov; fi'
87+
after_failure:
88+
- more .tox/log/* | cat
89+
- more .tox/*/log/* | cat
90+
after_success:
91+
before_cache:
92+
- rm -rf $HOME/.cache/pip/log
93+
cache:
94+
directories:
95+
- $HOME/.cache/pip
96+
notifications:
97+
email: false

appveyor.yml

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
version: '{branch}-{build}'
2+
# we can't use shallow_clone to fetch a zip archive instead of git clone
3+
# because we need the git clone to run in order to have a git repo that
4+
# coveralls can look at.
5+
clone_depth: 10
6+
build: off
7+
cache:
8+
- '%LOCALAPPDATA%\pip\Cache'
9+
environment:
10+
matrix:
11+
- TOXENV: 'py27-notebook'
12+
TOXPYTHON: C:\Python27\python.exe
13+
PYTHON_HOME: C:\Python27
14+
PYTHON_VERSION: '2.7'
15+
PYTHON_ARCH: '32'
16+
- TOXENV: 'py33-notebook'
17+
TOXPYTHON: C:\Python33\python.exe
18+
PYTHON_HOME: C:\Python33
19+
PYTHON_VERSION: '3.3'
20+
PYTHON_ARCH: '32'
21+
- TOXENV: 'py34-notebook40'
22+
TOXPYTHON: C:\Python34\python.exe
23+
PYTHON_HOME: C:\Python34
24+
PYTHON_VERSION: '3.4'
25+
PYTHON_ARCH: '32'
26+
- TOXENV: 'py34-notebook41'
27+
TOXPYTHON: C:\Python34\python.exe
28+
PYTHON_HOME: C:\Python34
29+
PYTHON_VERSION: '3.4'
30+
PYTHON_ARCH: '32'
31+
- TOXENV: 'py34-notebook4x'
32+
TOXPYTHON: C:\Python34\python.exe
33+
PYTHON_HOME: C:\Python34
34+
PYTHON_VERSION: '3.4'
35+
PYTHON_ARCH: '32'
36+
- TOXENV: 'py35-notebook'
37+
TOXPYTHON: C:\Python35\python.exe
38+
PYTHON_HOME: C:\Python35
39+
PYTHON_VERSION: '3.5'
40+
PYTHON_ARCH: '32'
41+
init:
42+
- ps: echo $env:TOXENV
43+
- ps: ls C:\Python*
44+
install:
45+
# Prepend newly installed Python to the PATH of this build (this cannot be
46+
# done from inside a powershell script as it would require us to restart the
47+
# parent CMD process).
48+
- "SET PATH=%PYTHON_HOME%;%PYTHON_HOME%\\Scripts;%PATH%"
49+
# Check that we have the expected version and architecture for Python
50+
- "python --version"
51+
- "python -c \"import struct; print(struct.calcsize('P') * 8)\""
52+
# Upgrade to the latest version of pip to avoid it displaying warnings
53+
# about it being out of date.
54+
- 'python -m pip install --disable-pip-version-check --user --upgrade pip'
55+
# install tox
56+
- python -m pip install tox
57+
# install of the actual project is handled by tox in tests
58+
test_script:
59+
# run tox tests
60+
- '%PYTHON_HOME%\Scripts\tox -e %TOXENV%'
61+
62+
after_test:
63+
- cmd: '%PYTHON_HOME%\Scripts\tox -e codecov || (echo "codecov failed :(" && cmd /c "exit /b 0")'
64+
on_failure:
65+
- ps: dir "env:"
66+
- ps: get-content .tox\*\log\*
67+
artifacts:
68+
- path: .coverage
69+
- path: dist\*
70+
71+
### To enable remote debugging uncomment this (also, see: http://www.appveyor.com/docs/how-to/rdp-to-build-worker):
72+
# on_finish:
73+
# - ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))

setup.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,14 @@ def main():
2424
file, the interface also provides controls to configure the nbextensions'
2525
options.
2626
""",
27-
version='0.4.1',
27+
version='0.5.0',
2828
author='jcb91, jupyter-contrib developers',
2929
author_email='[email protected]',
3030
url=('https://github.com/'
3131
'jupyter-contrib/jupyter_nbextensions_configurator'),
3232
download_url=('https://github.com/'
3333
'jupyter-contrib/jupyter_nbextensions_configurator/'
34-
'tarball/0.4.1'),
34+
'tarball/0.5.0'),
3535
keywords=['Jupyter', 'notebook'],
3636
license='BSD 3-clause',
3737
platforms=['any'],
@@ -56,7 +56,7 @@ def main():
5656
install_requires=[
5757
'jupyter_contrib_core >=0.3.3',
5858
'jupyter_core',
59-
'notebook >=4.0',
59+
'notebook >=6.0',
6060
'pyyaml',
6161
'tornado',
6262
'traitlets',
@@ -68,7 +68,7 @@ def main():
6868
'requests',
6969
'selenium',
7070
],
71-
'test:python_version == "2.7"': [
71+
'test:python_version == "3.9"': [
7272
'mock',
7373
],
7474
},

tests/nbextensions_test_base.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
import logging
99
import os
10+
import sys
1011
from threading import Event, Thread
1112

1213
from jupyter_contrib_core.notebook_compat import serverextensions
@@ -117,6 +118,11 @@ def start_server_thread(cls, started_event):
117118
app = cls.notebook = NoseyNotebookApp(**cls.get_server_kwargs())
118119
# don't register signal handler during tests
119120
app.init_signal = lambda: None
121+
# start asyncio loop explicitly in notebook thread
122+
# (tornado 4 starts per-thread loops automatically, asyncio doesn’t)
123+
if 'asyncio' in sys.modules:
124+
import asyncio
125+
asyncio.set_event_loop(asyncio.new_event_loop())
120126
app.initialize(argv=[])
121127
loop = IOLoop.current()
122128
loop.add_callback(started_event.set)

tox.ini

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,35 +6,31 @@ envlist =
66
clean,
77
check,
88
lint,
9-
py27-notebook,
10-
py36-notebook{44,54,55},
9+
py36-notebook{57,65},
1110
py36-notebook,
1211
report,
1312

1413
[testenv]
1514
basepython =
1615
pypy: {env:TOXPYTHON:pypy}
17-
py27: {env:TOXPYTHON:python2.7}
1816
py36: {env:TOXPYTHON:python3.6}
19-
py37: {env:TOXPYTHON:python3.7}
20-
{docs,spell}: {env:TOXPYTHON:python2.7}
17+
{docs,spell}: {env:TOXPYTHON:python3.6}
2118
setenv =
2219
PYTHONPATH={toxinidir}/tests
2320
PYTHONUNBUFFERED=yes
2421
passenv = *
2522
usedevelop = false
2623
deps =
2724
coverage
28-
jupyterhub: jupyterhub>=0.9
25+
jupyterhub: jupyterhub>=2.3.1
2926
mock
3027
nose
31-
notebook44: https://github.com/jupyter/notebook/archive/4.4.0.zip
32-
notebook54: https://github.com/jupyter/notebook/archive/5.4.0.zip
33-
notebook55: https://github.com/jupyter/notebook/archive/5.5.0.zip
28+
notebook57: notebook==5.7
29+
notebook64: notebook==6.4
3430
notebookmaster: https://github.com/jupyter/notebook/archive/master.zip
3531
notebook: notebook
3632
requests
37-
selenium>=3.4
33+
selenium>=4.3
3834
commands =
3935
{posargs:coverage run --parallel-mode --source=src -m nose -vv -a '!uses_jupyterhub' tests}
4036

0 commit comments

Comments
 (0)