Skip to content

Commit

Permalink
Merge pull request #196 from dlax/drop-py26
Browse files Browse the repository at this point in the history
Drop support for python 2.6
  • Loading branch information
jquast authored Mar 6, 2021
2 parents 33f3660 + 463c371 commit b6025ec
Show file tree
Hide file tree
Showing 8 changed files with 5 additions and 64 deletions.
4 changes: 0 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ matrix:
include:
- python: 3.8
env: TOXENV=about,pydocstyle,pylint,flake8,flake8_tests,mypy,sphinx COVERAGE_ID=travis-ci
- python: 2.6
env: TOXENV=py26,codecov TEST_QUICK=1 COVERAGE_ID=travis-ci
dist: trusty
- python: 2.7
env: TOXENV=py27,codecov COVERAGE_ID=travis-ci TEST_KEYBOARD=yes TEST_RAW=yes
- python: 3.4
Expand Down Expand Up @@ -41,7 +38,6 @@ matrix:
env: PATH=/c/Python38:/c/Python38/Scripts:$PATH TOXENV=py38,codecov COVERAGE_ID=travis-ci TEST_KEYBOARD=no

allow_failures:
- python: 2.6
- python: 3.9-dev
- python: 3.10-dev

Expand Down
6 changes: 1 addition & 5 deletions blessed/_capabilities.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
"""Terminal capability builder patterns."""
# std imports
import re
from collections import OrderedDict

try:
from collections import OrderedDict
except ImportError:
# python 2.6 requires 3rd party library (backport)
from ordereddict import OrderedDict # type: ignore # pylint: disable=import-error

__all__ = (
'CAPABILITY_DATABASE',
Expand Down
7 changes: 1 addition & 6 deletions blessed/keyboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,11 @@
import re
import time
import platform
from collections import OrderedDict

# 3rd party
import six

try:
from collections import OrderedDict
except ImportError:
# python 2.6 requires 3rd party library (backport)
from ordereddict import OrderedDict # pylint: disable=import-error

# curses
if platform.system() == 'Windows':
# pylint: disable=import-error
Expand Down
8 changes: 1 addition & 7 deletions blessed/terminal.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,6 @@
# pylint: disable=redefined-builtin
InterruptedError = select.error

try:
from collections import OrderedDict
except ImportError:
# python 2.6 requires 3rd party library (backport)
from ordereddict import OrderedDict # pylint: disable=import-error


HAS_TTY = True
if platform.system() == 'Windows':
Expand Down Expand Up @@ -278,7 +272,7 @@ def __clear_color_capabilities(self):
def __init__capabilities(self):
# important that we lay these in their ordered direction, so that our
# preferred, 'color' over 'set_a_attributes1', for example.
self.caps = OrderedDict()
self.caps = collections.OrderedDict()

# some static injected patterns, esp. without named attribute access.
for name, (attribute, pattern) in CAPABILITIES_ADDITIVES.items():
Expand Down
3 changes: 0 additions & 3 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,5 @@ ignore_missing_imports = True
[mypy-jinxed.*]
ignore_missing_imports = True

[mypy-ordereddict.*]
ignore_missing_imports = True

[mypy-wcwidth.*]
ignore_missing_imports = True
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ def _get_long_description(fname):
name='blessed',
version=_get_version(
fname=os.path.join(HERE, 'version.json')),
python_requires=">=2.7",
install_requires=_get_install_requires(
fname=os.path.join(HERE, 'requirements.txt')),
long_description=_get_long_description(
Expand Down Expand Up @@ -68,7 +69,6 @@ def _get_long_description(fname):
'Operating System :: POSIX',
'Operating System :: Microsoft :: Windows',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.2',
Expand Down
23 changes: 0 additions & 23 deletions tests/test_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,29 +253,6 @@ def child():
child()


def test_missing_ordereddict_uses_module(monkeypatch):
"""ordereddict module is imported when without collections.OrderedDict."""
import blessed.keyboard

if hasattr(collections, 'OrderedDict'):
monkeypatch.delattr('collections.OrderedDict')

try:
reload_module(blessed.keyboard)
except ImportError as err:
assert err.args[0] in ("No module named ordereddict", # py2
"No module named 'ordereddict'") # py3
sys.modules['ordereddict'] = mock.Mock()
sys.modules['ordereddict'].OrderedDict = -1
reload_module(blessed.keyboard)
assert blessed.keyboard.OrderedDict == -1
del sys.modules['ordereddict']
monkeypatch.undo()
reload_module(blessed.keyboard)
else:
assert platform.python_version_tuple() < ('2', '7') # reached by py2.6


def test_python3_2_raises_exception(monkeypatch):
"""Test python version 3.0 through 3.2 raises an exception."""
import blessed
Expand Down
16 changes: 1 addition & 15 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ envlist = about
pydocstyle
mypy
sphinx
py{26,27,34,35,36,37,38}
py{27,34,35,36,37,38}
skip_missing_interpreters = true

[testenv]
Expand Down Expand Up @@ -80,20 +80,6 @@ ignore = D101, # Missing docstring in public class
[doc8]
max-line-length = 100

[testenv:py26]
setenv = TEST_QUICK=1
basepython = python2.6
deps = pytest==3.2.5
pytest-cov==2.5.1
pytest-xdist==1.20.1
mock==2.0.0
commands = {envpython} -m pytest --cov-config={toxinidir}/tox.ini {posargs:\
--strict --verbose \
--junit-xml=.tox/results.{envname}.xml \
--durations=3 \
} \
tests

[testenv:py27]
basepython = python2.7
setenv = TEST_KEYBOARD = {env:TEST_KEYBOARD:yes}
Expand Down

0 comments on commit b6025ec

Please sign in to comment.