Skip to content

Commit

Permalink
Merge pull request #138 from juhasch/update
Browse files Browse the repository at this point in the history
Update tests and bump version to 0.5.0
  • Loading branch information
juhasch authored Jul 9, 2022
2 parents 0c0c5db + 551b8d5 commit 761bd9c
Show file tree
Hide file tree
Showing 6 changed files with 187 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 0.4.1
current_version = 0.5.0
commit = True
message = release {new_version}
tag = False
Expand Down
97 changes: 97 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
# http://travis-ci.org/#!/jupyter-contrib/jupyter_nbextensions_configurator
language: python
sudo: false
addons:
firefox: latest
dist: trusty
matrix:
fast_finish: true
# Use the built-in venv for linux builds
# 3.5 as it isn't installed by default. Let tox handle other versions.
include:
# python linting
- os: linux
python: '3.6'
env: TOXENV=lint
# check that conda build/install works
- os: linux
python: '3.7'
env: TOXENV=condarecipe
# linux, various python and notebook versions
- os: linux
python: '3.6'
env: TOXENV=py36-notebook
- os: linux
python: '3.7'
env: TOXENV=py37-notebook
- os: linux
python: 'pypy'
env: TOXENV=pypy-notebook
allow_failures:
- env: TOXENV=lint
- env: TOXENV=pypy-notebook
- env: TOXENV=py36-notebook
env:
global:
- LD_PRELOAD=/lib/x86_64-linux-gnu/libSegFault.so
- SEGFAULT_SIGNALS=all
before_install:
- uname -a
- id -un
- id -Gn
# stuff for conda recipe
- 'if [[ ${TOXENV} == "condarecipe" ]]; then wget https://repo.anaconda.com/miniconda/Miniconda3-4.7.12.1-Linux-x86_64.sh -O miniconda.sh; fi'
- 'if [[ ${TOXENV} == "condarecipe" ]]; then ( echo "bfe34e1fa28d6d75a7ad05fd02fa5472275673d5f5621b77380898dee1be15d2 miniconda.sh" | sha256sum -c - ); fi'
- 'if [[ ${TOXENV} == "condarecipe" ]]; then bash miniconda.sh -b -p $HOME/miniconda; fi'
- 'if [[ ${TOXENV} == "condarecipe" ]]; then export PATH="$HOME/miniconda/bin:$PATH"; fi'
- 'if [[ ${TOXENV} == "condarecipe" ]]; then hash -r; fi'
- 'if [[ ${TOXENV} == "condarecipe" ]]; then conda config --set always_yes yes --set changeps1 no; fi'
- 'if [[ ${TOXENV} == "condarecipe" ]]; then conda info -a; fi # Useful for debugging any issues with conda'
# update conda
- 'if [[ ${TOXENV} == "condarecipe" ]]; then conda update --all; fi'
- 'if [[ ${TOXENV} == "condarecipe" ]]; then conda install conda-build; fi'
- 'if [[ ${TOXENV} == "condarecipe" ]]; then conda info -a; fi # Useful for debugging any issues with conda'
- 'if [[ ${TOXENV} == "condarecipe" ]]; then git fetch --unshallow; fi'
# also install npm configurable proxy for jupyterhub!
- 'if [[ ${TOXENV} == "jupyterhub" ]]; then npm install -g configurable-http-proxy; fi;'
# decide whether js tests will run
- 'if [[ ${TRAVIS_OS_NAME} == "linux" ]] && [[ ${TOXENV} == py* || ${TOXENV} == jupyterhub ]]; then JS_TESTS="true"; else JS_TESTS="false"; fi;'
- 'echo "\${JS_TESTS}=$JS_TESTS";'
# for js tests (which we do on linux only), selenium 3 requires geckodriver
- 'if [[ ${JS_TESTS} == "true" ]]; then GECKODRIVER_VERSION="0.16.1"; fi;'
- 'if [[ ${JS_TESTS} == "true" ]]; then wget "https://github.com/mozilla/geckodriver/releases/download/v$GECKODRIVER_VERSION/geckodriver-v$GECKODRIVER_VERSION-linux64.tar.gz"; fi;'
- 'if [[ ${JS_TESTS} == "true" ]]; then mkdir geckodriver; fi;'
- 'if [[ ${JS_TESTS} == "true" ]]; then tar -xzf "geckodriver-v$GECKODRIVER_VERSION-linux64.tar.gz" -C geckodriver; fi;'
- 'if [[ ${JS_TESTS} == "true" ]]; then export PATH="$PATH:$PWD/geckodriver"; fi;'
# remove the downloaded archive, don't care if this fails
- 'if [[ ${JS_TESTS} == "true" ]]; then rm "geckodriver-v$GECKODRIVER_VERSION-linux64.tar.gz" || true; fi;'
# from https://docs.travis-ci.com/user/gui-and-headless-browsers/#Using-xvfb-to-Run-Tests-That-Require-a-GUI
# we need to start xvfb for selenium to work correctly
- 'if [[ ${JS_TESTS} == "true" ]]; then export DISPLAY=":99.0"; fi;'
- 'if [[ ${JS_TESTS} == "true" ]]; then sh -e /etc/init.d/xvfb start && sleep 3; fi;'
install:
- python -m pip install tox
- virtualenv --version
- firefox --version
script:
- 'if [[ ${TOXENV} != "condarecipe" ]]; then tox -v -e ${TOXENV}; fi'
# don't actually use tox for condarecipe :S
- 'if [[ ${TOXENV} == "condarecipe" ]]; then conda config --append channels conda-forge; fi'
- 'if [[ ${TOXENV} == "condarecipe" ]]; then conda config --get channels; fi'
- 'if [[ ${TOXENV} == "condarecipe" ]]; then conda build conda.recipe/; fi'
- 'if [[ ${TOXENV} == "condarecipe" ]]; then conda install --use-local jupyter_nbextensions_configurator; fi'
after_script:
# test if TOXENV not in set
# see http://unix.stackexchange.com/a/111518
- 'if ! [[ ${TOXENV} =~ ^(appveyorartifacts|check|lint|condarecipe)$ ]]; then tox -e coveralls,codecov; fi'
after_failure:
- more .tox/log/* | cat
- more .tox/*/log/* | cat
after_success:
before_cache:
- rm -rf $HOME/.cache/pip/log
cache:
directories:
- $HOME/.cache/pip
notifications:
email: false
73 changes: 73 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
version: '{branch}-{build}'
# we can't use shallow_clone to fetch a zip archive instead of git clone
# because we need the git clone to run in order to have a git repo that
# coveralls can look at.
clone_depth: 10
build: off
cache:
- '%LOCALAPPDATA%\pip\Cache'
environment:
matrix:
- TOXENV: 'py27-notebook'
TOXPYTHON: C:\Python27\python.exe
PYTHON_HOME: C:\Python27
PYTHON_VERSION: '2.7'
PYTHON_ARCH: '32'
- TOXENV: 'py33-notebook'
TOXPYTHON: C:\Python33\python.exe
PYTHON_HOME: C:\Python33
PYTHON_VERSION: '3.3'
PYTHON_ARCH: '32'
- TOXENV: 'py34-notebook40'
TOXPYTHON: C:\Python34\python.exe
PYTHON_HOME: C:\Python34
PYTHON_VERSION: '3.4'
PYTHON_ARCH: '32'
- TOXENV: 'py34-notebook41'
TOXPYTHON: C:\Python34\python.exe
PYTHON_HOME: C:\Python34
PYTHON_VERSION: '3.4'
PYTHON_ARCH: '32'
- TOXENV: 'py34-notebook4x'
TOXPYTHON: C:\Python34\python.exe
PYTHON_HOME: C:\Python34
PYTHON_VERSION: '3.4'
PYTHON_ARCH: '32'
- TOXENV: 'py35-notebook'
TOXPYTHON: C:\Python35\python.exe
PYTHON_HOME: C:\Python35
PYTHON_VERSION: '3.5'
PYTHON_ARCH: '32'
init:
- ps: echo $env:TOXENV
- ps: ls C:\Python*
install:
# Prepend newly installed Python to the PATH of this build (this cannot be
# done from inside a powershell script as it would require us to restart the
# parent CMD process).
- "SET PATH=%PYTHON_HOME%;%PYTHON_HOME%\\Scripts;%PATH%"
# Check that we have the expected version and architecture for Python
- "python --version"
- "python -c \"import struct; print(struct.calcsize('P') * 8)\""
# Upgrade to the latest version of pip to avoid it displaying warnings
# about it being out of date.
- 'python -m pip install --disable-pip-version-check --user --upgrade pip'
# install tox
- python -m pip install tox
# install of the actual project is handled by tox in tests
test_script:
# run tox tests
- '%PYTHON_HOME%\Scripts\tox -e %TOXENV%'

after_test:
- cmd: '%PYTHON_HOME%\Scripts\tox -e codecov || (echo "codecov failed :(" && cmd /c "exit /b 0")'
on_failure:
- ps: dir "env:"
- ps: get-content .tox\*\log\*
artifacts:
- path: .coverage
- path: dist\*

### To enable remote debugging uncomment this (also, see: http://www.appveyor.com/docs/how-to/rdp-to-build-worker):
# on_finish:
# - ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
8 changes: 4 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ def main():
file, the interface also provides controls to configure the nbextensions'
options.
""",
version='0.4.1',
version='0.5.0',
author='jcb91, jupyter-contrib developers',
author_email='[email protected]',
url=('https://github.com/'
'jupyter-contrib/jupyter_nbextensions_configurator'),
download_url=('https://github.com/'
'jupyter-contrib/jupyter_nbextensions_configurator/'
'tarball/0.4.1'),
'tarball/0.5.0'),
keywords=['Jupyter', 'notebook'],
license='BSD 3-clause',
platforms=['any'],
Expand All @@ -56,7 +56,7 @@ def main():
install_requires=[
'jupyter_contrib_core >=0.3.3',
'jupyter_core',
'notebook >=4.0',
'notebook >=6.0',
'pyyaml',
'tornado',
'traitlets',
Expand All @@ -68,7 +68,7 @@ def main():
'requests',
'selenium',
],
'test:python_version == "2.7"': [
'test:python_version == "3.9"': [
'mock',
],
},
Expand Down
6 changes: 6 additions & 0 deletions tests/nbextensions_test_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import logging
import os
import sys
from threading import Event, Thread

from jupyter_contrib_core.notebook_compat import serverextensions
Expand Down Expand Up @@ -117,6 +118,11 @@ def start_server_thread(cls, started_event):
app = cls.notebook = NoseyNotebookApp(**cls.get_server_kwargs())
# don't register signal handler during tests
app.init_signal = lambda: None
# start asyncio loop explicitly in notebook thread
# (tornado 4 starts per-thread loops automatically, asyncio doesn’t)
if 'asyncio' in sys.modules:
import asyncio
asyncio.set_event_loop(asyncio.new_event_loop())
app.initialize(argv=[])
loop = IOLoop.current()
loop.add_callback(started_event.set)
Expand Down
16 changes: 6 additions & 10 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -6,35 +6,31 @@ envlist =
clean,
check,
lint,
py27-notebook,
py36-notebook{44,54,55},
py36-notebook{57,65},
py36-notebook,
report,

[testenv]
basepython =
pypy: {env:TOXPYTHON:pypy}
py27: {env:TOXPYTHON:python2.7}
py36: {env:TOXPYTHON:python3.6}
py37: {env:TOXPYTHON:python3.7}
{docs,spell}: {env:TOXPYTHON:python2.7}
{docs,spell}: {env:TOXPYTHON:python3.6}
setenv =
PYTHONPATH={toxinidir}/tests
PYTHONUNBUFFERED=yes
passenv = *
usedevelop = false
deps =
coverage
jupyterhub: jupyterhub>=0.9
jupyterhub: jupyterhub>=2.3.1
mock
nose
notebook44: https://github.com/jupyter/notebook/archive/4.4.0.zip
notebook54: https://github.com/jupyter/notebook/archive/5.4.0.zip
notebook55: https://github.com/jupyter/notebook/archive/5.5.0.zip
notebook57: notebook==5.7
notebook64: notebook==6.4
notebookmaster: https://github.com/jupyter/notebook/archive/master.zip
notebook: notebook
requests
selenium>=3.4
selenium>=4.3
commands =
{posargs:coverage run --parallel-mode --source=src -m nose -vv -a '!uses_jupyterhub' tests}

Expand Down

0 comments on commit 761bd9c

Please sign in to comment.