Skip to content
Snippets Groups Projects
Commit bf264a2e authored by Christian Eichenberger's avatar Christian Eichenberger :badminton:
Browse files

Merge branch '71-one-click-installer-runner' into 'master'

Resolve "One-click installer+runner for notebooks Windows/Linux"

Closes #71

See merge request flatland/flatland!76
parents 3fc5f53d 28d0f3a2
No related branches found
No related tags found
No related merge requests found
...@@ -70,6 +70,12 @@ Ready to contribute? Here's how to set up `flatland` for local development. ...@@ -70,6 +70,12 @@ Ready to contribute? Here's how to set up `flatland` for local development.
$ cd flatland/ $ cd flatland/
$ python setup.py develop $ python setup.py develop
You can also use the virtual environment created by the getting_started scripts:
getting_started/run_notebooks.bat
getting_started/run_notebooks.sh
4. Create a branch for local development:: 4. Create a branch for local development::
$ git checkout -b name-of-your-bugfix-or-feature $ git checkout -b name-of-your-bugfix-or-feature
......
...@@ -47,6 +47,15 @@ Online Docs ...@@ -47,6 +47,15 @@ Online Docs
The documentation for the latest code on the master branch is found at `http://flatland-rl-docs.s3-website.eu-central-1.amazonaws.com/ <http://flatland-rl-docs.s3-website.eu-central-1.amazonaws.com/>`_ The documentation for the latest code on the master branch is found at `http://flatland-rl-docs.s3-website.eu-central-1.amazonaws.com/ <http://flatland-rl-docs.s3-website.eu-central-1.amazonaws.com/>`_
Run Notebooks with Examples with one Click
------------------------------------------
Under getting_started, there are two scripts
getting_started/run_notebooks.bat
getting_started/run_notebooks.sh
They require git and Python>=3.6 installed with venv (python3-venv has to be installed under Linux).
They create a virtual environment, install Flatland and all dependencies into into and start they Jupyter notebooks in your browser.
Generate Docs Generate Docs
......
@echo on
set PWD_BEFORE=%cd%
@echo off
echo "************ TESTING PREREQUISITES PYTHON3 + GIT *************************"
@echo on
git --version || goto :error
python3 --version || goto :error
@echo off
echo "************ SETUP VIRTUAL ENVIRONMENT FLATLAND *************************"
@echo on
set FLATLAND_BASEDIR=%~dp0\..
set WORKON_HOME=%FLATLAND_BASEDIR%\getting_started\envs_win
if not exist "%WORKON_HOME%" md "%WORKON_HOME%" || goto :error
cd "%WORKON_HOME%"
rem use venv instead of virtualenv/virtualenv-wrapper because of https://github.com/pypa/virtualenv/issues/355
python3 -m venv flatland || goto :error
rem ignore activation error: https://stackoverflow.com/questions/51358202/python-3-7-activate-venv-error-parameter-format-not-correct-65001-windows
call "%WORKON_HOME%\flatland\Scripts\activate.bat" || true
@echo off
echo "************ INSTALL FLATLAND IN THE VIRTUALENV *************************"
@echo on
python -m pip install --upgrade pip || goto :error
cd %FLATLAND_BASEDIR% || goto :error
python setup.py install || goto :error
REM ensure jupyter is installed in the virtualenv
pip install -r "%FLATLAND_BASEDIR%/requirements_dev.txt" -r "%FLATLAND_BASEDIR%\requirements_continuous_integration.txt" || goto :error
@echo off
echo "************ INSTALL JUPYTER EXTENSION *************************"
@echo on
jupyter nbextension install --py --sys-prefix widgetsnbextension || goto :error
jupyter nbextension enable --py --sys-prefix widgetsnbextension || goto :error
jupyter nbextension install --py --sys-prefix jpy_canvas || goto :error
jupyter nbextension enable --py --sys-prefix jpy_canvas || goto :error
jupyter notebook || goto :error
goto :EOF
:error
echo Failed with error #%errorlevel%.
cd "%PWD_BEFORE%" || true
deactivate || true
pause
#!/usr/bin/env bash
set -e # stop on error
set -x # echo commands
# https://stackoverflow.com/questions/4774054/reliable-way-for-a-bash-script-to-get-the-full-path-to-itself
FLATLAND_BASEDIR=$(dirname "$0")/..
FLATLAND_BASEDIR=$(realpath "$FLATLAND_BASEDIR")
echo "BASEDIR=${FLATLAND_BASEDIR}"
set +x
echo "************ TESTING PREREQUISITES PYTHON3 + GIT *************************"
set -x
set +x
echo "************ SETUP VIRTUAL ENVIRONMENT FLATLAND *************************"
set -x
export WORKON_HOME=${FLATLAND_BASEDIR}/getting_started/envs
echo WORKON_HOME=$WORKON_HOME
echo PWD=$PWD
mkdir -p ${WORKON_HOME}
# cannot work with virtualenvwrapper in script
cd ${WORKON_HOME}
python3 -m venv flatland
source flatland/bin/activate
set +x
echo "************ INSTALL FLATLAND IN THE VIRTUALENV *************************"
set -x
cd ${FLATLAND_BASEDIR}
python setup.py install
# ensure jupyter is installed in the virtualenv
pip install -r ${FLATLAND_BASEDIR}/requirements_dev.txt -r requirements_continuous_integration.txt
set +x
echo "************ INSTALL JUPYTER EXTENSION *************************"
set -x
jupyter nbextension install --py --sys-prefix widgetsnbextension
jupyter nbextension enable --py --sys-prefix widgetsnbextension
jupyter nbextension install --py --sys-prefix jpy_canvas
jupyter nbextension enable --py --sys-prefix jpy_canvas
jupyter notebook
...@@ -8,6 +8,7 @@ import sys ...@@ -8,6 +8,7 @@ import sys
from setuptools import setup, find_packages from setuptools import setup, find_packages
assert sys.version_info >= (3, 6)
with open('README.rst') as readme_file: with open('README.rst') as readme_file:
readme = readme_file.read() readme = readme_file.read()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment