← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] ~cjwatson/turnip:remove-remaining-py2-deps into turnip:master

 

Colin Watson has proposed merging ~cjwatson/turnip:remove-remaining-py2-deps into turnip:master.

Commit message:
Remove remaining Python 2 interpreter dependencies

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~cjwatson/turnip/+git/turnip/+merge/405052
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of ~cjwatson/turnip:remove-remaining-py2-deps into turnip:master.
diff --git a/Makefile b/Makefile
index 2d43994..bb214c7 100644
--- a/Makefile
+++ b/Makefile
@@ -86,7 +86,7 @@ clean:
 	rm -f turnip/version_info.py
 
 dist:
-	python ./setup.py sdist
+	python3 ./setup.py sdist
 
 TAGS:
 	ctags -e -R turnip
diff --git a/README.rst b/README.rst
index 483a72f..4cf9b31 100644
--- a/README.rst
+++ b/README.rst
@@ -141,9 +141,9 @@ In the Turnip container the hosts file needs to point to the LP container (x.x.x
 	ff02::3 ip6-allhosts
 
 A basic test that can be performed by dropping into the Turnip container shell. Below exception is expected as Repository '1' did not exist when the RPC call was performed, it does show however that Turnip is able to resolve xmlrpc-private.launchpad.test and there is connectivity between LP and Turnip:
-	user@launchpad:~$ lxc exec turnip python
+	user@launchpad:~$ lxc exec turnip python3
 	...
-	>>> from xmlrpclib import ServerProxy
+	>>> from xmlrpc.client import ServerProxy
 	>>> proxy = ServerProxy('http://xmlrpc-private.launchpad.test:8087/git')
 	>>> proxy.translatePath('1', 'read', {})
 	Traceback (most recent call last):
diff --git a/charm/layer/turnip-base/lib/charms/turnip/base.py b/charm/layer/turnip-base/lib/charms/turnip/base.py
index 39e0fcc..552705f 100644
--- a/charm/layer/turnip-base/lib/charms/turnip/base.py
+++ b/charm/layer/turnip-base/lib/charms/turnip/base.py
@@ -148,7 +148,7 @@ def symlink_force(source, link_name):
 
 def install_packages():
     if hookenv.config()['swift_username']:
-        apt_install('python-swiftclient', fatal=True)
+        apt_install('python3-swiftclient', fatal=True)
 
 
 def install_payload_packages(target_dir):
diff --git a/charm/turnip-celery/reactive/turnip-celery.py b/charm/turnip-celery/reactive/turnip-celery.py
index ea49f2c..7604852 100644
--- a/charm/turnip-celery/reactive/turnip-celery.py
+++ b/charm/turnip-celery/reactive/turnip-celery.py
@@ -86,7 +86,7 @@ def nrpe_available():
          # NrpeExternalMasterProvides.add_check just joins the argument list
          # with spaces rather than doing appropriate shell quoting.  Also
          # note that ['-C', 'celery'] would be unsafe because the command
-         # name seems to be either celery or python2 depending on exact
+         # name seems to be either celery or python3 depending on exact
          # details of the process lifecycle.
          '--ereg-argument-array', "'celery.*-A turnip.tasks worker'"],
         name='check_celery',
diff --git a/system-dependencies.txt b/system-dependencies.txt
index bba90b9..5243ffb 100644
--- a/system-dependencies.txt
+++ b/system-dependencies.txt
@@ -6,6 +6,5 @@ libgit2-27
 libssl-dev
 libxml2-dev
 libxslt1-dev
-python-dev
 python3-dev
 virtualenv
diff --git a/turnip/pack/git_helper.py b/turnip/pack/git_helper.py
index aa7e804..9d2756e 100755
--- a/turnip/pack/git_helper.py
+++ b/turnip/pack/git_helper.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
 
 # Copyright 2020 Canonical Ltd.  This software is licensed under the
 # GNU Affero General Public License version 3 (see the file LICENSE).