Skip to content

Commit

Permalink
Merge pull request #804 from astrofrog/remove-python-2.6
Browse files Browse the repository at this point in the history
Remove support for Python 2.6
  • Loading branch information
astrofrog committed Nov 21, 2015
2 parents e2c6e35 + 895d688 commit 9b6e2d9
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 35 deletions.
8 changes: 0 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,6 @@ matrix:

include:

# Python 2.6
- os: linux
env:
- PYTHON_VERSION=2.6 IPYTHON_VERSION=1 MPL_VERSION=1.4 ASTROPY_VERSION=0.4
# We don't test ginga with Python 2.6 since it is not supported
- PIP_DEPENDENCIES="pytest-cov coveralls pyavm astrodendro awscli"

# Astropy dev
- os: linux
env:
Expand Down Expand Up @@ -101,7 +94,6 @@ before_install:
- export CONDA_DEPENDENCIES="matplotlib=$MPL_VERSION $QT_PKG "$CONDA_DEPENDENCIES

# Special cases depending on IPython version
- if [[ $PYTHON_VERSION == 2.6 && $IPYTHON_VERSION == 2 ]]; then export IPYTHON_VERSION=1; fi
- if [[ $IPYTHON_VERSION != None ]]; then export CONDA_DEPENDENCIES="IPython=$IPYTHON_VERSION "$CONDA_DEPENDENCIES; fi
- if [[ $IPYTHON_VERSION == 4 ]]; then export CONDA_DEPENDENCIES="qtconsole ipykernel "$CONDA_DEPENDENCIES; fi

Expand Down
2 changes: 1 addition & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Full changelog
v0.7 (unreleased)
-----------------

* No changes yet
* Python 2.6 is no longer supported. [#804]

v0.6 (2015-11-20)
-----------------
Expand Down
2 changes: 1 addition & 1 deletion doc/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ Dependencies

Glue has the following required dependencies:

* Python 2.6, 2.7, or 3.3 and higher
* Python 2.7, or 3.3 and higher
* `Numpy <http://www.numpy.org>`_
* `Matplotlib <http://www.matplotlib.org>`_
* `Pandas <http://pandas.pydata.org/>`_
Expand Down
8 changes: 1 addition & 7 deletions glue/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,7 @@
setapi('QVariant', 2)

import logging
try:
from logging import NullHandler
except ImportError: # python 2.6 workaround
class NullHandler(logging.Handler):

def emit(self, record):
pass
from logging import NullHandler

logging.getLogger('glue').addHandler(NullHandler())

Expand Down
15 changes: 3 additions & 12 deletions glue/core/tests/test_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,7 @@ def test_add_component_incompatible_shape(self):
comp.data.shape = (3, 2)
with pytest.raises(TypeError) as exc:
self.data.add_component(comp("junk label"))
if isinstance(exc.value, six.string_types): # python 2.6
assert exc.value == ("add_component() takes at least 3 "
"arguments (2 given)")
elif six.PY3:
if six.PY3:
assert exc.value.args[0] == ("add_component() missing 1 required "
"positional argument: 'label'")
else:
Expand Down Expand Up @@ -316,10 +313,7 @@ def test_immutable(self):
d = Data(x=[1, 2, 3])
with pytest.raises(ValueError) as exc:
d['x'][:] = 5
try:
assert 'read-only' in exc.value.args[0]
except AttributeError: # COMPAT: Python 2.6
assert 'read-only' in exc.value
assert 'read-only' in exc.value.args[0]
assert not d['x'].flags['WRITEABLE']

def test_categorical_immutable(self):
Expand All @@ -329,10 +323,7 @@ def test_categorical_immutable(self):

with pytest.raises(ValueError) as exc:
d['gender'][:] = 5
try:
assert 'read-only' in exc.value.args[0]
except AttributeError: # COMPAT: Python 2.6
assert 'read-only' in exc.value
assert 'read-only' in exc.value.args[0]
assert not d['gender'].flags['WRITEABLE']

def test_update_clears_subset_cache(self):
Expand Down
7 changes: 2 additions & 5 deletions glue/plugins/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,8 @@ def load_plugin(plugin):
"""
Load plugin referred to by name 'plugin'
"""
# When Python 2.6 is no longer supported, we can use:
# import importlib
# module = importlib.import_module(plugin)
__import__(plugin)
module = sys.modules[plugin]
import importlib
module = importlib.import_module(plugin)
if hasattr(module, 'setup'):
module.setup()
else:
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,11 @@ def run(self):
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Topic :: Scientific/Engineering :: Visualization',
'License :: OSI Approved :: BSD License'
],
Expand Down

0 comments on commit 9b6e2d9

Please sign in to comment.