Hello community, here is the log from the commit of package IPython for openSUSE:Factory checked in at 2013-03-17 10:06:49 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/IPython (Old) and /work/SRC/openSUSE:Factory/.IPython.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "IPython", Maintainer is "[email protected]" Changes: -------- --- /work/SRC/openSUSE:Factory/IPython/IPython.changes 2013-03-08 13:13:28.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.IPython.new/IPython.changes 2013-03-17 10:06:50.000000000 +0100 @@ -1,0 +2,6 @@ +Fri Mar 15 13:48:38 UTC 2013 - [email protected] + +- Add ipython-fix-loading-newer-pyqt.diff to make Qt console + load with PyQt 4.10 (fix already upstream) + +------------------------------------------------------------------- --- /work/SRC/openSUSE:Factory/IPython/python3-IPython.changes 2012-12-03 09:40:21.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.IPython.new/python3-IPython.changes 2013-03-17 10:06:50.000000000 +0100 @@ -1,0 +2,6 @@ +Fri Mar 15 13:49:18 UTC 2013 - [email protected] + +- Add ipython-fix-loading-newer-pyqt.diff to make Qt console + load with PyQt 4.10 (fix already upstream) + +------------------------------------------------------------------- New: ---- ipython-fix-loading-newer-pyqt.diff ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ IPython.spec ++++++ --- /var/tmp/diff_new_pack.iyZC5O/_old 2013-03-17 10:06:53.000000000 +0100 +++ /var/tmp/diff_new_pack.iyZC5O/_new 2013-03-17 10:06:53.000000000 +0100 @@ -1,7 +1,7 @@ # # spec file for package IPython # -# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -48,6 +48,11 @@ #ipython notebook Requires: python-tornado +%if 0%{?suse_version} > 1230 +# PATCH-FIX-UPSTREAM ipython-fix-loading-newer-pyqt.diff +Patch0: ipython-fix-loading-newer-pyqt.diff +%endif + %description IPython provides a replacement for the interactive python (Python) interpreter with extra functionality. @@ -98,6 +103,10 @@ %prep %setup -q -n ipython-%{version} +%if 0%{?suse_version} > 1230 +%patch0 -p1 +%endif + # Get rid of library shebangs # for file in *.py; do # sed -i '/\/usr\/bin\/env/d' $file ++++++ python3-IPython.spec ++++++ --- /var/tmp/diff_new_pack.iyZC5O/_old 2013-03-17 10:06:53.000000000 +0100 +++ /var/tmp/diff_new_pack.iyZC5O/_new 2013-03-17 10:06:53.000000000 +0100 @@ -1,7 +1,7 @@ # # spec file for package python3-IPython # -# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -51,6 +51,11 @@ #ipython notebook Requires: python3-tornado +%if 0%{?suse_version} > 1230 +# PATCH-FIX-UPSTREAM ipython-fix-loading-newer-pyqt.diff +Patch0: ipython-fix-loading-newer-pyqt.diff +%endif + %description IPython provides a replacement for the interactive python (Python) interpreter with extra functionality. @@ -88,6 +93,9 @@ %prep %setup -q -n ipython-%{version} +%if 0%{?suse_version} > 1230 +%patch0 -p1 +%endif # Get rid of library shebangs # for file in *.py; do ++++++ ipython-fix-loading-newer-pyqt.diff ++++++ From: Luca Beltrame <[email protected]> Date: Fri, 15 Mar 2013 14:43:18 +0100 Subject: Allow Qt console loading with PyQt > 4.9 Upstream: yes diff --git a/IPython/external/qt.py b/IPython/external/qt.py index 0c05e33..bbeea0c 100644 --- a/IPython/external/qt.py +++ b/IPython/external/qt.py @@ -7,7 +7,7 @@ Do not use this if you need PyQt with the old QString/QVariant API. """ import os - +from IPython.utils.version import check_version # Available APIs. QT_API_PYQT = 'pyqt' QT_API_PYSIDE = 'pyside' @@ -23,11 +23,20 @@ def prepare_pyqt4(): # Select Qt binding, using the QT_API environment variable if available. QT_API = os.environ.get('QT_API') if QT_API is None: + pyside_found = False try: import PySide - if PySide.__version__ < '1.0.3': + if not check_version(PySide.__version__, '1.0.3'): # old PySide, fallback on PyQt raise ImportError + # we can't import an incomplete pyside and pyqt4 + # this will cause a crash in sip (#1431) + # check for complete presence before importing + import imp + imp.find_module("QtCore", PySide.__path__) + imp.find_module("QtGui", PySide.__path__) + imp.find_module("QtSvg", PySide.__path__) + pyside_found = True from PySide import QtCore, QtGui, QtSvg QT_API = QT_API_PYSIDE except ImportError: @@ -35,7 +44,12 @@ if QT_API is None: prepare_pyqt4() import PyQt4 from PyQt4 import QtCore, QtGui, QtSvg - if QtCore.PYQT_VERSION_STR < '4.7': + if pyside_found: + print "WARNING: PySide installation incomplete and PyQt4 " \ + "present.\nThis will likely crash, please install " \ + "PySide completely, remove PySide or PyQt4 or set " \ + "the QT_API environment variable to pyqt or pyside" + if not check_version(QtCore.PYQT_VERSION_STR, '4.7'): # PyQt 4.6 has issues with null strings returning as None raise ImportError QT_API = QT_API_PYQT @@ -49,7 +63,7 @@ elif QT_API == QT_API_PYQT: # Now peform the imports. if QT_API == QT_API_PYQT: from PyQt4 import QtCore, QtGui, QtSvg - if QtCore.PYQT_VERSION_STR < '4.7': + if not check_version(QtCore.PYQT_VERSION_STR, '4.7'): raise ImportError("IPython requires PyQt4 >= 4.7, found %s"%QtCore.PYQT_VERSION_STR) # Alias PyQt-specific functions for PySide compatibility. @@ -58,7 +72,7 @@ if QT_API == QT_API_PYQT: elif QT_API == QT_API_PYSIDE: import PySide - if PySide.__version__ < '1.0.3': + if not check_version(PySide.__version__, '1.0.3'): raise ImportError("IPython requires PySide >= 1.0.3, found %s"%PySide.__version__) from PySide import QtCore, QtGui, QtSvg diff --git a/IPython/external/qt_for_kernel.py b/IPython/external/qt_for_kernel.py index 2bac0b9..2779de7 100644 --- a/IPython/external/qt_for_kernel.py +++ b/IPython/external/qt_for_kernel.py @@ -32,9 +32,10 @@ import os import sys from IPython.utils.warn import warn +from IPython.utils.version import check_version matplotlib = sys.modules.get('matplotlib') -if matplotlib and matplotlib.__version__ <= '1.0.1': +if matplotlib and not check_version(matplotlib.__version__, '1.0.2'): # 1.0.1 doesn't support pyside or v2, so stick with PyQt @v1, # and ignore everything else from PyQt4 import QtCore, QtGui diff --git a/IPython/external/ssh/tunnel.py b/IPython/external/ssh/tunnel.py index 9ae2311..d43cec7 100644 diff --git a/IPython/utils/version.py b/IPython/utils/version.py new file mode 100644 index 0000000..4572f2e --- /dev/null +++ b/IPython/utils/version.py @@ -0,0 +1,35 @@ +# encoding: utf-8 +""" +Utilities for version comparison + +It is a bit ridiculous that we need these. +""" + +#----------------------------------------------------------------------------- +# Copyright (C) 2013 The IPython Development Team +# +# Distributed under the terms of the BSD License. The full license is in +# the file COPYING, distributed as part of this software. +#----------------------------------------------------------------------------- + +#----------------------------------------------------------------------------- +# Imports +#----------------------------------------------------------------------------- + +from distutils.version import LooseVersion + +#----------------------------------------------------------------------------- +# Code +#----------------------------------------------------------------------------- + +def check_version(v, check): + """check version string v >= check + + If dev/prerelease tags result in TypeError for string-number comparison, + it is assumed that the dependency is satisfied. + Users on dev branches are responsible for keeping their own packages up to date. + """ + try: + return LooseVersion(v) >= LooseVersion(check) + except TypeError: + return True -- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
