Using Travis-ci With Wxpython Tests
Solution 1:
I've been trying to do the same thing for quite some time. Here's what I've found:
Travis-CI:
One of the reasons things are a little difficult is that Travis-CI is running Ubunutu 12.04, and wxPython only has pre-built binaries up to 11.04. Another reason was that some ubuntu packages were disallowed on travis (though they have since been whitelisted).
Python 2 and wxPython 2.8:
This one is pretty easy, since it's in the ubuntu apt repositories. Have the following in your .travis.yml file:
addons:apt:packages:# for wxPython:-python-wxgtk2.8-python-wxtools-wx2.8-doc-wx2.8-examples-wx2.8-headers-wx2.8-i18n
For Python 2 and wxPython 3.0 (classic, not Phoenix):
You can use Conda to install it wxPython. Here's the relevent portion of .travis.yml:
before_install:
# get Conda
- if [[ "$TRAVIS_PYTHON_VERSION" == "2.7" ]]; then
wget https://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh -O miniconda.sh;
else
wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh;
fi
- bash miniconda.sh -b -p $HOME/miniconda
- export PATH="$HOME/miniconda/bin:$PATH"
- hash -r
- conda config --set always_yes yes --set changeps1 no
- conda update -q conda
# Useful for debugging any issues with conda
- conda info -a
install:
# install wxPython 3.0.0.0
- conda install -c https://conda.anaconda.org/travis wxpython
(I personally like it in before_install
, but you could also put this towards the top of install
).
For Python 3 and wxPython Phoenix 3.0:
I've so far been unsuccessful with this. I've tried:
- building from source using the build/build.py script provided by wxPython
- building from source in the standard linux way (
configure
,make
,make install
) - using conda
pip install --upgrade --pre --trusted-host wxpython.org -vvv -f http://wxpython.org/Phoenix/snapshot-builds/ wxPython_Phoenix
- note the -vvv on pip: since the build takes ~20 minutes, Travis will abort if there's no console output (it assumes the cmd has locked up). Adding verbosity prevents that abort from happening.
and none of them have worked completely. Some got further than others: for example, installing via pip
appears to get through the wxWidgets configure and make just fine, but fails somewhere in the SIP build (it also takes 20 minutes...)
Hopefully I figure it out soon.
Appveyor:
I know you only asked about Travis, but I use Travis + AppVeyor to cover all operating systems so I figured others do the same. Might as well keep all the info in one place.
These are much, much easier. Simply find a pre-built wheel file for the version of wxPython that you want and install it with pip
:
- "%CMD_IN_ENV% pip install --upgrade --pre http://wxpython.org/Phoenix/snapshot-builds/wxPython_Phoenix-3.0.3.dev1820+49a8884-cp34-none-win32.whl"
Solution 2:
For newer versions of wxpython you will need to install using pip and the wheel file. There are some pre-builds avaialble in this location: https://extras.wxpython.org/wxPython4/extras/linux/gtk3/ubuntu-14.04/
The travis file that worked for me is:
language: python
python:
- "3.5.3"addons:
apt:
packages:
- libwebkitgtk-dev
- libjpeg-dev
- libtiff-dev
- libgtk2.0-dev
- libsdl1.2-dev
- libgstreamer-plugins-base0.10-dev
- freeglut3
- freeglut3-dev
- libnotify-dev
# command to install dependencies
install:
- sudo apt-get update
- wget "https://extras.wxpython.org/wxPython4/extras/linux/gtk3/ubuntu-14.04/wxPython-4.0.0b1-cp35-cp35m-linux_x86_64.whl"
- pip install wxPython-4.0.0b1-cp35-cp35m-linux_x86_64.whl
script: nosetests -v --with-id --with-coverage --with-html --cover-package=./
Notice that the location for whl files are:
- Oficial releases are located here: https://extras.wxpython.org/wxPython4/extras/linux/
- Pre-release builds are here: https://wxpython.org/Phoenix/snapshot-builds/linux
Post a Comment for "Using Travis-ci With Wxpython Tests"