Skip to content

Commit

Permalink
Showing 10 changed files with 206 additions and 170 deletions.
19 changes: 6 additions & 13 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -14,18 +14,12 @@ matrix:
- python: "2.7"
env: USE_QT_API=PyQt4 USE_CONDA=true
os: linux
- python: "3.3"
env: USE_QT_API=PyQt4 USE_CONDA=true
os: linux
- python: "3.4"
env: USE_QT_API=PyQt4 USE_CONDA=true
os: linux
#- python: "2.7"
# env: USE_QT_API=PyQt5 USE_CONDA=true
# os: linux
#- python: "3.3"
# env: USE_QT_API=PyQt5 USE_CONDA=true
# os: linux
#- python: "3.4"
# env: USE_QT_API=PyQt5 USE_CONDA=true
# os: linux
@@ -39,9 +33,6 @@ matrix:
#- python: "2.7"
# env: USE_QT_API=PySide USE_CONDA=false
# os: linux
#- python: "3.3"
# env: USE_QT_API=PySide USE_CONDA=false
# os: linux
#- python: "3.4"
# env: USE_QT_API=PySide USE_CONDA=false
# os: linux
@@ -56,8 +47,10 @@ install:
- export PATH="$HOME/miniconda/bin:$PATH";
- source activate test-environment;
- QT_API=$USE_QT_API;
- export SPYDER_TEST_TRAVIS=True;
- export SPYDER_TEST_TRAVIS_TIMER=30000;

script:
- python bootstrap.py --test-travis 30
- python setup.py install
- ./continuous_integration/travis_script.sh
script:
- ./continuous_integration/build_test.sh
- ./continuous_integration/run_test.sh
- ./continuous_integration/modules_test.sh
11 changes: 0 additions & 11 deletions bootstrap.py
Original file line number Diff line number Diff line change
@@ -42,9 +42,6 @@
default=False, help="Disable Apport exception hook (Ubuntu)")
parser.add_option('--debug', action='store_true',
default=False, help="Run Spyder in debug mode")
parser.add_option('--test-travis', dest="shutdown_time", default=None,
help="Closes the application after the entered number of "
"seconds. Useful in continuous integration testing.")

options, args = parser.parse_args()

@@ -166,12 +163,4 @@
# gmtime() converts float into tuple, but loses milliseconds
("%.4f" % time_lapse).split('.')[1])

# Set variable to start timer inside spyder application
if options.shutdown_time is not None:
timer_seconds = int(options.shutdown_time)
os.environ['SPYDER_TEST_TRAVIS'] = 'True'
# In miliseconds
os.environ['SPYDER_TEST_TRAVIS_TIMER'] = str(timer_seconds*1000)
print("\nSpyder will automatically shut down in {} seconds.\n".format(timer_seconds))

start_app.main()
9 changes: 9 additions & 0 deletions continuous_integration/build_test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/usr/bin/env bash

set -ex

if [ "$USE_CONDA" = true ] ; then
# Building the recipe
cd continuous_integration
conda build conda.recipe
fi
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -7,7 +7,8 @@ build:
osx_is_app: True

source:
git_url: ../
git_url: {{ [environ.get('HOME'), '/pr-clone']|join }}
git_tag: {{ ['travis_pr_', environ.get('TRAVIS_PULL_REQUEST')]|join }}

requirements:
build:
@@ -25,6 +26,8 @@ requirements:
- sphinx
- pep8
- psutil
- pylint
- six
- python.app [osx]

test:
51 changes: 51 additions & 0 deletions continuous_integration/modules_test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
#!/usr/bin/env bash

set -ex

for f in spyderlib/*.py; do
if [[ $f == "spyderlib/restart_app.py" ]]; then
continue
fi
if [[ $f == "spyderlib/spyder.py" ]]; then
continue
fi
if [[ $f == "spyderlib/tour.py" ]]; then
continue
fi
if [[ $f == "spyderlib/start_app.py" ]]; then
continue
fi
if [[ $f == "spyderlib/pil_patch.py" ]]; then
continue
fi
python "$f"
if [ $? -ne 0 ]; then
exit 1
fi
done


for f in spyderlib/*/*.py; do
if [[ $f == spyderlib/plugins/*.py ]]; then
continue
fi
if [[ $f == spyderlib/qt/*.py ]]; then
continue
fi
if [[ $f == spyderlib/utils/environ.py ]]; then
continue
fi
if [[ $f == spyderlib/utils/qthelpers.py ]]; then
continue
fi
if [[ $f == spyderlib/utils/windows.py ]]; then
continue
fi
if [[ $f == spyderlib/widgets/*.py ]]; then
continue
fi
python "$f"
if [ $? -ne 0 ]; then
exit 1
fi
done
17 changes: 17 additions & 0 deletions continuous_integration/run_test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/env bash

set -ex

if [ "$USE_CONDA" = true ] ; then
# Move to a tmp dir
mkdir ~/tmp
cd ~/tmp

# Install and run the package
conda install ~/miniconda/conda-bld/linux-64/spyder-*.tar.bz2

spyder
if [ $? -ne 0 ]; then
exit 1
fi
fi
213 changes: 119 additions & 94 deletions continuous_integration/travis_install.sh
Original file line number Diff line number Diff line change
@@ -5,131 +5,156 @@ set -ex
PY_VERSION=$TRAVIS_PYTHON_VERSION
WHEELHOUSE_URI=http://travis-wheels.scikit-image.org/

#==============================================================================
# Utility functions
#==============================================================================
download_pr()
{
PR=$TRAVIS_PULL_REQUEST
mkdir ~/pr-clone
git clone https://github.com/spyder-ide/spyder.git ~/pr-clone
cd ~/pr-clone
git fetch origin pull/$PR/head:travis_pr_$PR
}


install_conda()
{
# Define the value to download
if [ "$TRAVIS_OS_NAME" = "linux" ]; then
MINICONDA_OS=$MINICONDA_LINUX;
elif [ "$TRAVIS_OS_NAME" = "osx" ]; then
MINICONDA_OS=$MINICONDA_OSX;
fi

# You may want to periodically update this, although the conda update
# conda line below will keep everything up-to-date. We do this
# conditionally because it saves us some downloading if the version is
# the same.

if [ "$PY_VERSION" = "2.7" ]; then
wget "http://repo.continuum.io/miniconda/Miniconda-$MINICONDA_VERSION-$MINICONDA_OS.sh" -O miniconda.sh;
else
wget "http://repo.continuum.io/miniconda/Miniconda3-$MINICONDA_VERSION-$MINICONDA_OS.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;

# Test environments for different Qt bindings
if [ "$USE_QT_API" = "PyQt5" ]; then
#sudo apt-get install -q "^libxcb.*" libx11-xcb-dev libglu1-mesa-dev libxrender-dev libxi-dev
#sudo apt-get install -q libxcb-sync0-dev libxcb-render-util0 libxcb-image0 libxcb-xfixes0 libxcb-randr0 libxcb-keysyms1
#sudo cp- /usr/lib/libxcb-render-util.so.0 /usr/lib/x86_64-linux-gnu/libxcb-render-util.so.0
if [ "$TRAVIS_OS_NAME" = "linux" ]; then
MINICONDA_OS=$MINICONDA_LINUX;
elif [ "$TRAVIS_OS_NAME" = "osx" ]; then
MINICONDA_OS=$MINICONDA_OSX;
fi

# You may want to periodically update this, although the conda update
# conda line below will keep everything up-to-date. We do this
# conditionally because it saves us some downloading if the version is
# the same.
if [ "$PY_VERSION" = "2.7" ]; then
wget "http://repo.continuum.io/miniconda/Miniconda-$MINICONDA_VERSION-$MINICONDA_OS.sh" -O miniconda.sh;
else
wget "http://repo.continuum.io/miniconda/Miniconda3-$MINICONDA_VERSION-$MINICONDA_OS.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;

# Installing conda-build and jinja2 to do build tests
conda install jinja2;
conda install conda-build;

# Test environments for different Qt bindings
if [ "$USE_QT_API" = "PyQt5" ]; then
#sudo apt-get install -q "^libxcb.*" libx11-xcb-dev libglu1-mesa-dev libxrender-dev libxi-dev
#sudo apt-get install -q libxcb-sync0-dev libxcb-render-util0 libxcb-image0 libxcb-xfixes0 libxcb-randr0 libxcb-keysyms1
#sudo cp- /usr/lib/libxcb-render-util.so.0 /usr/lib/x86_64-linux-gnu/libxcb-render-util.so.0

sudo apt-get install -q "^libxcb.*" libx11-xcb-dev libglu1-mesa-dev libxrender-dev libxi-dev
#sudo ln -sf /usr/lib/x86_64-linux-gnu/libxcb-render-util.so.0 /usr/lib/libxcb-render-util.so.0

conda config --add channels dsdale24;
conda create -q -n test-environment python=$PY_VERSION sphinx sip qt5 pyqt5;
ldd "$HOME/miniconda/envs/test-environment/lib/qt5/plugins/platforms/libqxcb.so"

# libxcb-atom1-dev libxcb-event1-dev libxcb-icccm1-dev
# ldd /home/goanpeca/anaconda/envs/test-environment/lib/qt5/plugins/platforms/libqxcb.so
#
elif [ "$USE_QT_API" = "PyQt4" ]; then
conda create -q -n test-environment python=$PY_VERSION sphinx sip qt pyqt;
elif [ "$USE_QT_API" = "PySide" ]; then
conda create -q -n test-environment python=$PY_VERSION sphinx sip qt pyside;
fi

conda install -q -n test-environment $TEST_PACKAGES
sudo apt-get install -q "^libxcb.*" libx11-xcb-dev libglu1-mesa-dev libxrender-dev libxi-dev
#sudo ln -sf /usr/lib/x86_64-linux-gnu/libxcb-render-util.so.0 /usr/lib/libxcb-render-util.so.0

conda config --add channels dsdale24;
conda create -q -n test-environment python=$PY_VERSION sphinx sip qt5 pyqt5;
ldd "$HOME/miniconda/envs/test-environment/lib/qt5/plugins/platforms/libqxcb.so"

# libxcb-atom1-dev libxcb-event1-dev libxcb-icccm1-dev
# ldd /home/goanpeca/anaconda/envs/test-environment/lib/qt5/plugins/platforms/libqxcb.so
#
elif [ "$USE_QT_API" = "PyQt4" ]; then
conda create -q -n test-environment python=$PY_VERSION sphinx sip qt pyqt;
elif [ "$USE_QT_API" = "PySide" ]; then
conda create -q -n test-environment python=$PY_VERSION sphinx sip qt pyside;
fi

conda install -q -n test-environment $TEST_PACKAGES
}


install_pyside()
{
# Currently support for python 2.7, 3.3, 3.4
# http://stackoverflow.com/questions/24489588/how-can-i-install-pyside-on-travis
sudo apt-get install libqt4-dev;
pip install --upgrade pip;
pip install PySide --no-index --find-links=$WHEELHOUSE_URI;
# Travis CI servers use virtualenvs, so we need to finish the install by the following
POSTINSTALL=$(find ~/virtualenv/ -type f -name "pyside_postinstall.py";)
python $POSTINSTALL -install;
# Currently support for python 2.7, 3.3, 3.4
# http://stackoverflow.com/questions/24489588/how-can-i-install-pyside-on-travis
sudo apt-get install libqt4-dev;
pip install --upgrade pip;
pip install PySide --no-index --find-links=$WHEELHOUSE_URI;
# Travis CI servers use virtualenvs, so we need to finish the install by the following
POSTINSTALL=$(find ~/virtualenv/ -type f -name "pyside_postinstall.py";)
python $POSTINSTALL -install;
}


install_qt4()
{
# Install Qt and then update the Matplotlib settings
sudo apt-get install -q libqt4-dev pyqt4-dev-tools;
# Install Qt and then update the Matplotlib settings
sudo apt-get install -q libqt4-dev pyqt4-dev-tools;

if [[ $PY_VERSION == 2.7* ]]; then
sudo apt-get install python-dev
sudo apt-get install -q python-qt4
else
sudo apt-get install python3-dev
fi
if [[ $PY_VERSION == 2.7* ]]; then
sudo apt-get install python-dev
sudo apt-get install -q python-qt4
else
sudo apt-get install python3-dev
fi

# http://stackoverflow.com/a/9716100
LIBS=( PyQt4 sip.so )
# http://stackoverflow.com/a/9716100
LIBS=( PyQt4 sip.so )

VAR=( $(which -a python$PY_VERSION) )
VAR=( $(which -a python$PY_VERSION) )

GET_PYTHON_LIB_CMD="from distutils.sysconfig import get_python_lib; print (get_python_lib())"
LIB_VIRTUALENV_PATH=$(python -c "$GET_PYTHON_LIB_CMD")
LIB_SYSTEM_PATH=$(${VAR[-1]} -c "$GET_PYTHON_LIB_CMD")
GET_PYTHON_LIB_CMD="from distutils.sysconfig import get_python_lib; print (get_python_lib())"
LIB_VIRTUALENV_PATH=$(python -c "$GET_PYTHON_LIB_CMD")
LIB_SYSTEM_PATH=$(${VAR[-1]} -c "$GET_PYTHON_LIB_CMD")

for LIB in ${LIBS[@]}
do
sudo ln -sf $LIB_SYSTEM_PATH/$LIB $LIB_VIRTUALENV_PATH/$LIB
done
for LIB in ${LIBS[@]}
do
sudo ln -sf $LIB_SYSTEM_PATH/$LIB $LIB_VIRTUALENV_PATH/$LIB
done
}


install_qt5()
{
echo "Not supported yet"
echo "Not supported yet"
}


install_apt_pip()
{
# Test for different Qt bindings
if [ "$USE_QT_API" = "PyQt5" ]; then
#sudo apt-get install -qq python-sip python-qt5 python-sphinx --fix-missing;
#sudo apt-get install -qq python3-sip python3-pyqt5 --fix-missing;
install_qt5
elif [ "$USE_QT_API" = "PyQt4" ]; then
install_qt4;
elif [ "$USE_QT_API" = "PySide" ]; then
install_pyside;
fi
# Test for different Qt bindings
if [ "$USE_QT_API" = "PyQt5" ]; then
#sudo apt-get install -qq python-sip python-qt5 python-sphinx --fix-missing;
#sudo apt-get install -qq python3-sip python3-pyqt5 --fix-missing;
install_qt5
elif [ "$USE_QT_API" = "PyQt4" ]; then
install_qt4;
elif [ "$USE_QT_API" = "PySide" ]; then
install_pyside;
fi

if [ "$PY_VERSION" = "2.7" ]; then
TEST_PACKAGES+=" rope"
fi
pip install -U $TEST_PACKAGES
if [ "$PY_VERSION" = "2.7" ]; then
TEST_PACKAGES+=" rope"
fi
pip install -U $TEST_PACKAGES
}


#==============================================================================
# Main
#==============================================================================
download_pr;

if [ "$USE_CONDA" = true ] ; then
export TEST_PACKAGES="ipython-qtconsole matplotlib pandas pep8 psutil pyflakes pygments pylint sphinx sympy"
export SOURCE=`source activate test-environment`
install_conda;
export TEST_PACKAGES="matplotlib pandas sympy"
export SOURCE=`source activate test-environment`
install_conda;
else
export TEST_PACKAGES="IPython jedi matplotlib pandas pep8 psutil pyflakes pygments pylint sphinx sympy"
install_apt_pip;
export TEST_PACKAGES="IPython jedi matplotlib pandas pep8 psutil pyflakes pygments pylint sphinx sympy"
install_apt_pip;
fi

#sleep 60;
51 changes: 0 additions & 51 deletions continuous_integration/travis_script.sh

This file was deleted.

0 comments on commit a712a1c

Please sign in to comment.