[openstack-dev] [swift] Plan to add Python 3 support to Swift
vstinner at redhat.com
Fri Oct 30 03:47:05 UTC 2015
We talked about Python 3 with Christian Schwede, Alistair Coles, Samuel
Meritt, Jaivish Kothari and others (sorry, I don't recall all names :-/)
during Swift contributor meetup. It looks like we had an agreement on
how to add Python 3 support to Swift. The plan is:
1) Fix the gate-swift-python34 check job
2) Make the gate-swift-python34 check job voting
3) Port remaining code step by step (incremental development)
Python 3 issues had been fixed in the past in Swift, but came back. So
it's important to not reintroduce such regressions by making the gate
Christian said that he will explain the plan at the next Swift meeting
(Wednesday). I don't think that I will be able to attend this meeting, I
have another one at the same time with my team :-/
I can put this plan in a blueprint if you want. So we can refer to the
blueprint in Python 3 changes. It's up to you.
Plan in detail.
(1) To fix the Python 3 job, the idea is to only run a subset of tests
on Python 3. For example, if we fix Python 3 issues with dnspython
(dnspython3) and PyEClib dependencies, we can run
"nosetests test/unit/common/test_exceptions.py" on Python 3 (the test
pass on Python 3).
We need these two changes:
* "py3: Update pbr and dnspython requirements"
* "py3: Add py34 test environment to tox"
(2) When the gate-swift-python34 check job will pass and we waited long
enough to consider that it's stable, we can make it voting. At this
point, we cannot introduced Python 3 regressions on the code tested on
Python 3. Then the idea is to run more and more tests on Python 3.
(3) Ok, now the interesting part. To port remaining code, following
changes will enlarge the code coverage of Python 3 tests by adding new
tests to tox.ini. For example, port utils.py to Python 3 and add
test_utils.py to tox.ini.
Q: "Is it possible to port Swift to Python 3 in a single patch?"
A: Yes, it is technically possible. But it would be one unique giant
patch simply impossible to review and that will conflict at each merged
change. Some changes required by Python 3 need discussions and to make
technical choices. It's more convenient to work on smaller patches.
Q: "How much changes do we need to port Swift to Python ?"
A: Sorry, I don't know. Since we cannot run all tests on Python 3 right
now, we cannot see all issues. It's really hard to estimate the number
of required changes. Anyway, the plan is to port the code step by step.
More information about the OpenStack-dev