Merge lp:~allenap/maas-test/onwards-python into lp:maas-test

Proposed by Gavin Panella
Status: Work in progress
Proposed branch: lp:~allenap/maas-test/onwards-python
Merge into: lp:maas-test
Prerequisite: lp:~allenap/maas-test/use-system-packages
Diff against target: 205 lines (+3/-79)
11 files modified
Makefile (+1/-1)
maastest/__init__.py (+1/-9)
maastest/kvmfixture.py (+0/-7)
maastest/main.py (+0/-7)
maastest/prepare.py (+0/-9)
maastest/tests/test_kvmfixture.py (+1/-8)
maastest/tests/test_main.py (+0/-7)
maastest/tests/test_prepare.py (+0/-9)
maastest/tests/test_utils.py (+0/-7)
maastest/utils.py (+0/-7)
setup.py (+0/-8)
To merge this branch: bzr merge lp:~allenap/maas-test/onwards-python
Reviewer Review Type Date Requested Status
MAAS Maintainers Pending
Review via email: mp+194756@code.launchpad.net

Commit message

Switch to Python 3.

To post a comment you must log in.
Revision history for this message
Gavin Panella (allenap) wrote :

This all went fairly smoothly. We don't have to land this now, if we're not sure we can see it through to the end (i.e. if porting the integration tests is going to be too yak-shavey), but it's interested to see nonetheless.

There were only a couple of classes of error in our Python 2 code: assuming map() returns a list, and a few comparisons between unicode and byte strings. This is quite encouraging, because they're easy things to spot and fix.

Revision history for this message
Jeroen T. Vermeulen (jtv) wrote :

Very encouraging — let's try not to let this bit-rot! It'd be good to know that the API client will also work with python 3 before landing though. Maybe just put TODO comments in place for the changes that can't be done in a cross-dialect form?

The letters/ascii_letters change is compatible with Python 2, as are the list comprehensions to replace map() calls, so I'd land these no-brainer changes first as a separate branch.

lp:~allenap/maas-test/onwards-python updated
23. By Gavin Panella

Merge use-system-packages.

24. By Gavin Panella

Merge trunk, fixing various things.

25. By Gavin Panella

Merge trunk, fixing many conflicts.

26. By Gavin Panella

Remove some merge artifacts.

27. By Gavin Panella

Merge trunk, resolving conflicts.

28. By Gavin Panella

Merge trunk, resolving conflicts.

29. By Gavin Panella

Merge trunk.

30. By Gavin Panella

Merge trunk.

Unmerged revisions

30. By Gavin Panella

Merge trunk.

29. By Gavin Panella

Merge trunk.

28. By Gavin Panella

Merge trunk, resolving conflicts.

27. By Gavin Panella

Merge trunk, resolving conflicts.

26. By Gavin Panella

Remove some merge artifacts.

25. By Gavin Panella

Merge trunk, fixing many conflicts.

24. By Gavin Panella

Merge trunk, fixing various things.

23. By Gavin Panella

Merge use-system-packages.

22. By Gavin Panella

Merge use-system-packages.

21. By Gavin Panella

Switch to assertRegex.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'Makefile'
2--- Makefile 2013-11-13 18:13:00 +0000
3+++ Makefile 2013-11-14 12:24:22 +0000
4@@ -1,7 +1,7 @@
5 # Copyright 2013 Canonical Ltd. This software is licensed under the
6 # GNU Affero General Public License version 3 (see the file LICENSE).
7
8-PYTHON := python
9+PYTHON := python3
10
11 define virtualenv
12 virtualenv --python=$(PYTHON) --quiet
13
14=== modified file 'maastest/__init__.py'
15--- maastest/__init__.py 2013-10-31 20:15:42 +0000
16+++ maastest/__init__.py 2013-11-14 12:24:22 +0000
17@@ -3,12 +3,4 @@
18
19 """maastest."""
20
21-from __future__ import (
22- absolute_import,
23- print_function,
24- unicode_literals,
25- )
26-
27-__metaclass__ = type
28-__all__ = [
29- ]
30+__all__ = []
31
32=== modified file 'maastest/kvmfixture.py'
33--- maastest/kvmfixture.py 2013-11-14 09:03:57 +0000
34+++ maastest/kvmfixture.py 2013-11-14 12:24:22 +0000
35@@ -3,13 +3,6 @@
36
37 """Manage a KVM machine."""
38
39-from __future__ import (
40- absolute_import,
41- print_function,
42- unicode_literals,
43- )
44-
45-__metaclass__ = type
46 __all__ = [
47 "KVMFixture",
48 ]
49
50=== modified file 'maastest/main.py'
51--- maastest/main.py 2013-11-14 09:03:57 +0000
52+++ maastest/main.py 2013-11-14 12:24:22 +0000
53@@ -3,13 +3,6 @@
54
55 """Test whether or not a node is compatible with MAAS."""
56
57-from __future__ import (
58- absolute_import,
59- print_function,
60- unicode_literals,
61- )
62-
63-__metaclass__ = type
64 __all__ = [
65 "main",
66 ]
67
68=== modified file 'maastest/prepare.py'
69--- maastest/prepare.py 2013-11-14 03:41:14 +0000
70+++ maastest/prepare.py 2013-11-14 12:24:22 +0000
71@@ -3,15 +3,6 @@
72
73 """Helpers for setting up MAAS in a virtual machine."""
74
75-from __future__ import (
76- absolute_import,
77- print_function,
78- unicode_literals,
79- )
80-
81-str = None
82-
83-__metaclass__ = type
84 __all__ = [
85 'determine_vm_series',
86 'determine_vm_architecture',
87
88=== modified file 'maastest/tests/test_kvmfixture.py'
89--- maastest/tests/test_kvmfixture.py 2013-11-14 09:03:57 +0000
90+++ maastest/tests/test_kvmfixture.py 2013-11-14 12:24:22 +0000
91@@ -3,13 +3,6 @@
92
93 """Tests for `maastest.kvmfixture`."""
94
95-from __future__ import (
96- absolute_import,
97- print_function,
98- unicode_literals,
99- )
100-
101-__metaclass__ = type
102 __all__ = []
103
104 from datetime import timedelta
105@@ -282,7 +275,7 @@
106 earlier_fixture.generate_ssh_key()
107
108 # We decode the file contents here to work around bug #1250483
109- # in FileContains later. This is for Python 3 compatibility.
110+ # in FileContains later.
111 earlier_private_key_contents = read_file(
112 earlier_fixture.ssh_private_key_file).decode("ascii")
113 earlier_public_key_contents = read_file(
114
115=== modified file 'maastest/tests/test_main.py'
116--- maastest/tests/test_main.py 2013-11-08 15:33:37 +0000
117+++ maastest/tests/test_main.py 2013-11-14 12:24:22 +0000
118@@ -3,13 +3,6 @@
119
120 """Tests for `maastest.main`."""
121
122-from __future__ import (
123- absolute_import,
124- print_function,
125- unicode_literals,
126- )
127-
128-__metaclass__ = type
129 __all__ = []
130
131 import testtools
132
133=== modified file 'maastest/tests/test_prepare.py'
134--- maastest/tests/test_prepare.py 2013-11-14 03:41:14 +0000
135+++ maastest/tests/test_prepare.py 2013-11-14 12:24:22 +0000
136@@ -3,15 +3,6 @@
137
138 """Tests for the "prepare" command."""
139
140-from __future__ import (
141- absolute_import,
142- print_function,
143- unicode_literals,
144- )
145-
146-str = None
147-
148-__metaclass__ = type
149 __all__ = []
150
151 import platform
152
153=== modified file 'maastest/tests/test_utils.py'
154--- maastest/tests/test_utils.py 2013-11-13 16:46:27 +0000
155+++ maastest/tests/test_utils.py 2013-11-14 12:24:22 +0000
156@@ -3,13 +3,6 @@
157
158 """Tests for `maastest.utils`."""
159
160-from __future__ import (
161- absolute_import,
162- print_function,
163- unicode_literals,
164- )
165-
166-__metaclass__ = type
167 __all__ = []
168
169 import os.path
170
171=== modified file 'maastest/utils.py'
172--- maastest/utils.py 2013-11-13 11:32:38 +0000
173+++ maastest/utils.py 2013-11-14 12:24:22 +0000
174@@ -3,13 +3,6 @@
175
176 """maas-test utilities."""
177
178-from __future__ import (
179- absolute_import,
180- print_function,
181- unicode_literals,
182- )
183-
184-__metaclass__ = type
185 __all__ = [
186 "BINARY",
187 "binary_content",
188
189=== modified file 'setup.py'
190--- setup.py 2013-11-13 18:14:48 +0000
191+++ setup.py 2013-11-14 12:24:22 +0000
192@@ -4,14 +4,6 @@
193
194 """Distutils installer for maas-test."""
195
196-from __future__ import (
197- absolute_import,
198- print_function,
199- unicode_literals,
200- )
201-
202-__metaclass__ = type
203-
204 from setuptools import setup
205 import six
206

Subscribers

People subscribed via source and target branches