Merge lp:~unity-team/unity/python3-ready into lp:unity
- python3-ready
- Merge into trunk
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Marco Trevisan (Treviño) | ||||
Approved revision: | no longer in the source branch. | ||||
Merged at revision: | 4049 | ||||
Proposed branch: | lp:~unity-team/unity/python3-ready | ||||
Merge into: | lp:unity | ||||
Prerequisite: | lp:~unity-team/unity/unity-7.4.0-bump | ||||
Diff against target: |
292 lines (+67/-58) 5 files modified
debian/changelog (+13/-0) debian/control (+3/-1) debian/rules (+6/-11) tests/CMakeLists.txt (+1/-1) tools/unity.cmake (+44/-45) |
||||
To merge this branch: | bzr merge lp:~unity-team/unity/python3-ready | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
PS Jenkins bot (community) | continuous-integration | Approve | |
Barry Warsaw (community) | Needs Information | ||
Unity Team | Pending | ||
Review via email:
|
Commit message
unity: ensure we use python3 for the launch script and python2.7 for autopilot
Description of the change
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
PS Jenkins bot (ps-jenkins) wrote : | # |
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Barry Warsaw (barry) wrote : | # |
A couple of comments where I still see Python 2 referenced.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:4040
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Marco Trevisan (Treviño) (3v1n0) wrote : | # |
As replied in comments, we still need python2 for unity-autopilot package, which is in universe.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:4040
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Barry Warsaw (barry) wrote : | # |
On Nov 06, 2015, at 11:45 AM, Marco Trevisan (Treviño) wrote:
>As replied in comments, we still need python2 for unity-autopilot package,
>which is in universe.
[...]
>autopilot-legacy is still using python2 (and I don't think it's worth to port
>it), so we need to get these to be properly installed for it to see them.
Agreed that it doesn't make sense to port autopilot. If it's a build-time
dependency, there's no problem, so this change LGTM. +1
Thanks for the explanation.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:4040
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:4040
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:4041
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:4043
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:4044
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:4045
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Barry Warsaw (barry) wrote : | # |
Hi, what's the status of this merge proposal and the linked bug?
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Sebastien Bacher (seb128) wrote : | # |
seems to have created that issue
https:/
" File "/usr/bin/unity", line 110, in process_
if re.match(
File "/usr/lib/
return _compile(pattern, flags).
TypeError: cannot use a string pattern on a bytes-like object"
Preview Diff
1 | === modified file 'debian/changelog' |
2 | --- debian/changelog 2015-11-02 13:29:58 +0000 |
3 | +++ debian/changelog 2015-12-11 12:38:15 +0000 |
4 | @@ -1,3 +1,16 @@ |
5 | +unity (7.4.0+16.04.20151102-0ubuntu3) UNRELEASED; urgency=medium |
6 | + |
7 | + * unity: ensure we use python3 for the launch script and |
8 | + python2.7 for autopilot (LP: #1512909) |
9 | + |
10 | + -- Marco Trevisan (Treviño) <marco@ubuntu.com> Fri, 11 Dec 2015 12:36:15 +0000 |
11 | + |
12 | +unity (7.4.0+16.04.20151102-0ubuntu2) xenial; urgency=medium |
13 | + |
14 | + * No-change rebuild against libglew1.13 |
15 | + |
16 | + -- Steve Langasek <steve.langasek@ubuntu.com> Wed, 11 Nov 2015 19:49:37 +0000 |
17 | + |
18 | unity (7.4.0+16.04.20151102-0ubuntu1) xenial; urgency=medium |
19 | |
20 | [ Marco Trevisan (Treviño) ] |
21 | |
22 | === modified file 'debian/control' |
23 | --- debian/control 2015-11-02 13:29:35 +0000 |
24 | +++ debian/control 2015-12-11 12:38:15 +0000 |
25 | @@ -8,6 +8,7 @@ |
26 | dbus-test-runner, |
27 | dh-migrations, |
28 | dh-translations (>= 94), |
29 | + dh-python, |
30 | google-mock (>= 1.6.0+svn437), |
31 | gsettings-desktop-schemas-dev, |
32 | gsettings-ubuntu-schemas (>= 0.0.1+14.04.20140219), |
33 | @@ -48,6 +49,7 @@ |
34 | libzeitgeist-2.0-dev, |
35 | pkg-config, |
36 | python (>= 2.7), |
37 | + python3 (>= 3.4), |
38 | python-setuptools, |
39 | quilt, |
40 | xserver-xorg-video-dummy, |
41 | @@ -62,7 +64,7 @@ |
42 | Architecture: any |
43 | Depends: ${shlibs:Depends}, |
44 | ${misc:Depends}, |
45 | - ${python:Depends}, |
46 | + ${python3:Depends}, |
47 | libunity-core-6.0-9 (= ${binary:Version}), |
48 | compiz, |
49 | compiz-core, compiz-core-abiversion-${coreabiversion}, |
50 | |
51 | === modified file 'debian/rules' |
52 | --- debian/rules 2015-10-30 16:13:00 +0000 |
53 | +++ debian/rules 2015-12-11 12:38:15 +0000 |
54 | @@ -10,17 +10,17 @@ |
55 | DEB_VERSION := $(shell dpkg-parsechangelog | egrep '^Version:' | cut -f 2 -d ' ') |
56 | |
57 | # avoid template instance removal (lp:1286284) |
58 | -export DEB_CXXFLAGS_MAINT_STRIP=-O3 |
59 | -export DEB_CXXFLAGS_MAINT_APPEND=-O2 |
60 | +ifeq ($(DEB_HOST_ARCH),$(findstring $(DEB_HOST_ARCH), ppc64el)) |
61 | + export DEB_CXXFLAGS_MAINT_STRIP=-O3 |
62 | + export DEB_CXXFLAGS_MAINT_APPEND=-O2 |
63 | +endif |
64 | |
65 | # http://ccache.samba.org/manual.html#_precompiled_headers |
66 | CCACHE_SLOPPINESS=time_macros |
67 | |
68 | CORE_ABIVERSION := $(shell sed -rn 's/^\#define[[:space:]]+CORE_ABIVERSION[[:space:]]+//p' /usr/include/compiz/core/abiversion.h ) |
69 | NUX_ABIVERSION := $(shell sed -rn 's/^\#define[[:space:]]+NUX_ABIVERSION[[:space:]]+//p' /usr/include/Nux-4.0/Nux/ABI.h ) |
70 | - |
71 | LIBUNITY_PRIVATE := $(shell pkg-config --libs-only-L unity-protocol-private | sed -e 's/-L\(.*\)/\1/' ) |
72 | - |
73 | SCOPES_RECOMMENDS := $(shell perl debian/scopes-recommends-generator /usr/share/unity/client-scopes.json) |
74 | |
75 | cmake_base_options := -DUSE_GSETTINGS=TRUE -DCOMPIZ_BUILD_WITH_RPATH=FALSE -DCOMPIZ_PACKAGING_ENABLED=TRUE -DCMAKE_SYSCONFDIR=/etc -DCOMPIZ_PLUGIN_INSTALL_TYPE=package |
76 | @@ -28,11 +28,6 @@ |
77 | cmake_gl_options := -DBUILD_GLES=TRUE -DDISABLE_MAINTAINER_CFLAGS=ON |
78 | endif |
79 | |
80 | -# Workaround for bug #1511542 |
81 | -ifeq ($(DEB_HOST_ARCH),$(findstring $(DEB_HOST_ARCH), arm64)) |
82 | - cmake_pch_options := -DENABLE_UNIT_TESTS=OFF |
83 | -endif |
84 | - |
85 | override_dh_auto_configure: |
86 | dh_auto_configure -- $(cmake_base_options) $(cmake_gl_options) $(cmake_pch_options) |
87 | |
88 | @@ -46,7 +41,7 @@ |
89 | find debian/tmp/usr/lib -name \*.*a -exec rm {} \; |
90 | rm -f debian/tmp/usr/share/compiz/networkarearegion.xml |
91 | rm -f debian/tmp//usr/lib/compiz/libnetworkarearegion.so |
92 | - rm -rf debian/tmp/usr/share/gconf/schemas/ |
93 | + rm -rf debian/tmp/usr/share/gconf/schemas/ |
94 | dh_install --fail-missing |
95 | |
96 | override_dh_gencontrol: |
97 | @@ -64,4 +59,4 @@ |
98 | endif |
99 | |
100 | %: |
101 | - dh $@ --with translations,quilt,python2,migrations --parallel |
102 | + dh $@ --with translations,quilt,python2,python3,migrations --parallel |
103 | |
104 | === modified file 'tests/CMakeLists.txt' |
105 | --- tests/CMakeLists.txt 2015-10-16 08:46:03 +0000 |
106 | +++ tests/CMakeLists.txt 2015-12-11 12:38:15 +0000 |
107 | @@ -388,5 +388,5 @@ |
108 | # make target to allow devs to run "make autopilot" from build dir: |
109 | set (AUTOPILOTDIR "${CMAKE_CURRENT_SOURCE_DIR}/autopilot") |
110 | # Rules to install autopilot files and executable script: |
111 | -install(CODE "execute_process(COMMAND python setup.py install --prefix ${CMAKE_INSTALL_PREFIX} WORKING_DIRECTORY ${AUTOPILOTDIR})") |
112 | +install(CODE "execute_process(COMMAND python2.7 setup.py install --prefix ${CMAKE_INSTALL_PREFIX} WORKING_DIRECTORY ${AUTOPILOTDIR})") |
113 | add_custom_target (autopilot COMMAND cd ${AUTOPILOTDIR} && make check) |
114 | |
115 | === modified file 'tools/unity.cmake' |
116 | --- tools/unity.cmake 2015-08-19 15:55:28 +0000 |
117 | +++ tools/unity.cmake 2015-12-11 12:38:15 +0000 |
118 | @@ -1,4 +1,4 @@ |
119 | -#!/usr/bin/python |
120 | +#!/usr/bin/python3 |
121 | # -*- coding: utf-8 -*- |
122 | # Copyright (C) 2010, 2015 Canonical |
123 | # |
124 | @@ -18,7 +18,6 @@ |
125 | # this program; if not, write to the Free Software Foundation, Inc., |
126 | # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
127 | |
128 | -import glib |
129 | import glob |
130 | from optparse import OptionParser |
131 | import os |
132 | @@ -58,21 +57,21 @@ |
133 | '''set variable environnement for unity to run''' |
134 | |
135 | os.environ['COMPIZ_CONFIG_PROFILE'] = 'ubuntu' |
136 | - |
137 | + |
138 | if not 'DISPLAY' in os.environ: |
139 | # take an optimistic chance and warn about it :) |
140 | - print "WARNING: no DISPLAY variable set, setting it to :0" |
141 | + print("WARNING: no DISPLAY variable set, setting it to :0") |
142 | os.environ['DISPLAY'] = ':0' |
143 | |
144 | def reset_launcher_icons (): |
145 | '''Reset the default launcher icon and restart it.''' |
146 | - subprocess.Popen(["gsettings", "reset" ,"com.canonical.Unity.Launcher" , "favorites"]) |
147 | + subprocess.Popen(["gsettings", "reset" ,"com.canonical.Unity.Launcher" , "favorites"]) |
148 | |
149 | def process_and_start_unity (verbose, debug_mode, compiz_path, compiz_args, log_file): |
150 | '''launch unity under compiz (replace the current shell in any case)''' |
151 | - |
152 | + |
153 | cli = [] |
154 | - |
155 | + |
156 | if debug_mode > 0: |
157 | # we can do more check later as if it's in PATH... |
158 | if not os.path.isfile('/usr/bin/gdb'): |
159 | @@ -85,7 +84,7 @@ |
160 | sys.exit(1) |
161 | else: |
162 | cli.extend(['gdb', '--args']) |
163 | - |
164 | + |
165 | if options.compiz_path: |
166 | cli.extend([options.compiz_path, '--replace']) |
167 | else: |
168 | @@ -95,7 +94,7 @@ |
169 | cli.append("--debug") |
170 | if args: |
171 | cli.extend(compiz_args) |
172 | - |
173 | + |
174 | if log_file: |
175 | cli.extend(['2>&1', '|', 'tee', log_file]) |
176 | |
177 | @@ -119,7 +118,7 @@ |
178 | # In this case, we need a string and not a list |
179 | # FIXME: still some bug with 2>&1 not showing everything before wait() |
180 | return subprocess.Popen(" ".join(cli), env=dict(os.environ), shell=True) |
181 | - |
182 | + |
183 | |
184 | def run_unity (verbose, debug, advanced_debug, compiz_path, compiz_args, log_file): |
185 | '''run the unity shell and handle Ctrl + C''' |
186 | @@ -130,7 +129,7 @@ |
187 | unity_instance = process_and_start_unity (verbose, debug_mode, compiz_path, compiz_args, log_file) |
188 | subprocess.call(["start", "unity-panel-service"]) |
189 | unity_instance.wait() |
190 | - except KeyboardInterrupt, e: |
191 | + except KeyboardInterrupt as e: |
192 | try: |
193 | os.kill(unity_instance.pid, signal.SIGKILL) |
194 | except: |
195 | @@ -139,31 +138,31 @@ |
196 | sys.exit(unity_instance.returncode) |
197 | |
198 | def reset_to_distro(): |
199 | - ''' remove all known default local installation path ''' |
200 | - |
201 | - # check if we are root, we need to be root |
202 | - if os.getuid() != 0: |
203 | - print "Error: You need to be root to remove your local unity installation" |
204 | - return 1 |
205 | - error = False |
206 | - |
207 | - for filedir in well_known_local_path: |
208 | - for elem in glob.glob(filedir): |
209 | - try: |
210 | - shutil.rmtree(elem) |
211 | - except OSError, e: |
212 | - if os.path.isfile(elem) or os.path.islink(elem): |
213 | - os.remove(elem) |
214 | - else: |
215 | - print "ERROR: Cannot remove %s: %s" % (elem, e) |
216 | - error = True |
217 | - |
218 | - if error: |
219 | - print "See above: some error happened and you should clean them before trying to restart unity" |
220 | - return 1 |
221 | - else: |
222 | - print "Unity local install cleaned, you can now restart unity" |
223 | - return 0 |
224 | + ''' remove all known default local installation path ''' |
225 | + |
226 | + # check if we are root, we need to be root |
227 | + if os.getuid() != 0: |
228 | + print("Error: You need to be root to remove your local unity installation") |
229 | + return 1 |
230 | + error = False |
231 | + |
232 | + for filedir in well_known_local_path: |
233 | + for elem in glob.glob(filedir): |
234 | + try: |
235 | + shutil.rmtree(elem) |
236 | + except OSError as e: |
237 | + if os.path.isfile(elem) or os.path.islink(elem): |
238 | + os.remove(elem) |
239 | + else: |
240 | + print("ERROR: Cannot remove %s: %s" % (elem, e)) |
241 | + error = True |
242 | + |
243 | + if error: |
244 | + print("See above: some error happened and you should clean them before trying to restart unity") |
245 | + return 1 |
246 | + else: |
247 | + print("Unity local install cleaned, you can now restart unity") |
248 | + return 0 |
249 | |
250 | if __name__ == '__main__': |
251 | usage = "usage: %prog [options]" |
252 | @@ -176,7 +175,7 @@ |
253 | parser.add_option("--debug", action="store_true", |
254 | help="Run unity under gdb and print a backtrace on crash. /!\ Only if devs ask for it.") |
255 | parser.add_option("--distro", action="store_true", |
256 | - help="Remove local build if present with default values to return to the package value (this doesn't run unity and need root access)") |
257 | + help="Remove local build if present with default values to return to the package value (this doesn't run unity and need root access)") |
258 | parser.add_option("--log", action="store", |
259 | help="Store log under filename.") |
260 | parser.add_option("--replace", action="store_true", |
261 | @@ -184,7 +183,7 @@ |
262 | parser.add_option("--reset", action="store_true", |
263 | help="(deprecated: provided for backwards compatibility)") |
264 | parser.add_option("--reset-icons", action="store_true", |
265 | - help="Reset the default launcher icon.") |
266 | + help="Reset the default launcher icon.") |
267 | parser.add_option("-v", "--verbose", action="store_true", |
268 | help="Get additional debug output from unity.") |
269 | (options, args) = parser.parse_args() |
270 | @@ -192,15 +191,15 @@ |
271 | set_unity_env() |
272 | |
273 | if options.distro: |
274 | - sys.exit(reset_to_distro()) |
275 | + sys.exit(reset_to_distro()) |
276 | |
277 | if options.reset: |
278 | - print ("The --reset option is deprecated, You should run with no options instead.") |
279 | - |
280 | + print ("The --reset option is deprecated, You should run with no options instead.") |
281 | + |
282 | if options.reset_icons: |
283 | reset_launcher_icons () |
284 | - |
285 | - if options.replace: |
286 | - print ("WARNING: This is for compatibility with other desktop interfaces please use unity without --replace") |
287 | - |
288 | + |
289 | + if options.replace: |
290 | + print ("WARNING: This is for compatibility with other desktop interfaces please use unity without --replace") |
291 | + |
292 | run_unity (options.verbose, options.debug, options.advanced_debug, options.compiz_path, args, options.log) |
FAILED: Continuous integration, rev:4040 jenkins. qa.ubuntu. com/job/ unity-ci/ 1338/ jenkins. qa.ubuntu. com/job/ unity-wily- amd64-ci/ 115/console jenkins. qa.ubuntu. com/job/ unity-wily- armhf-ci/ 114/console jenkins. qa.ubuntu. com/job/ unity-wily- i386-ci/ 113/console
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild: s-jenkins. ubuntu- ci:8080/ job/unity- ci/1338/ rebuild
http://