diff --git a/Dockerfile-dev b/Dockerfile-dev index a95cc130..47dfd0c6 100644 --- a/Dockerfile-dev +++ b/Dockerfile-dev @@ -23,4 +23,8 @@ # FROM quantopian/zipline -RUN cd /zipline && pip install -r etc/requirements_dev.txt -r etc/requirements_blaze.txt +WORKDIR /zipline + +RUN pip install -r etc/requirements_dev.txt -r etc/requirements_blaze.txt +# Clean out any cython assets. The pip install re-builds them. +RUN find . -type f -name '*.c' -exec rm {} + && pip install -e .[all] diff --git a/Vagrantfile b/Vagrantfile index cea3af95..b1f9671f 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -2,8 +2,7 @@ # vi: set ft=ruby : Vagrant.configure("2") do |config| - config.vm.box = "precise64" - config.vm.box_url = "http://files.vagrantup.com/precise64.box" + config.vm.box = "ubuntu/trusty64" config.vm.provider :virtualbox do |vb| vb.customize ["modifyvm", :id, "--memory", 2048, "--cpus", 2] end diff --git a/docs/source/whatsnew/1.0.2.txt b/docs/source/whatsnew/1.0.2.txt index f88bf8c8..46e609c6 100644 --- a/docs/source/whatsnew/1.0.2.txt +++ b/docs/source/whatsnew/1.0.2.txt @@ -12,6 +12,9 @@ Enhancements must search for when querying data. The checkpoints should have novel deltas applied (:issue:`1276`). +- Updated VagrantFile to include all dev requirements and use a newer image + (:issue:`1310`). + Bug Fixes ~~~~~~~~~ diff --git a/vagrant_init.sh b/vagrant_init.sh index e92983b2..e2ca39ce 100644 --- a/vagrant_init.sh +++ b/vagrant_init.sh @@ -10,6 +10,7 @@ # from the root of the zipline github checkout. # This will put the zipline code in the # /vagrant folder in the system. +set -e VAGRANT_LOG="/home/vagrant/vagrant.log" @@ -18,33 +19,35 @@ VAGRANT_LOG="/home/vagrant/vagrant.log" # (grub-pc will complain that your boot device changed, probably # due to something that vagrant did, and break your console) -echo "Obstructing updates to grub-pc..." -apt-mark hold grub-pc 2>&1 >> "$VAGRANT_LOG" +echo "Obstructing updates to grub-pc..." | tee -a "$VAGRANT_LOG" +apt-mark hold grub-pc 2>&1 | tee -a "$VAGRANT_LOG" -# Run a full apt-get update first. -echo "Updating apt-get caches..." -apt-get -y update 2>&1 >> "$VAGRANT_LOG" +echo "Adding python apt repo..." | tee -a "$VAGRANT_LOG" +apt-add-repository -y ppa:fkrull/deadsnakes-python2.7 2>&1 | tee -a "$VAGRANT_LOG" +echo "Updating apt-get caches..." | tee -a "$VAGRANT_LOG" +apt-get -y update 2>&1 | tee -a "$VAGRANT_LOG" -# Install required packages -echo "Installing required packages..." -apt-get -y install python-pip python-dev g++ make libfreetype6-dev libpng-dev libopenblas-dev liblapack-dev gfortran 2>&1 >> "$VAGRANT_LOG" +echo "Installing required system packages..." | tee -a "$VAGRANT_LOG" +apt-get -y install python2.7 python-dev g++ make libfreetype6-dev libpng-dev libopenblas-dev liblapack-dev gfortran pkg-config git 2>&1 | tee -a "$VAGRANT_LOG" -# Add ta-lib -echo "Installing ta-lib integration..." -wget http://switch.dl.sourceforge.net/project/ta-lib/ta-lib/0.4.0/ta-lib-0.4.0-src.tar.gz 2>&1 "$VAGRANT_LOG" -tar -xvzf ta-lib-0.4.0-src.tar.gz 2>&1 >> "$VAGRANT_LOG" +echo "Installing ta-lib..." | tee -a "$VAGRANT_LOG" +wget http://prdownloads.sourceforge.net/ta-lib/ta-lib-0.4.0-src.tar.gz --no-verbose -a "$VAGRANT_LOG" +tar -xvzf ta-lib-0.4.0-src.tar.gz 2>&1 | tee -a "$VAGRANT_LOG" cd ta-lib/ -./configure --prefix=/usr 2>&1 >> "$VAGRANT_LOG" -make 2>&1 >> "$VAGRANT_LOG" -sudo make install 2>&1 >> "$VAGRANT_LOG" +./configure --prefix=/usr 2>&1 | tee -a "$VAGRANT_LOG" +make 2>&1 | tee -a "$VAGRANT_LOG" +sudo make install 2>&1 | tee -a "$VAGRANT_LOG" cd ../ -# Add Zipline python dependencies -echo "Installing python package dependencies..." -/vagrant/etc/ordered_pip.sh /vagrant/etc/requirements.txt 2>&1 >> "$VAGRANT_LOG" -# Add scipy next (if it's not done now, breaks installing of statsmodels for some reason ??) -echo "Installing scipy..." -pip install scipy==0.12.0 2>&1 >> "$VAGRANT_LOG" -echo "Installing zipline dev python dependencies..." -pip install --exists-action w -r /vagrant/etc/requirements_dev.txt 2>&1 >> "$VAGRANT_LOG" -echo "Finished!" +echo "Installing pip and setuptools..." | tee -a "$VAGRANT_LOG" +wget https://bootstrap.pypa.io/get-pip.py 2>&1 | tee -a "$VAGRANT_LOG" +python get-pip.py 2>&1 >> "$VAGRANT_LOG" | tee -a "$VAGRANT_LOG" +echo "Installing zipline python dependencies..." | tee -a "$VAGRANT_LOG" +/vagrant/etc/ordered_pip.sh /vagrant/etc/requirements.txt 2>&1 | tee -a "$VAGRANT_LOG" +echo "Installing zipline extra python dependencies..." | tee -a "$VAGRANT_LOG" +pip install -r /vagrant/etc/requirements_dev.txt -r /vagrant/etc/requirements_blaze.txt 2>&1 | tee -a "$VAGRANT_LOG" +echo "Installing zipline package itself..." | tee -a "$VAGRANT_LOG" +# Clean out any cython assets. The pip install re-builds them. +find /vagrant/ -type f -name '*.c' -exec rm {} + +pip install -e /vagrant[all] 2>&1 | tee -a "$VAGRANT_LOG" +echo "Finished! zipline repo is in '/vagrant'." | tee -a "$VAGRANT_LOG"