miracle2k/flask-assets — pull request #59 by dirn (2014-01-06 05:08:47+00:00)
Title: Add support for Python 3

**tl;dr** Support is being added for Python 3.3, dropped for Python 2.5.

In order to support Python 3, print needs to be used as a function,
imports need to be absolute, and the iter* methods of dicts cannot be
used.

The first is handled with an import from `__future__`. The second is
handled with an import from `__future__` and changes to local imports in
the test suite.

The final change comes in the form of replacing two list comprehensions
with regular for loops that iterate over the dicts' keys rather than
using iteritems (or items in Python 3). The list comprehensions are
being removed because they are not used anywhere; there is no need to
allocate the memory for the lists. The iteration is changing because the
dicts are not being mutated inside the loops. Iterating over the keys
allows for simpler code that supports both Python 2 and Python 3.

tox and Travis CI tests are being updated to include Python 3.3. The
versions used to test it inside tox are consistent with Python 2.6 and
2.7 except for libraries that didn't add support for Python 3 until a
later version. The requirements change is also being reflected in the
development requirements. While PyScss 1.1.5 is being kept for Python
2.x, it is being changed to a minimum requirement as Python 3 support
wasn't added until 1.2.0. Changing this allows for future development
using Python 3.

Finally, these changes drop support for Python 2.5. Support for
print_function wasn't added to `__future__` until Python 2.6.