Adding Python 3.4 support to Nova (partial)

Registered by Victor Stinner on 2015-04-23

All Nova dependencies are now Python 3 compatible: see the Dependencies section below. It's time to port Nova to Python 3 which means adding Python 3 support without loosing Python 2 support.

Blueprint information

Status:
Complete
Approver:
John Garbutt
Priority:
Medium
Drafter:
Victor Stinner
Direction:
Approved
Assignee:
Victor Stinner
Definition:
Approved
Series goal:
Accepted for liberty
Implementation:
Implemented
Milestone target:
milestone icon 12.0.0
Started by
John Garbutt on 2015-05-13
Completed by
John Garbutt on 2015-08-05

Related branches

Sprints

Whiteboard

See https://wiki.openstack.org/wiki/Python3#Python_3_Status_of_OpenStack_projects for the current status.

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

Addressed by: https://review.openstack.org/176868
    Adding Python 3.4 support to Nova

Addressed by: https://review.openstack.org/179783
    Rename iteritems() methods to items() on Python 3

Addressed by: https://review.openstack.org/179784
    Replace dict.iteritems() with six.iteritems(dict)

Addressed by: https://review.openstack.org/179821
    Replace iter.next() with next(iter)

Addressed by: https://review.openstack.org/179828
    Drop L from literal integer numbers for Python 3

Addressed by: https://review.openstack.org/179850
    Replace unicode with six.text_type

Addressed by: https://review.openstack.org/179946
    Fix raise syntax for Python 3

Addressed by: https://review.openstack.org/179952
    Replace dict.itervalues() with six.itervalues(dict)

Addressed by: https://review.openstack.org/179975
    Use six.moves.range for Python 3

Addressed by: https://review.openstack.org/180090
    Replace suds test dependency with suds-jurko

Addressed by: https://review.openstack.org/180128
    Replace MySQL-python test req. with mysqlclient

Addressed by: https://review.openstack.org/182709
    Replace MySQL-python with PyMySQL in tests

Addressed by: https://review.openstack.org/182887
    Replace dict(obj.iteritems()) with dict(obj)

Addressed by: https://review.openstack.org/184883
    Don't use dict.iterkeys()

Addressed by: https://review.openstack.org/184901
    Add hacking rule to detect Python 3 compat issues

Addressed by: https://review.openstack.org/185109
    Disable oslo.vmware test dependency on Python 3

Addressed by: https://review.openstack.org/185361
    Fix version unit test on Python 3

Addressed by: https://review.openstack.org/195191
    Fix Python 3 issues in nova.db.sqlalchemy

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

Addressed by: https://review.openstack.org/187785
    Enable python34 tests for nova/tests/unit/objects/test*.py

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

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

Addressed by: https://review.openstack.org/197748
    Port crypto to Python 3

Addressed by: https://review.openstack.org/197762
    Enable oslo.vmware dependency on Python 3

Addressed by: https://review.openstack.org/197982
    Fix Python 3 issues in nova.utils and nova.tests

Addressed by: https://review.openstack.org/198272
    Port test_exception to Python 3

As this is not a priority, lets mark this a NeedsCodeReview and partially completed, to align with the Non-Priority Feature Proposal Freeze. --johnthetubaguy 16th July 2015

Addressed by: https://review.openstack.org/187968
    Enable python34 tests for nova/tests/unit/scheduler/test*.py

Addressed by: https://review.openstack.org/204723
    Get py34 subunit.run test discovery to work

Given all the current patches have merged, and the agreement to timebox this effort, lets call this the end of things for liberty.
--johnthetubaguy 5th August 2015

Addressed by: https://review.openstack.org/229578
    Replace function.func_name with function.__name__

Addressed by: https://review.openstack.org/259351
    Replace unicode with six.text_type

Addressed by: https://review.openstack.org/322040
    py3: test_policy, test_pipelib, test_nova_manage

Addressed by: https://review.openstack.org/332686
    Port cinder unit tests to Python 3

Addressed by: https://review.openstack.org/332701
    Port test_ipv6 to py3 and simplify to_global()

Addressed by: https://review.openstack.org/332737
    Port test_hacking to Python 3

Addressed by: https://review.openstack.org/332738
    Port test_metadata to Python 3

Addressed by: https://review.openstack.org/332791
    Port pci unit tests to Python 3

Addressed by: https://review.openstack.org/338722
    Replace unicode with six.text_type

(?)

Work Items

This blueprint contains Public information 
Everyone can see this information.