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
=== modified file 'Makefile'
--- Makefile 2013-11-13 18:13:00 +0000
+++ Makefile 2013-11-14 12:24:22 +0000
@@ -1,7 +1,7 @@
1# Copyright 2013 Canonical Ltd. This software is licensed under the1# Copyright 2013 Canonical Ltd. This software is licensed under the
2# GNU Affero General Public License version 3 (see the file LICENSE).2# GNU Affero General Public License version 3 (see the file LICENSE).
33
4PYTHON := python4PYTHON := python3
55
6define virtualenv6define virtualenv
7virtualenv --python=$(PYTHON) --quiet7virtualenv --python=$(PYTHON) --quiet
88
=== modified file 'maastest/__init__.py'
--- maastest/__init__.py 2013-10-31 20:15:42 +0000
+++ maastest/__init__.py 2013-11-14 12:24:22 +0000
@@ -3,12 +3,4 @@
33
4"""maastest."""4"""maastest."""
55
6from __future__ import (6__all__ = []
7 absolute_import,
8 print_function,
9 unicode_literals,
10 )
11
12__metaclass__ = type
13__all__ = [
14 ]
157
=== modified file 'maastest/kvmfixture.py'
--- maastest/kvmfixture.py 2013-11-14 09:03:57 +0000
+++ maastest/kvmfixture.py 2013-11-14 12:24:22 +0000
@@ -3,13 +3,6 @@
33
4"""Manage a KVM machine."""4"""Manage a KVM machine."""
55
6from __future__ import (
7 absolute_import,
8 print_function,
9 unicode_literals,
10 )
11
12__metaclass__ = type
13__all__ = [6__all__ = [
14 "KVMFixture",7 "KVMFixture",
15 ]8 ]
169
=== modified file 'maastest/main.py'
--- maastest/main.py 2013-11-14 09:03:57 +0000
+++ maastest/main.py 2013-11-14 12:24:22 +0000
@@ -3,13 +3,6 @@
33
4"""Test whether or not a node is compatible with MAAS."""4"""Test whether or not a node is compatible with MAAS."""
55
6from __future__ import (
7 absolute_import,
8 print_function,
9 unicode_literals,
10 )
11
12__metaclass__ = type
13__all__ = [6__all__ = [
14 "main",7 "main",
15 ]8 ]
169
=== modified file 'maastest/prepare.py'
--- maastest/prepare.py 2013-11-14 03:41:14 +0000
+++ maastest/prepare.py 2013-11-14 12:24:22 +0000
@@ -3,15 +3,6 @@
33
4"""Helpers for setting up MAAS in a virtual machine."""4"""Helpers for setting up MAAS in a virtual machine."""
55
6from __future__ import (
7 absolute_import,
8 print_function,
9 unicode_literals,
10 )
11
12str = None
13
14__metaclass__ = type
15__all__ = [6__all__ = [
16 'determine_vm_series',7 'determine_vm_series',
17 'determine_vm_architecture',8 'determine_vm_architecture',
189
=== modified file 'maastest/tests/test_kvmfixture.py'
--- maastest/tests/test_kvmfixture.py 2013-11-14 09:03:57 +0000
+++ maastest/tests/test_kvmfixture.py 2013-11-14 12:24:22 +0000
@@ -3,13 +3,6 @@
33
4"""Tests for `maastest.kvmfixture`."""4"""Tests for `maastest.kvmfixture`."""
55
6from __future__ import (
7 absolute_import,
8 print_function,
9 unicode_literals,
10 )
11
12__metaclass__ = type
13__all__ = []6__all__ = []
147
15from datetime import timedelta8from datetime import timedelta
@@ -282,7 +275,7 @@
282 earlier_fixture.generate_ssh_key()275 earlier_fixture.generate_ssh_key()
283276
284 # We decode the file contents here to work around bug #1250483277 # We decode the file contents here to work around bug #1250483
285 # in FileContains later. This is for Python 3 compatibility.278 # in FileContains later.
286 earlier_private_key_contents = read_file(279 earlier_private_key_contents = read_file(
287 earlier_fixture.ssh_private_key_file).decode("ascii")280 earlier_fixture.ssh_private_key_file).decode("ascii")
288 earlier_public_key_contents = read_file(281 earlier_public_key_contents = read_file(
289282
=== modified file 'maastest/tests/test_main.py'
--- maastest/tests/test_main.py 2013-11-08 15:33:37 +0000
+++ maastest/tests/test_main.py 2013-11-14 12:24:22 +0000
@@ -3,13 +3,6 @@
33
4"""Tests for `maastest.main`."""4"""Tests for `maastest.main`."""
55
6from __future__ import (
7 absolute_import,
8 print_function,
9 unicode_literals,
10 )
11
12__metaclass__ = type
13__all__ = []6__all__ = []
147
15import testtools8import testtools
169
=== modified file 'maastest/tests/test_prepare.py'
--- maastest/tests/test_prepare.py 2013-11-14 03:41:14 +0000
+++ maastest/tests/test_prepare.py 2013-11-14 12:24:22 +0000
@@ -3,15 +3,6 @@
33
4"""Tests for the "prepare" command."""4"""Tests for the "prepare" command."""
55
6from __future__ import (
7 absolute_import,
8 print_function,
9 unicode_literals,
10 )
11
12str = None
13
14__metaclass__ = type
15__all__ = []6__all__ = []
167
17import platform8import platform
189
=== modified file 'maastest/tests/test_utils.py'
--- maastest/tests/test_utils.py 2013-11-13 16:46:27 +0000
+++ maastest/tests/test_utils.py 2013-11-14 12:24:22 +0000
@@ -3,13 +3,6 @@
33
4"""Tests for `maastest.utils`."""4"""Tests for `maastest.utils`."""
55
6from __future__ import (
7 absolute_import,
8 print_function,
9 unicode_literals,
10 )
11
12__metaclass__ = type
13__all__ = []6__all__ = []
147
15import os.path8import os.path
169
=== modified file 'maastest/utils.py'
--- maastest/utils.py 2013-11-13 11:32:38 +0000
+++ maastest/utils.py 2013-11-14 12:24:22 +0000
@@ -3,13 +3,6 @@
33
4"""maas-test utilities."""4"""maas-test utilities."""
55
6from __future__ import (
7 absolute_import,
8 print_function,
9 unicode_literals,
10 )
11
12__metaclass__ = type
13__all__ = [6__all__ = [
14 "BINARY",7 "BINARY",
15 "binary_content",8 "binary_content",
169
=== modified file 'setup.py'
--- setup.py 2013-11-13 18:14:48 +0000
+++ setup.py 2013-11-14 12:24:22 +0000
@@ -4,14 +4,6 @@
44
5"""Distutils installer for maas-test."""5"""Distutils installer for maas-test."""
66
7from __future__ import (
8 absolute_import,
9 print_function,
10 unicode_literals,
11 )
12
13__metaclass__ = type
14
15from setuptools import setup7from setuptools import setup
16import six8import six
179

Subscribers

People subscribed via source and target branches