From 0df6ab3a1217dffb2ac0dec23b64f051f6a9659b Mon Sep 17 00:00:00 2001 From: Thomas Robitaille Date: Mon, 15 Aug 2016 16:57:25 +0100 Subject: [PATCH] Update minimum required Astropy version to 1.0 and IPython to 1.0 --- .travis.yml | 8 ++--- doc/installation.rst | 9 +++--- glue/app/qt/terminal.py | 30 +++++++------------ glue/app/qt/tests/test_application.py | 6 ++-- glue/app/qt/tests/test_terminal.py | 6 ++-- .../tests/test_data_factories.py | 4 +-- glue/core/data_factories/tests/test_fits.py | 5 ++-- glue/core/tests/test_fitters.py | 10 +++---- .../tests/test_link_helpers.py | 4 +-- glue/tests/helpers.py | 13 +------- 10 files changed, 35 insertions(+), 60 deletions(-) diff --git a/.travis.yml b/.travis.yml index 40c527971..d8b281aa2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -87,15 +87,11 @@ matrix: - os: linux env: - - PYTHON_VERSION=2.7 MATPLOTLIB_VERSION=1.3 ASTROPY_VERSION=0.3 NUMPY_VERSION=1.8 + - PYTHON_VERSION=2.7 MATPLOTLIB_VERSION=1.3 NUMPY_VERSION=1.8 - os: linux env: - - PYTHON_VERSION=2.7 MATPLOTLIB_VERSION=1.4 ASTROPY_VERSION=0.4 NUMPY_VERSION=1.9 IPYTHON_VERSION=1.1 - - - os: linux - env: - - PYTHON_VERSION=2.7 MATPLOTLIB_VERSION=1.4 ASTROPY_VERSION=0.4 NUMPY_VERSION=1.9 IPYTHON_VERSION=0.13 + - PYTHON_VERSION=2.7 MATPLOTLIB_VERSION=1.4 NUMPY_VERSION=1.9 IPYTHON_VERSION=1.1 # Test with PySide, but due to segmentation faults, mark as an # allowed failure. diff --git a/doc/installation.rst b/doc/installation.rst index 48778419e..2c0766342 100644 --- a/doc/installation.rst +++ b/doc/installation.rst @@ -39,7 +39,7 @@ field and click on **Add Channel**, then **Submit**: .. image:: images/manage_conda_channels.jpg :align: center :width: 50% - + Once you have done this, you can install glue by clicking on the **Install** button corresponding to the **glueviz** entry. If you have already installed glue, and want to update, you can click on the **Update** button. Command-line installation @@ -52,7 +52,7 @@ To install or update glue on the command-line, simply do:: .. note:: There is currently a known issue when running Anaconda's Qt on certain Linux distributions (including Kubuntu). See `Issue with PyQt4 from conda`_ for more details. - + Enthought Canopy ---------------- @@ -113,8 +113,9 @@ Glue has the following required dependencies: And the following optional dependencies are also highly recommended: +* `IPython `_ 1.0 or later * `SciPy `_ -* `Astropy `_ 0.4 or later +* `Astropy `_ 1.0 or later * `h5py `_ (if using HDF5 files) In addition to these, there are several other optional dependencies to suport @@ -195,4 +196,4 @@ insead of PyQt4:: conda install pyside export QT_API=pyside -after which glue will use PySide when started. \ No newline at end of file +after which glue will use PySide when started. diff --git a/glue/app/qt/terminal.py b/glue/app/qt/terminal.py index b1b8d1f03..98d4f5c34 100644 --- a/glue/app/qt/terminal.py +++ b/glue/app/qt/terminal.py @@ -59,28 +59,18 @@ from IPython.utils.traitlets import TraitError from IPython.lib.kernel import find_connection_file - if IPYTHON_VERSION >= LooseVersion('1'): - - from IPython import get_ipython - - from IPython.kernel.zmq.ipkernel import Kernel - from IPython.kernel.zmq.kernelapp import IPKernelApp - from IPython.kernel.zmq.iostream import OutStream - from IPython.kernel.inprocess.ipkernel import InProcessInteractiveShell - from IPython.kernel.connect import get_connection_file - - from IPython.qt.client import QtKernelClient - from IPython.qt.manager import QtKernelManager - from IPython.qt.inprocess import QtInProcessKernelManager - from IPython.qt.console.rich_ipython_widget import RichIPythonWidget + from IPython import get_ipython - else: + from IPython.kernel.zmq.ipkernel import Kernel + from IPython.kernel.zmq.kernelapp import IPKernelApp + from IPython.kernel.zmq.iostream import OutStream + from IPython.kernel.inprocess.ipkernel import InProcessInteractiveShell + from IPython.kernel.connect import get_connection_file - from IPython.zmq.ipkernel import Kernel - from IPython.zmq.ipkernel import IPKernelApp - from IPython.zmq.iostream import OutStream - from IPython.frontend.qt.kernelmanager import QtKernelManager - from IPython.frontend.qt.console.rich_ipython_widget import RichIPythonWidget + from IPython.qt.client import QtKernelClient + from IPython.qt.manager import QtKernelManager + from IPython.qt.inprocess import QtInProcessKernelManager + from IPython.qt.console.rich_ipython_widget import RichIPythonWidget from glue.app.qt.mdi_area import GlueMdiSubWindow from glue.utils import as_variable_name diff --git a/glue/app/qt/tests/test_application.py b/glue/app/qt/tests/test_application.py index 83406c397..912c61b41 100644 --- a/glue/app/qt/tests/test_application.py +++ b/glue/app/qt/tests/test_application.py @@ -18,7 +18,7 @@ from glue.core.component_link import ComponentLink from glue.core.data_collection import DataCollection from glue.core.tests.test_state import Cloner, containers_equal, doubler, clone -from glue.tests.helpers import requires_ipython_ge_012 +from glue.tests.helpers import requires_ipython from glue.utils.qt import process_dialog from glue.viewers.image.qt import ImageWidget from glue.viewers.scatter.qt import ScatterWidget @@ -78,7 +78,7 @@ def test_choose_save_session_ioerror(self): self.app._choose_save_session() assert mb.call_count == 1 - @requires_ipython_ge_012 + @requires_ipython def test_terminal_present(self): """For good setups, terminal is available""" if not self.app.has_terminal(): @@ -113,7 +113,7 @@ def is_terminal_importable(self): except: return False - @requires_ipython_ge_012 + @requires_ipython def test_toggle_terminal(self): term = MagicMock() self.app._terminal = term diff --git a/glue/app/qt/tests/test_terminal.py b/glue/app/qt/tests/test_terminal.py index c2e5003c0..21f719a8e 100644 --- a/glue/app/qt/tests/test_terminal.py +++ b/glue/app/qt/tests/test_terminal.py @@ -2,14 +2,14 @@ from mock import MagicMock, patch -from glue.tests.helpers import requires_ipython_ge_012, IPYTHON_GE_012_INSTALLED +from glue.tests.helpers import requires_ipython, IPYTHON_INSTALLED -if IPYTHON_GE_012_INSTALLED: +if IPYTHON_INSTALLED: from ..terminal import glue_terminal -@requires_ipython_ge_012 +@requires_ipython class TestTerminal(object): def test_mpl_non_interactive(self): """IPython v0.12 sometimes turns on mpl interactive. Ensure diff --git a/glue/core/data_factories/tests/test_data_factories.py b/glue/core/data_factories/tests/test_data_factories.py index ac0164512..7b24cb7ac 100644 --- a/glue/core/data_factories/tests/test_data_factories.py +++ b/glue/core/data_factories/tests/test_data_factories.py @@ -11,7 +11,7 @@ from glue.core.data import Data from glue.core import data_factories as df from glue.config import data_factory -from glue.tests.helpers import (requires_astropy, requires_astropy_ge_03, +from glue.tests.helpers import (requires_astropy, requires_pil_or_skimage, make_file, requires_qt) @@ -104,7 +104,7 @@ def test_csv_gz_factory(): assert_array_equal(d['x'], [1, 2, 3]) -@requires_astropy_ge_03 +@requires_astropy def test_sextractor_factory(): data = b"""# 1 NUMBER Running object number # 2 X_IMAGE Object position along x [pixel] diff --git a/glue/core/data_factories/tests/test_fits.py b/glue/core/data_factories/tests/test_fits.py index d79397e9d..a41e24a59 100644 --- a/glue/core/data_factories/tests/test_fits.py +++ b/glue/core/data_factories/tests/test_fits.py @@ -10,8 +10,7 @@ from glue.core import data_factories as df -from glue.tests.helpers import (requires_astropy, requires_astropy_ge_04, - make_file) +from glue.tests.helpers import requires_astropy, make_file from ..fits import fits_reader @@ -172,7 +171,7 @@ def test_fits_uses_mmapping(): assert not d['PRIMARY'].flags['OWNDATA'] -@requires_astropy_ge_04 +@requires_astropy def test_fits_catalog_factory(): data = b'\x1f\x8b\x08\x08\x19\r\x9cQ\x02\x03test.fits\x00\xed\xd7AO\x830\x18\xc6\xf1\xe9\'yo\x1c\'\x1c\x8c\x97\x1d\x86c\xa6\x911"5\xc1c\x91n\x92\x8cBJ\x97\xb8o\xef\x06\xd3\x98H\xdd\x16\x97]|~\x17\x12H\xfeyI{h\x136\x8b\xc3\x80hD=8\r\xe9\xb5R\x8bJ\x97\r\x99\x8a\xa6\x8c\'\xd4\x18\xa1r\xa1s\xea\xe53\x1e\xb3\xd4\xd2\xbb\xdb\xf6\x84\xd6bC\xb90\x82\xcc\xa6\x96t@4NYB\x96\xde\xcd\xb6\xa7\xd6e&5U\x8b\xcfrQJ\xd5\x14\x95jz{A\xca\x83hb\xfd\xdf\x93\xb51\x00\x00\x00\x00\xf87v\xc7\xc9\x84\xcd\xa3\x119>\x8b\xf8\xd8\x0f\x03\xe7\xdb\xe7!e\x85\x12zCFd+I\xf2\xddt\x87Sk\xef\xa2\xe7g\xef\xf4\xf3s\xdbs\xfb{\xee\xed\xb6\xb7\x92ji\xdev\xbd\xaf\x12\xb9\x07\xe6\xf3,\xf3\xb9\x96\x9eg\xef\xc5\xf7\xf3\xe7\x88\x1fu_X\xeaj]S-\xb4(\xa5\x91\xba\xff\x7f\x1f~\xeb\xb9?{\xcd\x81\xf5\xe0S\x16\x84\x93\xe4\x98\xf5\xe8\xb6\xcc\xa2\x90\xab\xdc^\xe5\xfc%\x0e\xda\xf5p\xc4\xfe\x95\xf3\x97\xfd\xcc\xa7\xf3\xa7Y\xd7{\x00\x04\x01*\xc7\xc0!\x00\x00' with make_file(data, '.fits') as fname: diff --git a/glue/core/tests/test_fitters.py b/glue/core/tests/test_fitters.py index 060018b60..8ec29f7eb 100644 --- a/glue/core/tests/test_fitters.py +++ b/glue/core/tests/test_fitters.py @@ -6,14 +6,14 @@ import numpy as np from mock import MagicMock -from glue.tests.helpers import requires_scipy, requires_astropy_ge_03, ASTROPY_GE_03_INSTALLED +from glue.tests.helpers import requires_scipy, requires_astropy, ASTROPY_INSTALLED from ..fitters import (PolynomialFitter, IntOption, BasicGaussianFitter) needs_modeling = pytest.mark.skipif("False", reason='') -if ASTROPY_GE_03_INSTALLED: +if ASTROPY_INSTALLED: from astropy.modeling.models import Gaussian1D try: from astropy.modeling.fitting import NonLinearLSQFitter @@ -22,7 +22,7 @@ from ..fitters import SimpleAstropyGaussianFitter -@requires_astropy_ge_03 +@requires_astropy @requires_scipy class TestAstropyFitter(object): @@ -139,7 +139,7 @@ def test_options_passed_to_fit(self): assert p.fit.call_args[1]['degree'] == 4 -@requires_astropy_ge_03 +@requires_astropy class TestFitWrapper(object): def setup_method(self, method): @@ -168,7 +168,7 @@ def test_basic(self): np.testing.assert_array_equal(y, self.y) -@requires_astropy_ge_03 +@requires_astropy class TestSetConstraints(object): def test(self): diff --git a/glue/plugins/coordinate_helpers/tests/test_link_helpers.py b/glue/plugins/coordinate_helpers/tests/test_link_helpers.py index 4dbb05e81..9daecd7ce 100644 --- a/glue/plugins/coordinate_helpers/tests/test_link_helpers.py +++ b/glue/plugins/coordinate_helpers/tests/test_link_helpers.py @@ -5,12 +5,12 @@ from glue.core import ComponentID from glue.core.tests.test_link_helpers import check_link, check_using -from glue.tests.helpers import ASTROPY_GE_04_INSTALLED +from glue.tests.helpers import ASTROPY_INSTALLED from ..link_helpers import (Galactic_to_FK5, FK4_to_FK5, ICRS_to_FK5, Galactic_to_FK4, ICRS_to_FK4, ICRS_to_Galactic) -if not ASTROPY_GE_04_INSTALLED: +if not ASTROPY_INSTALLED: pytest.skip() diff --git a/glue/tests/helpers.py b/glue/tests/helpers.py index f8af49095..9cab9782e 100644 --- a/glue/tests/helpers.py +++ b/glue/tests/helpers.py @@ -26,14 +26,6 @@ def make_skipper(module, label=None, version=None): ASTROPY_INSTALLED, requires_astropy = make_skipper('astropy', label='Astropy') -ASTROPY_GE_03_INSTALLED, requires_astropy_ge_03 = make_skipper('astropy', - label='Astropy >= 0.3', - version='0.3') - -ASTROPY_GE_04_INSTALLED, requires_astropy_ge_04 = make_skipper('astropy', - label='Astropy >= 0.4', - version='0.4') - MATPLOTLIB_GE_14_INSTALLED, requires_matplotlib_ge_14 = make_skipper('matplotlib', label='Matplotlib >= 1.4', version='1.4') @@ -52,10 +44,7 @@ def make_skipper(module, label=None, version=None): PLOTLY_INSTALLED, requires_plotly = make_skipper('plotly') -IPYTHON_GE_012_INSTALLED, requires_ipython_ge_012 = make_skipper('IPython', - label='IPython >= 0.12', - version='0.12') - +IPYTHON_INSTALLED, requires_ipython = make_skipper('IPython') requires_pil_or_skimage = pytest.mark.skipif(str(not SKIMAGE_INSTALLED and not PIL_INSTALLED), reason='Requires PIL or scikit-image')