diff --git a/.travis.yml b/.travis.yml index 3b53acd7859c56ff0713cc72f9c4a06cc00ffa29..c9c170e8b9280866f9c4e09780570a966c63f9f1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -32,4 +32,4 @@ install: script: - cd "$TRAVIS_BUILD_DIR" - - bash ./tools/scripts/travis_tests.sh + - env -i bash ./tools/scripts/travis_tests.sh diff --git a/Vagrantfile b/Vagrantfile index 6ef3dd7944623f1d80035dd5cb2d900f566b8735..a5061cbc752f3697a80452c1ee532a3acded207e 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -26,12 +26,17 @@ Vagrant.configure(2) do |config| chown -R vagrant.vagrant /home/vagrant/lisa + # Let' use a venv local to vagrant so that we don't pollute the host one. + # This allows to use LISA both from the host and the VM. + export LISA_VENV_PATH=/home/vagrant/venv + # .bashrc setup echo "cd /home/vagrant/lisa" >> /home/vagrant/.bashrc for LC in $(locale | cut -d= -f1); do echo unset $LC >> /home/vagrant/.bashrc done + echo 'export LISA_VENV_PATH=$LISA_VENV_PATH' >> /home/vagrant/.bashrc echo 'source init_env' >> /home/vagrant/.bashrc # Trigger the creation of a venv diff --git a/init_env b/init_env index e908781dbb70ca6bd597fce142fb12431bff82ba..d054389a86d24438debbf49565762b45ddaade06 100644 --- a/init_env +++ b/init_env @@ -20,6 +20,14 @@ _lisa_shell_ret=1 +# Ensure we aleays start from a clean new shell +if [[ -n $LISA_HOME ]]; then + echo + echo "ERROR: Please source init_env from a fresh new shell." + echo + return +fi + setup_paths() { # Bail out if local tools are not installed [[ -d $LISA_HOME/tools/android-sdk-linux ]] || return diff --git a/install_base_ubuntu.sh b/install_base_ubuntu.sh index ada1553778f7e8e58ab1dff4555e3435c2898f67..71c8ac247fa088072e0704bc0c5561eb09d3aefb 100755 --- a/install_base_ubuntu.sh +++ b/install_base_ubuntu.sh @@ -42,6 +42,16 @@ install_sdk() { fi } +install_nodejs() { + # NodeJS v8+ is required, Ubuntu 16.04 LTS supports only an older version. + # As a special case we can install it as a snap package + if grep 16.04 /etc/lsb-release >/dev/null; then + sudo snap install node --classic --channel=8 + return + fi + sudo apt-get install -y nodejs npm +} + set -eu install_android_sdk=n @@ -64,6 +74,10 @@ apt-get -y install build-essential git wget expect kernelshark \ python3 python3-pip python3-venv python3-tk gobject-introspection \ libcairo2-dev libgirepository1.0-dev gir1.2-gtk-3.0 +install_nodejs + if [ "$install_android_sdk" == y ]; then install_sdk fi + +# vim: set tabstop=4 shiftwidth=4 textwidth=80 expandtab: diff --git a/setup.py b/setup.py index b8f724f79e7486d8ae01f05e31ef858fc31fd2c2..f24ca6067cae4d02534e08aa2de0ed21270bd7cf 100755 --- a/setup.py +++ b/setup.py @@ -104,7 +104,8 @@ setup( extras_require={ "notebook": [ "ipython", - "jupyterlab" + "jupyterlab", + "ipywidgets", ], "doc": [ diff --git a/shell/lisa_shell b/shell/lisa_shell index 712609de6ac92c3dc2dc23216009bf7ae53bbab9..57b62c9aa2b8d487396f083e63fead8a5767b71c 100755 --- a/shell/lisa_shell +++ b/shell/lisa_shell @@ -154,6 +154,22 @@ function _lisa-upgrade-pip { fi } +function _lisa-install-nbextensions { + which jupyter &>/dev/null || return + if which node &>/dev/null; then + echo + echo "Enabling ipywidget extensions..." + jupyter labextension install @jupyter-widgets/jupyterlab-manager + return + fi + + # If NodeJS is still not available, we just warn the user + echo + echo "NOTE: Missing NodeJS support!" + echo "Install it on your system and run lisa-install " + echo "again if you want to enable ipywidgets support." +} + function lisa-install { # Check that some prerequisites are available on the system, since they # cannot be installed using pip in a venv @@ -196,6 +212,9 @@ function lisa-install { # Make sure the shell has taken into account the new content of directories # listed in $PATH. _lisa-reload-PATH + + # Install additiona Jupyter Notebook extensions + _lisa-install-nbextensions } ################################################################################ @@ -403,6 +422,9 @@ EOF # LISA Shell MAIN ################################################################################ +# Activate the venv unless it was explicitely disabled +lisa-venv-activate + # Dump out a nice LISA Shell logo clear echo -e "$LISASHELL_BANNER" @@ -418,8 +440,13 @@ Welcome to the Linux Integrated System Analysis SHELL! LISA version : $(git rev-parse --short=11 HEAD) python version : $PYTHON_VERSION LISA_HOME : $LISA_HOME + EOF +if which jupyter >/dev/null; then + jupyter labextension list +fi + cat <