Skip to content

Commit

Permalink
Merge pull request #2762 from ccordoba12/test-pyqt5
Browse files Browse the repository at this point in the history
Start testing with PyQt5
  • Loading branch information
ccordoba12 committed Oct 16, 2015
2 parents 1b6b7ed + 2ef6fd4 commit b427b80
Show file tree
Hide file tree
Showing 13 changed files with 68 additions and 37 deletions.
12 changes: 6 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,18 @@ matrix:
- python: "2.7"
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.4"
env: USE_QT_API=PyQt4 USE_CONDA=true
os: linux
- python: "3.5"
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.4"
# env: USE_QT_API=PyQt5 USE_CONDA=true
# os: linux
- python: "3.5"
env: USE_QT_API=PyQt5 USE_CONDA=true
os: linux
#- python: "2.7"
# env: USE_QT_API=PySide USE_CONDA=true
# os: linux
Expand Down
14 changes: 9 additions & 5 deletions continuous_integration/build_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,17 @@ if [ "$USE_CONDA" = true ] ; then
# Print basic testing info
conda info

cd continuous_integration
cd continuous_integration/conda-recipes

# Use --python only for 3.5 to avoid building for old Pythons
# on the other versions
# Custom build of qtconsole for pyqt5
if [ "$USE_QT_API" = "PyQt5" ]; then
conda build --python $TRAVIS_PYTHON_VERSION qtconsole
fi

# There is no Miniconda for 3.5 right now
if [ "$TRAVIS_PYTHON_VERSION" = "3.5" ]; then
conda build --python $TRAVIS_PYTHON_VERSION conda.recipe
conda build --python $TRAVIS_PYTHON_VERSION spyder
else
conda build conda.recipe
conda build spyder
fi
fi
2 changes: 2 additions & 0 deletions continuous_integration/conda-recipes/qtconsole/bld.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
%PYTHON% setup.py install
if errorlevel 1 exit 1
3 changes: 3 additions & 0 deletions continuous_integration/conda-recipes/qtconsole/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash

$PYTHON setup.py install
32 changes: 32 additions & 0 deletions continuous_integration/conda-recipes/qtconsole/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
package:
name: qtconsole
version: 4.0.1

build:
number: 99

source:
fn: qtconsole-4.0.1.tar.gz
url: https://pypi.python.org/packages/source/q/qtconsole/qtconsole-4.0.1.tar.gz
md5: a8f17246361ee37ec55d3222dee9e18c

requirements:
build:
- python
run:
- python
- pyqt5
- traitlets
- jupyter_core
- jupyter_client
- pygments
- ipykernel

test:
imports:
- qtconsole

about:
home: http://jupyter.org
license: BSD
summary: Jupyter Qt Console
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ requirements:
- sphinx
run:
- python
- pyqt
- {% if environ.get('USE_QT_API') == 'PyQt4' %} pyqt {% else %} pyqt5 {% endif %}
- rope
- pyflakes
- jedi 0.8* [py27 or py34]
Expand Down
2 changes: 1 addition & 1 deletion continuous_integration/modules_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ for f in spyderlib/*.py; do
if [[ $f == spyderlib/start_app.py ]]; then
continue
fi
if [[ $f == spyderlib/pil_patch.py ]]; then
if [[ $f == spyderlib/pyplot.py ]]; then
continue
fi
python "$f"
Expand Down
7 changes: 6 additions & 1 deletion continuous_integration/run_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,12 @@ export TEST_TRAVIS_APP=True
# We install them here and not in travis_install.sh to see if
# Spyder is correctly pulling its deps (some of them are shared
# with mpl)
export EXTRA_PACKAGES="matplotlib pandas sympy pillow"
export EXTRA_PACKAGES="pandas sympy pillow"

# Don't install mpl for PyQt5 because it pulls PyQt4
if [ "$USE_QT_API" = "PyQt4" ]; then
EXTRA_PACKAGES+=" matplotlib"
fi

if [ "$USE_CONDA" = true ] ; then
# Move to a tmp dir
Expand Down
21 changes: 3 additions & 18 deletions continuous_integration/travis_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,30 +49,15 @@ install_conda()
echo 'conda ==3.18.1' > $HOME/miniconda/conda-meta/pinned;
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;

conda create -q -n test-environment python=$PY_VERSION;

# 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;
conda config --add channels spyder-ide;
fi
}

Expand Down
6 changes: 3 additions & 3 deletions spyderlib/utils/introspection/jedi_plugin.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
# Copyright © 2013 The Spyder Development Team
# Copyright © 2009- The Spyder Development Team
# Licensed under the terms of the MIT License
# (see spyderlib/__init__.py for details)

Expand Down Expand Up @@ -270,10 +270,10 @@ def preload(self):
len(source_code)))
assert ('numpy', 'module') in completions

source_code = "import matplotlib.pyplot as plt; plt.imsave"
source_code = "import pandas as pd; pd.DataFrame"
path, line_nr = p.get_definition(CodeInfo('definition', source_code,
len(source_code)))
assert 'pyplot.py' in path
assert 'frame.py' in path

source_code = 'from .plugin_manager import memoize'
path, line_nr = p.get_definition(CodeInfo('definition', source_code,
Expand Down
4 changes: 2 additions & 2 deletions spyderlib/utils/introspection/rope_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,10 +288,10 @@ def close_rope_project(self):
len(source_code), __file__))
assert ('numpy', 'module') in completions

source_code = "import matplotlib.pyplot as plt; plt.imsave"
source_code = "import pandas as pd; pd.DataFrame"
path, line_nr = p.get_definition(CodeInfo('definition', source_code,
len(source_code), __file__))
assert 'pyplot.py' in path
assert 'frame.py' in path

code = '''
def test(a, b):
Expand Down

0 comments on commit b427b80

Please sign in to comment.