All tests* currently pass under Python 2.7 and Python 3.3 - 3.5. This
does not mean that Python 3 support is stable, however. As a plan
forward, we should encourage interested users to run Hyde with Python 3,
report bugs, and submit patches. This change references the Python 3
Support issue on GitHub (#270). Once this becomes a bit more tested and
stable, that issue should be closed, and Hyde should announce official,
stable support for Python 3 (i.e. new changes must also support 3,
issues with running hyde under 3 should be considered bugs rather than
feature requests, etc.).
Changes:
- Add ``hyde/_compat.py`` for 2-to-3 compatibility helpers.
- Replace uses of 2-specific code with their ``hyde._compat`` versions.
- Tests remain largely unchanged (for good reason). The exceptions here
are to ``print`` function calls, and ``str`` type usage, and
compatibility imports.
- Replace explicit calls to ``foo.next()`` with ``next(foo)``. This
keeps code portable between Python 2's ``next`` and Python 3's
``__next__`` methods without the need for any compatibility functions
and is the recommended API for interacting with these methods.
- Replace deprecated (and, in Python 3, removed) ``except Exception, e:``
statements with their updated ``except Exception as e:`` versions.
- Replace print statements with print function calls (because of how
parentheses work in Python, this is transparently
cross-version-compatible).
- Add Python 3.3, 3.4, and 3.5 to ``tox.ini``, ``.travis.yml``, and
classifiers in ``setup.py``.
- Add ``{posargs}`` to ``tox.ini`` command invocations to improve usage
during development.
- Add Python 3 note in changelog.
* asciidoc does not support Python 3, and fixing that far beyond the
scope of this task, so the test that deals with it is conditionally
skipped when run using versions of Python 3.