From 38c2ce9775a6083622aeed7a048740567f312cbc Mon Sep 17 00:00:00 2001 From: Will Kahn-Greene Date: Tue, 6 Dec 2016 14:55:50 -1000 Subject: [PATCH] Remove support for Python 2.6 and 3.2 Fixes #206 Fixes #224 --- .travis.yml | 6 ------ CHANGES | 9 +++++++++ bleach/__init__.py | 8 +------- bleach/version.py | 2 +- setup.py | 11 ----------- tox.ini | 4 +--- 6 files changed, 12 insertions(+), 28 deletions(-) diff --git a/.travis.yml b/.travis.yml index 59912666..f88146d1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,9 +4,7 @@ cache: directories: - "~/.cache/pip" python: -- "2.6" - "2.7" -- "3.2" - "3.3" - "3.4" - "3.5" @@ -15,10 +13,6 @@ env: - HTML5LIB=0.999 # 3 - HTML5LIB=0.999999 # 6 - HTML5LIB=0.9999999 # 7 -matrix: - allow_failures: - - python: "2.6" - - python: "3.2" install: - pip install -r requirements.txt - pip install html5lib==$HTML5LIB diff --git a/CHANGES b/CHANGES index eb8f46af..c52b5485 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,15 @@ Bleach Changes ============== +Version 2.0 (in development) +---------------------------- + +**Backwards incompatible changes** + +- Removed support for Python 2.6. #206 +- Removed support for Python 3.2. #224 + + Version 1.5 (November 4th, 2016) -------------------------------- diff --git a/bleach/__init__.py b/bleach/__init__.py index 13b5e2e7..09dad637 100644 --- a/bleach/__init__.py +++ b/bleach/__init__.py @@ -2,12 +2,6 @@ from __future__ import unicode_literals import logging -try: # Python 2.7+ - from logging import NullHandler -except ImportError: - class NullHandler(logging.Handler): - def emit(self, record): - pass import re import html5lib @@ -22,7 +16,7 @@ def emit(self, record): __all__ = ['clean', 'linkify'] log = logging.getLogger(__name__) -log.addHandler(NullHandler()) +log.addHandler(logging.NullHandler()) ALLOWED_TAGS = [ 'a', diff --git a/bleach/version.py b/bleach/version.py index 98d40e59..bcd8affc 100644 --- a/bleach/version.py +++ b/bleach/version.py @@ -2,5 +2,5 @@ from __future__ import unicode_literals -VERSION = (1, 5, 0) +VERSION = (2, 0, 0) __version__ = '.'.join([str(n) for n in VERSION]) diff --git a/setup.py b/setup.py index 26f7eefa..908928e1 100644 --- a/setup.py +++ b/setup.py @@ -20,15 +20,6 @@ 'html5lib>=0.999,!=0.9999,!=0.99999,<0.99999999', ] -try: - from collections import OrderedDict # noqa -except ImportError: - # We don't use ordereddict, but html5lib does when you request - # alpha-sorted attributes and on Python 2.6 and it doesn't specify it - # as a dependency (see - # https://github.com/html5lib/html5lib-python/pull/177) - install_requires.append('ordereddict') - def get_long_desc(): desc = open('README.rst').read() @@ -72,10 +63,8 @@ def get_version(): '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.2', 'Programming Language :: Python :: 3.3', 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', diff --git a/tox.ini b/tox.ini index 73c8511c..02dde2d3 100644 --- a/tox.ini +++ b/tox.ini @@ -4,13 +4,11 @@ # and then run "tox" from this directory. [tox] -envlist = py{26,27,32,33,34,35}-html5lib{999,999999,9999999},pypy-html5lib9999999 +envlist = py{27,33,34,35}-html5lib{999,999999,9999999},pypy-html5lib9999999 [testenv] basepython = - py26: python2.6 py27: python2.7 - py32: python3.2 py33: python3.3 py34: python3.4 py35: python3.5