Merge lp:~cr3/checkbox/1049218 into lp:checkbox

Proposed by Marc Tardif
Status: Merged
Merged at revision: 1689
Proposed branch: lp:~cr3/checkbox/1049218
Merge into: lp:checkbox
Diff against target: 163 lines (+61/-27)
2 files modified
debian/changelog (+2/-0)
setup.py (+59/-27)
To merge this branch: bzr merge lp:~cr3/checkbox/1049218
Reviewer Review Type Date Requested Status
Kevin McDermott (community) Approve
Marc Tardif (community) Needs Resubmitting
Review via email: mp+124034@code.launchpad.net

Description of the change

Here we go again, please see if this merge request fixes the problem with the required dependency on distutils-extra. Thanks!

To post a comment you must log in.
lp:~cr3/checkbox/1049218 updated
1668. By Marc Tardif

Merged from trunk.

1669. By Marc Tardif

Re-fixed setup.py to be PEP8 compliant.

1670. By Marc Tardif

Re-fixed required dependency on distutils-extra by providing fake implementations of build_i18n and build_icons.

1671. By Marc Tardif

Re-added Launchpad bug number to debian/changelog.

Revision history for this message
Marc Tardif (cr3) wrote :

Sorry about that, I had to re-apply the changes I pushed to trunk accidentally and reverted. The diff in this merge request should look good once Launchpad finally finishes updating the diff. Again, sorry for all the noise :)

review: Needs Resubmitting
Revision history for this message
Marc Tardif (cr3) wrote :

For your reassurance, even though this merge request is for the trunk of the project which uses Python3, the same changes could be ported back to Precise which uses Python2. We're actually working on an SRU for Precise this iteration so the timing is perfect. You could then have a tarball with the fix shortly.

Revision history for this message
Kevin McDermott (bigkevmcd) wrote :

Thanks for the fix...

Looks good to me, running it yields one error (but this is not related to this branch AFAICT)

...
creating /home/kevin/.virtualenvs/cr3/lib/checkbox
creating /home/kevin/.virtualenvs/cr3/lib/checkbox/qt
copying qt/checkbox-qt.ui -> /home/kevin/.virtualenvs/cr3/lib/checkbox/qt/
error: can't copy 'qt/frontend/checkbox-qt-service': doesn't exist or not a regular file

+1 from me

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2012-09-12 19:03:54 +0000
3+++ debian/changelog 2012-09-12 19:14:20 +0000
4@@ -50,6 +50,8 @@
5 * patch/0.14.2: Fixed patch to rmtree instead of rmdir scripts directory.
6 * [FEATURE] debian/checkbox.templates, debian/checkbox.config: Added support to
7 preseed properties in environment_info plugin.
8+ * setup.py: Fixed required dependency on distutils-extra by providing
9+ fake implementations of build_i18n and build_icons (LP #1049218)
10
11 [Sean Feole]
12 * [FEATURE] scripts/battery_test: measures battery capacity before and after
13
14=== modified file 'setup.py'
15--- setup.py 2012-09-12 19:03:54 +0000
16+++ setup.py 2012-09-12 19:14:20 +0000
17@@ -15,21 +15,44 @@
18 from distutils.command.install import install
19 from distutils.command.install_data import install_data
20 from distutils.command.install_scripts import install_scripts
21-from DistUtilsExtra.command.build_extra import build_extra
22-from DistUtilsExtra.command.build_i18n import build_i18n
23-from DistUtilsExtra.command.build_icons import build_icons
24+try:
25+ from DistUtilsExtra.command.build_extra import build_extra
26+ from DistUtilsExtra.command.build_i18n import build_i18n
27+ from DistUtilsExtra.command.build_icons import build_icons
28+except ImportError:
29+ from distutils.cmd import Command
30+
31+ class build_extra(build):
32+ """Adds fake support for i18n and icons to the build target."""
33+ def __init__(self, dist):
34+ build.__init__(self, dist)
35+ self.user_options.extend([("i18n", None, "use the localisation"),
36+ ("icons", None, "use icons"),
37+ ])
38+
39+ def initialize_options(self):
40+ build.initialize_options(self)
41+ self.i18n = False
42+ self.icons = False
43+
44+ class build_i18n(Command):
45+ """Placeholder concrete class for fake i18n support."""
46+
47+ class build_icons(Command):
48+ """Placeholder concrete class for fake icons support."""
49
50
51 def changelog_version(changelog="debian/changelog"):
52 version = "dev"
53 if posixpath.exists(changelog):
54- head=open(changelog).readline()
55+ head = open(changelog).readline()
56 match = re.compile(".*\((.*)\).*").match(head)
57 if match:
58 version = match.group(1)
59
60 return version
61
62+
63 def expand_data_files(data_files):
64 for f in data_files:
65 if type(f) != str:
66@@ -45,6 +68,7 @@
67
68 return data_files
69
70+
71 def extract_sources_from_data_files(data_files):
72 all_sources = []
73 data_files = expand_data_files(data_files)
74@@ -53,10 +77,12 @@
75
76 return all_sources
77
78+
79 def extract_executables_from_data_files(data_files):
80 sources = extract_sources_from_data_files(data_files)
81 return [os.path.splitext(s)[0] for s in sources]
82
83+
84 def substitute_variables(infile, outfile, variables={}):
85 file_in = open(infile, "r")
86 file_out = open(outfile, "w")
87@@ -86,7 +112,8 @@
88 cc = new_compiler()
89 for source in self.sources:
90 executable = os.path.splitext(source)[0]
91- cc.link_executable([source], executable, libraries=["rt", "pthread"])
92+ cc.link_executable(
93+ [source], executable, libraries=["rt", "pthread"])
94
95
96 class checkbox_clean(clean, object):
97@@ -202,26 +229,29 @@
98
99
100 setup(
101- name = "checkbox",
102- version = changelog_version(),
103- author = "Marc Tardif",
104- author_email = "marc.tardif@canonical.com",
105- license = "GPL",
106- description = "Checkbox System Testing",
107- long_description = """
108+ name="checkbox",
109+ version=changelog_version(),
110+ author="Marc Tardif",
111+ author_email="marc.tardif@canonical.com",
112+ license="GPL",
113+ description="Checkbox System Testing",
114+ long_description="""
115 This project provides an extensible interface for system testing.
116 """,
117- data_files = [
118- ("lib/checkbox/qt/", ["qt/checkbox-qt.ui", "qt/*.png", "qt/frontend/checkbox-qt-service"]),
119+ data_files=[
120+ ("lib/checkbox/qt/",
121+ ["qt/checkbox-qt.ui", "qt/*.png",
122+ "qt/frontend/checkbox-qt-service"]),
123 ("share/checkbox/", ["backend", "run"]),
124- ("share/checkbox/data/audio/", ["data/audio/*"]),
125- ("share/checkbox/data/documents/", ["data/documents/*"]),
126- ("share/checkbox/data/images/", ["data/images/*.*"]),
127- ("share/checkbox/data/images/oem-config", ["data/images/oem-config/*"]),
128- ("share/checkbox/data/video/", ["data/video/*"]),
129- ("share/checkbox/data/settings/", ["data/settings/*"]),
130- ("share/checkbox/data/websites/", ["data/websites/*"]),
131- ("share/checkbox/data/whitelists/", ["data/whitelists/*"]),
132+ ("share/checkbox/data/audio/", ["data/audio/*"]),
133+ ("share/checkbox/data/documents/", ["data/documents/*"]),
134+ ("share/checkbox/data/images/", ["data/images/*.*"]),
135+ ("share/checkbox/data/images/oem-config",
136+ ["data/images/oem-config/*"]),
137+ ("share/checkbox/data/video/", ["data/video/*"]),
138+ ("share/checkbox/data/settings/", ["data/settings/*"]),
139+ ("share/checkbox/data/websites/", ["data/websites/*"]),
140+ ("share/checkbox/data/whitelists/", ["data/whitelists/*"]),
141 ("share/checkbox/examples/", ["examples/*"]),
142 ("share/checkbox/install/", ["install/*"]),
143 ("share/checkbox/patches/", ["patches/*"]),
144@@ -233,12 +263,14 @@
145 ("share/dbus-1/services/", ["qt/com.canonical.QtCheckbox.service"]),
146 ("share/apport/package-hooks/", ["apport/source_checkbox.py"]),
147 ("share/apport/general-hooks/", ["apport/checkbox.py"])],
148- scripts = ["bin/checkbox-cli", "bin/checkbox-gtk", "bin/checkbox-urwid", "bin/checkbox-qt"],
149- packages = ["checkbox", "checkbox.contrib", "checkbox.lib", "checkbox.parsers",
150- "checkbox.reports", "checkbox_cli", "checkbox_gtk", "checkbox_urwid", "checkbox_qt"],
151- package_data = {
152+ scripts=["bin/checkbox-cli", "bin/checkbox-gtk",
153+ "bin/checkbox-urwid", "bin/checkbox-qt"],
154+ packages=["checkbox", "checkbox.contrib", "checkbox.lib",
155+ "checkbox.parsers", "checkbox.reports", "checkbox_cli",
156+ "checkbox_gtk", "checkbox_urwid", "checkbox_qt"],
157+ package_data={
158 "": ["cputable"]},
159- cmdclass = {
160+ cmdclass={
161 "build": checkbox_build,
162 "build_i18n": build_i18n,
163 "build_icons": checkbox_build_icons,

Subscribers

People subscribed via source and target branches