#3114 Python3 compatibility
Merged by pingou. Opened by abompard.
abompard/pagure python3  into  master

Download 3114.patch

OK that's a big one :-)

It builds on the py3_work2 branch, fixes a lot of stuff, and adds from __future__ import unicode_literals everywhere to make it easier to support both versions. There's also a commit to remove usage of str() as much as possible (and useful) because it has a different output in Python 2 and 3 when bytes are given.

Finally, I've added a tox.ini file so you can run tox and it will run the unit tests (and flake8) on the combination of the following environments:
- python 2.7, 3.4, 3.5, and 3.6
- flask 0.11 and 0.12

This will, of course, take a long time. But you can select a subset of the environments with tox -e py34-flask011. Refer to the tox docs for more info.

Of course I'll need to update this PR each time a new commit lands in master, so feel free to ask me to rebase, and let's not wait too long if possible ;-)

For future developments, I recommend reading http://python-future.org/compatible_idioms.html (event if it's geared towards future and not six, that we currently use).

While at it, let's adjust the run_ci_tests script to use tox as well :)

6 new commits added

  • Add Tox to run the unit tests with different versions of Python & Flask
  • Don't (ab)use the str() function
  • Use unicode_literals everywhere for Py3 compatibility
  • Port the unit-tests to python3
  • Port pagure to python3
  • Add utility scripts to run the test suite with python3

Adjusting the CI script seems more complex than we thought, how about doing that in a separate PR ?

rebased onto 1ca4b0b8485cf87d439c7f08ce3cd11dc889bb87

Adjusting the CI script seems more complex than we thought, how about doing that in a separate PR ?

Works for me :)

rebased onto c8999f11328d9bb9cc018420b5ea31d65ac2b500

rebased onto 0e75e0d290b4ca0009820fbfcf1ba97e55990c19

6 new commits added

  • Add Tox to run the unit tests with different versions of Python & Flask
  • Don't (ab)use the str() function
  • Use unicode_literals everywhere for Py3 compatibility
  • Port the unit-tests to python3
  • Port pagure to python3
  • Add utility scripts to run the test suite with python3

rebased onto a6b40f378d11c1937640d3f79aed9ccecee72dd0

rebased onto e154e6d8e5698c530eba1614c9813dffc993ce72

:thumbsup:

rebased onto 151e041b367d67eab45665475c9c3cbaab84e5e2

rebased onto f694de1cc3e45554352df6491eda3c3d58c56a79

6 new commits added

  • Add Tox to run the unit tests with different versions of Python & Flask
  • Don't (ab)use the str() function
  • Use unicode_literals everywhere for Py3 compatibility
  • Port the unit-tests to python3
  • Port pagure to python3
  • Add utility scripts to run the test suite with python3

6 new commits added

  • Add Tox to run the unit tests with different versions of Python & Flask
  • Don't (ab)use the str() function
  • Use unicode_literals everywhere for Py3 compatibility
  • Port the unit-tests to python3
  • Port pagure to python3
  • Add utility scripts to run the test suite with python3

Bring us into the future! :roller_coaster:

Actually it's more "back into the present" ;-) Thanks for the support! :-)

Pull-Request has been merged by pingou

Metadata