From 50c365c58ccab0b7af7d0af703931f4d122abc6d Mon Sep 17 00:00:00 2001 From: "Jessica B. Hamrick" Date: Fri, 30 Oct 2015 18:17:01 -0700 Subject: [PATCH] Flesh out development installation instructions --- CONTRIBUTING.md | 66 +++++++++++++++++++++++++++++++++++++++++++++++++ README.md | 2 ++ 2 files changed, 68 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 6b73dbf31..f6028b607 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,3 +1,69 @@ # Contributing We follow the [IPython Contributing Guide](https://github.com/ipython/ipython/blob/master/CONTRIBUTING.md). + +For development installation instructions, see the [README](README.md#dev-quickstart). + +## Managing static files + +The notebook relies on static dependencies (which are installed with Bower), its own minified JavaScript, and CSS compiled from LESS. + +### Static dependencies + +To install the static dependencies, run: + + python setup.py jsdeps + +You can also pass a `-f` flag to this command to force Bower to run, if necessary. + +### Minified JavaScript + +To compile the minified JavaScript, run: + + python setup.py js + +You can also run the notebook server without relying on the minified JavaScript by passing the `--NotebookApp.ignore_minified_js=True` flag when launching the notebook. + +### Compiling CSS + +To compile the CSS from LESS, run: + + python setup.py css + +### Git hooks + +If you want to automatically update dependencies, recompile the JavaScript, and recompile the CSS after checking out a new commit, you can install post-checkout and post-merge hooks which will do it for you: + + ./git-hooks/install-hooks.sh + +See the [git-hooks readme](git-hooks/README.md) for more details. + +## Running tests + +### JavaScript tests + +To run the JavaScript tests, you will need to have PhantomJS and CasperJS installed: + + npm install -g casperjs phantomjs@1.9.18 + +Then, to run the JavaScript tests: + + python -m notebook.jstest [group] + +where `[group]` is an optional argument that is a path relative to `notebook/tests`. For example, to run all tests in `notebook/tests/notebook`: + + python -m notebook.jstest notebook + +or to run just `notebook/tests/notebook/deletecell.js`: + + python -m notebook.jstest notebook/deletecell.js + +### Python tests + +To run Python tests, run: + + nosetests notebook + +If you want coverage statistics as well, you can run: + + nosetests --with-coverage --cover-package=notebook notebook diff --git a/README.md b/README.md index 06619d062..148673c24 100644 --- a/README.md +++ b/README.md @@ -42,6 +42,8 @@ For a local installation, make sure you have [pip installed](https://pip.readthe _NOTE_: For Debian/Ubuntu systems, if you're installing the system node you need to use the 'nodejs-legacy' package and not the 'node' package. +For more detailed development install instructions (e.g. recompiling javascript and css, running tests), please see the [contributing guide](CONTRIBUTING.md). + ### Ubuntu Trusty ```