Much of my  work over the past few weeks has involved updating infrastructure or otherwise paying down bits of accumulated technical debt. It seems every goal I’ve been aiming towards has a half dozen dependencies that have to first be addressed before I can get to the “real work.” Not an uncommon scenario, I know, but no less frustrating when you are staring down deadlines. One of these annoying blockers has been getting my development Jupyter (nee IPython) notebook environments updated.

Jupyter notebooks don’t often make me very happy. I never got swept up in the IPython craze, preferring to work directly from an editor and a terminal window most of the time. It wasn’t until RStudio came out with notebooks for R Markdown that I started to see the power of having results inline with my code. Admittedly, the RStudio approach makes more sense to me, with simple RMarkdown files that tend to be much lighter in weight and easier to commit to source control than the big blobs that are ipynb files. Yet for a current project I needed to get an interactive python environment where I could run bits of code, fiddle with the results, and iterate over the code (call it failure driven development). I had a Vagrant environment set up and all configured with Chef, but it fell apart when I went to update a number of dependencies which hadn’t been touched in over a year.

While I hacked away on what I thought was a personal fork of the cookbook I used to deploy IPython, I suddenly got a notice from the maintainer that my code had been merged and that I had been made a collaborator on the project. It turns out I had actually submitted a pull request for this code several months ago which hadn’t been merged. My updates to the branch caused the author to notice, merge the changes, and grant me commit access to the project. Yikes. I guess I’m partly responsible for this thing now. Well, I couldn’t let that one pass!

Today I pushed a new set of changes to the ipython-notebook-cookbook that scratches a number of itches and code smells:

  • Use the Jupyter and IPython 4.x stack by default, moving away from the old defaults of IPython 1.0 (!)
  • Move from a bundled Vagrant file to Test Kitchen 
  • Full linting and clean up with current cookstyle linters
  • Dependency updates, including moving to the super nifty poise-python and poise-service cookbooks
  • Initial minimal integration tests via inspec

There’s much more I’d like to accomplish here, including getting this up on the public Supermarket, pulling out more of the deployment of the scientific stack, and maybe building in support for R as an alternative kernel. Yet I have to remind myself that there is other code that I need to be writing – the code that actually got me looking at this in the first place – and that’s the stuff my partners are a wee bit anxious to see.

Check out the cookbook and see if it meets your needs. Issues and pull requests are welcome!