From 393dcf3aecf2cd33d2f535724a00a3699bd032d5 Mon Sep 17 00:00:00 2001 From: Peter Schmidt Date: Wed, 20 Jan 2016 12:39:02 +1100 Subject: [PATCH 1/2] Add Python 3.5 support and fix new flake8 errors --- .travis.yml | 5 +++++ README.rst | 1 + premailer/premailer.py | 4 ++-- tox.ini | 2 +- 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 4ab03d7..01e9dda 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,6 +20,10 @@ before_install: install: - travis_retry python setup.py install +# See https://github.com/travis-ci/travis-ci/issues/4794 +# and https://github.com/audreyr/cookiecutter/pull/540/files +python: 3.5 + env: - TOX_ENV=flake8 - TOX_ENV=py26 @@ -27,6 +31,7 @@ env: - TOX_ENV=py32 - TOX_ENV=py33 - TOX_ENV=py34 + - TOX_ENV=py35 - TOX_ENV=pypy script: diff --git a/README.rst b/README.rst index 4748b91..6d079e8 100644 --- a/README.rst +++ b/README.rst @@ -25,6 +25,7 @@ makes sure premailer works in: - Python 3.2 - Python 3.3 - Python 3.4 +- Python 3.5 - PyPy Turns CSS blocks into style attributes diff --git a/premailer/premailer.py b/premailer/premailer.py index 7a97ab6..293b8d3 100644 --- a/premailer/premailer.py +++ b/premailer/premailer.py @@ -27,7 +27,7 @@ else: # Python 2 StringIO = StringIO # shut up pyflakes from urllib2 import urlopen from urlparse import urljoin, urlparse - STR_TYPE = basestring + STR_TYPE = basestring # NOQA import cssutils from lxml import etree @@ -634,4 +634,4 @@ if __name__ == '__main__': # pragma: no cover """ p = Premailer(html) - print (p.transform()) + print(p.transform()) diff --git a/tox.ini b/tox.ini index b99705f..4cf9ca7 100644 --- a/tox.ini +++ b/tox.ini @@ -4,7 +4,7 @@ # and then run "tox" from this directory. [tox] -envlist = flake8, py26, py27, py32, py33, py34, pypy +envlist = flake8, py26, py27, py32, py33, py34, py35, pypy [testenv] passenv = * From a8622aca136e7b2da9d0dbcc1db94ad932f3a44b Mon Sep 17 00:00:00 2001 From: Peter Schmidt Date: Thu, 21 Jan 2016 10:39:56 +1100 Subject: [PATCH 2/2] Drop Python 3.2 support See also pip>=8.0.0 has the backwards incompatible change of having dropped Python 3.2 support: https://pip.pypa.io/en/stable/news/#release-notes --- .travis.yml | 1 - README.rst | 1 - tox.ini | 17 +---------------- 3 files changed, 1 insertion(+), 18 deletions(-) diff --git a/.travis.yml b/.travis.yml index 01e9dda..c1393b4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -28,7 +28,6 @@ env: - TOX_ENV=flake8 - TOX_ENV=py26 - TOX_ENV=py27 - - TOX_ENV=py32 - TOX_ENV=py33 - TOX_ENV=py34 - TOX_ENV=py35 diff --git a/README.rst b/README.rst index 6d079e8..cfaeedb 100644 --- a/README.rst +++ b/README.rst @@ -22,7 +22,6 @@ makes sure premailer works in: - Python 2.6 - Python 2.7 -- Python 3.2 - Python 3.3 - Python 3.4 - Python 3.5 diff --git a/tox.ini b/tox.ini index 4cf9ca7..f29130d 100644 --- a/tox.ini +++ b/tox.ini @@ -4,7 +4,7 @@ # and then run "tox" from this directory. [tox] -envlist = flake8, py26, py27, py32, py33, py34, py35, pypy +envlist = flake8, py26, py27, py33, py34, py35, pypy [testenv] passenv = * @@ -25,21 +25,6 @@ deps = deps = flake8 commands = flake8 premailer -[testenv:py32] -# Python 3.2 does not support coverage 4.x -commands = nosetests --with-coverage --cover-package=premailer -install_command = - pip install {opts} {packages} - -deps = - setuptools - nose - mock - cssselect - cssutils - lxml - coverage==3.7.1 - [testenv:py26] # Python 2.6 is missing both the ordereddict and argparse modules # from the standard library.