XD blog

blog page

ci


2017-08-28 Continuous integration

Maintaining notebooks is a lot of work. I consider a notebook is ok if it runs with the latest versions of the packages it uses and if it can be converted into HTML to be included on a website. Easy when you have one notebook but what if you have more than 200 hundred of them to verify for your teachings? I had to automate. I started by running a virtual machine on Azure wich Jenkins and everything I needed. This machine is still up and running and tests everything once in a week for all my python package. But my teachings are also open source so I decided to use continuous integration to test my package on other distributions. I first used travis and appveyor but I could not include the compilation of the notebooks into documentation. It requires a couple of huge dependencies as latex. appveyor is quite slow and stops any job after one hour. travis was using Ubuntu 12.04 when I started and 14.04 now. I recently tried CircleCI 2.0. The design is really nice, it offers Ubuntu 16.04, the configuration file config.yml is much easier to read and to write. One interesting feature is artifacts. The user can easily copy in a specific folder whatever he wants to keep from the build and make it available to download. The other interesting feature is caching. CircleCI automatically caches a docker which contains the dependencies of the package to test. The first run is slow and the following are faster due to this option plus renewing the cache can be easily done by changing a file. So I decided it was worth spending some time enabling CircleCI anywhere. I described here all the steps to create a Python package, with unit tests and documentation and to build it on CircleCI : Tests unitaires, setup et ingéniérie logiciel (French).


Xavier Dupré