Merge lp://staging/~ogra/xdiagnose/py3port into lp://staging/xdiagnose

Proposed by Oliver Grawert
Status: Merged
Merged at revision: 256
Proposed branch: lp://staging/~ogra/xdiagnose/py3port
Merge into: lp://staging/xdiagnose
Diff against target: 1040 lines (+266/-182)
35 files modified
apport/apport-gpu-error-intel.py (+7/-5)
apport/source_xorg.py (+11/-5)
bin/dpkg-log-summary (+9/-11)
bin/xdiagnose (+3/-1)
bin/xpci (+8/-6)
bin/xrandr-tool (+12/-10)
data/workloads/run_workloads (+3/-1)
debian/changelog (+16/-0)
debian/control (+7/-5)
debian/pycompat (+0/-1)
debian/rules (+17/-1)
run-tests (+1/-1)
setup.py (+1/-1)
tests/test_apport_gpu_hook (+1/-1)
tests/test_diagnostic (+3/-1)
tests/test_grub_file (+3/-1)
tests/test_script_syntax.sh (+5/-3)
tests/test_source_xorg (+1/-1)
xdiagnose/applet.py (+14/-14)
xdiagnose/application.py (+3/-1)
xdiagnose/config_update.py (+12/-10)
xdiagnose/diagnostics.py (+28/-27)
xdiagnose/edid.py (+48/-46)
xdiagnose/errors_treeview.py (+3/-1)
xdiagnose/info.py (+9/-7)
xdiagnose/pci_devices.py (+5/-3)
xdiagnose/utils/dates.py (+6/-4)
xdiagnose/utils/debug.py (+3/-1)
xdiagnose/utils/execute.py (+3/-1)
xdiagnose/utils/math.py (+3/-1)
xdiagnose/utils/option_handler.py (+3/-1)
xdiagnose/utils/paths.py (+4/-2)
xdiagnose/utils/screen.py (+5/-3)
xdiagnose/utils/text.py (+3/-1)
xdiagnose/welcome.py (+6/-4)
To merge this branch: bzr merge lp://staging/~ogra/xdiagnose/py3port
Reviewer Review Type Date Requested Status
Bryce Harrington Approve
Colin Watson (community) Approve
Review via email: mp+109633@code.staging.launchpad.net

Description of the change

this merge carries all program code changes for python3 support, do not merge it standalone without package changes. this branch is kept separate from py3 package fixes for easier reviewing only, packaging adjustments will follow shortly in another merge proposal.

To post a comment you must log in.
Revision history for this message
Colin Watson (cjwatson) wrote :

- for k, r in codes.items():
+ for k, r in list(codes.items()):

This is just 2to3 being conservative; you don't actually need the list() here, since the body of the loop doesn't modify codes.

+ dates = list(dates.keys())
  dates.sort()
  return dates

Simpler: "return sorted(dates)"

+ pkgs = list(dpkg_events.keys())
  pkgs.sort()
  for pkg in pkgs:

"for pkg in sorted(dpkg_events):"

+ print(device.name, device.regex, end=' ')
...

Doesn't this end up writing double spaces sometimes (e.g. in the "NOT SUPPORTED" case)? I'd have been inclined to use end=''.

The rest looks fine to me, although I'd have been inclined to add print_function and absolute_import imports from __future__ as applicable just in case there's a need to revert the #! to /usr/bin/python for some reason.

review: Approve
lp://staging/~ogra/xdiagnose/py3port updated
255. By Oliver Grawert

include required and recommended changes from cjwatson review on merge proposal 109633

256. By Oliver Grawert

adjust packaging bits for python3 support

257. By Oliver Grawert

use python_distutils in debian/rules and actually install from the real builddir, thanks xnox for helping with the fix

258. By Oliver Grawert

fix a remaining porting error with xdiagnose/applet.py (exception handling with multiple args has changed)

Revision history for this message
Bryce Harrington (bryce) wrote :

Changes look good. Once you've verified the test suite is still happy let me know and I'll merge this in.

review: Approve
lp://staging/~ogra/xdiagnose/py3port updated
259. By Oliver Grawert

add dependency on python3-apport, various fixes for testsuite, port testsuite to py3, make lp-lib optional for now

260. By Oliver Grawert

fix apport report handling in apport-gpu-error-intel.py to match the new API that needs binary file handling

261. By Oliver Grawert

xdiagnose/applet.py: fix string handling of subprocess.Popen

Revision history for this message
Oliver Grawert (ogra) wrote :

with the latest changes this branch should now be mergeable, UI and testsuite work fine in a quantal VM here

lp://staging/~ogra/xdiagnose/py3port updated
262. By Oliver Grawert

add changelog reference to bug 1013171

Revision history for this message
Bryce Harrington (bryce) wrote :

When I attempt to debuild -sa -S this branch I get an error on python3-apport:

The following packages have unmet dependencies:
 pbuilder-satisfydepends-dummy : Depends: debhelper (>= 7.0.50~) but it is not going to be installed
                                 Depends: dh-translations but it is not going to be installed
                                 Depends: python3 (>= 3.2) but it is not going to be installed
                                 Depends: python3-all but it is not going to be installed
                                 Depends: intltool but it is not going to be installed
                                 Depends: apport but it is not going to be installed
                                 Depends: python3-apport but it is not installable
                                 Depends: python3-distutils-extra (>= 2.32-2) but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

I think that python3-apport might be ok as a package dependency rather than a build dependency since it's just the apport hooks that require it during their execution. But after moving that, there's this error:

dh_auto_clean
Traceback (most recent call last):
  File "setup.py", line 20, in <module>
    import DistUtilsExtra.auto
ImportError: No module named DistUtilsExtra.auto

Which is a bit of a head-scratcher. Maybe dh_auto_clean is calling setup.py as python2 or something?

review: Needs Fixing
lp://staging/~ogra/xdiagnose/py3port updated
263. By Oliver Grawert

eek, what was i thinking, indeed we want to depend (not build-depend) on python-apport (and not python3-apport)

Revision history for this message
Oliver Grawert (ogra) wrote :

sorry, indeed the build-dep was wrong and i'm also not sure why i used python3 in the package name (python-apport is actually the py3 version already), fixed now ...

the build error does not happen for me over here, it is indeed strange

Revision history for this message
Bryce Harrington (bryce) wrote :

Excellent, thanks!

I sorted out the build issue I was seeing. It appears that the package build requires *both* python-distutils-extra and python3-distutils-extra. Not sure why, but unless both are included as build requirements, the package fails in the dh_auto_clean proc. I'm guessing that this is running clean for both python2 and python3, or something like that.

There's still a couple warnings I'm seeing:

   dh_python3 -O--buildsystem=python_distutils
W: dh_python3:181: Python 2.x location detected, please use dh_python2: debian/xdiagnose/usr/lib/python2.7
   dh_python2 -O--buildsystem=python_distutils
W: dh_python2:334: Python 3.x location detected, please use dh_python3: debian/xdiagnose/usr/lib/python3
   dh_usrlocal -O--buildsystem=python_distutils

However I think those are unrelated, and sound possibly innocuous so am going to ignore them for now. But if these sound meaningful to you, I'd love some tips on resolving them.

review: Approve
Revision history for this message
Thomas Kluyver (takluyver) wrote :

Are you sure python-apport is the right thing to depend on? It seems to explicitly depend on Python 2: http://packages.ubuntu.com/quantal/python-apport

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches