Add Python 3 support to Trove

Registered by Victor Stinner

It’s time to add Python 3 support to Trove by generalizing the usage of the six module, in addition to the Python 2 support.

The goal is to make Trove compatible with Python 3 at the end of the Liberty cycle.

For the rationale, the plan and work items, please see Nova Python 3 spec, since it's almost the same for Trove:
http://specs.openstack.org/openstack/nova-specs/specs/liberty/approved/adding-python34-support-to-nova.html

Summary of the plan:

* Write a few bunch of patches to fix the most obvious Python 3 syntax issues (dict.iteritems, 123L, reraise an exception, etc.) to be able to load unit tests
* Find a subset of unit tests which pass on Python 3.4 and add a py34 target in tox.ini to run them.
* Add a non-voting py34 check job running tox -e py34
* When the py34 check job becomes stable enough, make it voting. At this point, it's no more possible to add regressions on the Python 3 in the tests executed by tox -e py34
* Fix remaining tests one by one, each time add it to the py34 target of tox.ini

For more information on Python 3, see the wiki page: https://wiki.openstack.org/wiki/Python3

Blueprint information

Status:
Started
Approver:
Amrith Kumar
Priority:
Medium
Drafter:
Victor Stinner
Direction:
Approved
Assignee:
None
Definition:
Approved
Series goal:
Accepted for newton
Implementation:
Good progress
Milestone target:
milestone icon newton-rc1
Started by
Amrith Kumar

Related branches

Sprints

Whiteboard

Gerrit topic: https://review.openstack.org/#q,topic:bp/trove-python3,n,z

Addressed by: https://review.openstack.org/225912
    Port run_tests.py to Python 3

Addressed by: https://review.openstack.org/225915
    Switch from MySQL-python to PyMySQL

Addressed by: https://review.openstack.org/266271
    Replaces __builtin__ with six.moves.builtins

Addressed by: https://review.openstack.org/267412
    Replaces itertools.izip with six.moves.zip

Addressed by: https://review.openstack.org/267729
    Fix indexing of dict.keys() in python3

Addressed by: https://review.openstack.org/274411
    Python3: Add support for raise and ConfigParser

Addressed by: https://review.openstack.org/274415
    Python3: Add support for iter.next

Addressed by: https://review.openstack.org/274418
    Python3: Add support for iteritems and iterkeys

Addressed by: https://review.openstack.org/274419
    Python3: Add support for unicode, basestring, long

Addressed by: https://review.openstack.org/274425
    Python3: Add support for httplib, urlparse

Addressed by: https://review.openstack.org/279098
    Add a minimal py34 test environment

Addressed by: https://review.openstack.org/279119
    Port test_template unit test to Python 3

Addressed by: https://review.openstack.org/297888
    Port crypto_utils to Python 3

Addressed by: https://review.openstack.org/298952
    Port more common unit tests to Python 3

Addressed by: https://review.openstack.org/308328
    Python 3: fix relative imports

Addressed by: https://review.openstack.org/308332
    Python 3: avoid sets.Set and string.letters

Addressed by: https://review.openstack.org/308343
    Simplify guestagent.pkg: don't use metaclass

Addressed by: https://review.openstack.org/311845
    Port designate code to Python 3

Addressed by: https://review.openstack.org/311846
    Port more API unit tests to Python 3

Addressed by: https://review.openstack.org/311847
    Port instance unit tests to Python 3

Addressed by: https://review.openstack.org/311848
    Enable more unit tests on Python 3

Addressed by: https://review.openstack.org/321598
    Port more unit tests to Python 3

Addressed by: https://review.openstack.org/321624
    pkg: replace commands module with subprocess

Addressed by: https://review.openstack.org/321625
    Port backup test_storage to Python 3

Addressed by: https://review.openstack.org/321626
    Port more guestagent unit tests to Python 3

Addressed by: https://review.openstack.org/322195
    Run Python 3 unit tests in parallel

Gerrit topic: https://review.openstack.org/#q,topic:bug/1594741,n,z

Addressed by: https://review.openstack.org/332113
    Replace print statment with print function

Addressed by: https://review.openstack.org/333258
    Replace MySQL-Python with PyMySQL

Addressed by: https://review.openstack.org/333262
    Port test_pagination on Python 3

Addressed by: https://review.openstack.org/333267
    Port galera and redis cluster tests to Python 3

Gerrit topic: https://review.openstack.org/#q,topic:pymysql,n,z

Addressed by: https://review.openstack.org/184400
    Switch from MySQL-python to PyMySQL

Addressed by: https://review.openstack.org/336052
    Port guestagent test_dbaas to Python 3

Addressed by: https://review.openstack.org/338956
    py3: Enable test_backup_models and test_datastores

Addressed by: https://review.openstack.org/343048
    Fix concurrency issue with Python 3.4 test

Addressed by: https://review.openstack.org/343832
    Add lock around run_tests db create

Addressed by: https://review.openstack.org/345035
    Add missing py34 support for urllib

Addressed by: https://review.openstack.org/346905
    WIP: Try to enable run_tests.py on Python 3

Addressed by: https://review.openstack.org/363964
    Port pagination on Python 3

Addressed by: https://review.openstack.org/368947
    Port operating_system to Python 3

Addressed by: https://review.openstack.org/419248
    Port operating_system to Python 3

Addressed by: https://review.openstack.org/547724
    Fix guestagent.test_operating_system for Python3

Gerrit topic: https://review.openstack.org/#q,topic:fix-stable-job,n,z

Addressed by: https://review.openstack.org/567294
    Add .stestr.conf to fix tox-py27 stable job

(?)

Work Items

This blueprint contains Public information 
Everyone can see this information.

Subscribers

No subscribers.