Merge ~cjwatson/launchpad:lazr.restful-1.0.0 into launchpad:master

Proposed by Colin Watson
Status: Merged
Approved by: Colin Watson
Approved revision: 4cb2ac53119765df5d8c7626bd6cff90bc46cd2b
Merge reported by: Otto Co-Pilot
Merged at revision: not available
Proposed branch: ~cjwatson/launchpad:lazr.restful-1.0.0
Merge into: launchpad:master
Diff against target: 129 lines (+18/-12)
4 files modified
lib/lp/bugs/stories/webservice/xx-bug.txt (+1/-1)
lib/lp/registry/stories/webservice/xx-distroseries.txt (+3/-4)
lib/lp/registry/stories/webservice/xx-project-registry.txt (+10/-6)
requirements/launchpad.txt (+4/-1)
Reviewer Review Type Date Requested Status
Cristian Gonzalez (community) Approve
Review via email: mp+396668@code.launchpad.net

Commit message

Upgrade to lazr.restful 1.0.0 and zope.publisher 6.0.0

Description of the change

This adds Python 3 support for Launchpad's webservice infrastructure.

Dependencies MP: https://code.launchpad.net/~cjwatson/lp-source-dependencies/+git/lp-source-dependencies/+merge/396666

To post a comment you must log in.
Revision history for this message
Cristian Gonzalez (cristiangsp) wrote :

Looks good!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/lib/lp/bugs/stories/webservice/xx-bug.txt b/lib/lp/bugs/stories/webservice/xx-bug.txt
2index 66250c7..c0c7242 100644
3--- a/lib/lp/bugs/stories/webservice/xx-bug.txt
4+++ b/lib/lp/bugs/stories/webservice/xx-bug.txt
5@@ -1198,7 +1198,7 @@ renamed bug tracker.
6 >>> pprint_entry(bug_tracker)
7 active: True
8 base_url: 'http://bugs.example.com/'
9- base_url_aliases: [u'http://bugs.example.com/bugs/', u'http://www.example.com/bugtracker/']
10+ base_url_aliases: ['http://bugs.example.com/bugs/', 'http://www.example.com/bugtracker/']
11 bug_tracker_type: 'Bugzilla'
12 contact_details: 'bob@example.com'
13 has_lp_plugin: None
14diff --git a/lib/lp/registry/stories/webservice/xx-distroseries.txt b/lib/lp/registry/stories/webservice/xx-distroseries.txt
15index e6ad345..8cf223f 100644
16--- a/lib/lp/registry/stories/webservice/xx-distroseries.txt
17+++ b/lib/lp/registry/stories/webservice/xx-distroseries.txt
18@@ -66,7 +66,7 @@ For distroseries we publish a subset of its attributes.
19 bug_reported_acknowledgement: None
20 bug_reporting_guidelines: None
21 changeslist: 'hoary-changes@ubuntu.com'
22- component_names: [u'main', u'restricted']
23+ component_names: ['main', 'restricted']
24 date_created: '2006-10-16T18:31:43.483559+00:00'
25 datereleased: None
26 description: 'Hoary is the ...
27@@ -76,7 +76,7 @@ For distroseries we publish a subset of its attributes.
28 drivers_collection_link: 'http://.../ubuntu/hoary/drivers'
29 fullseriesname: 'Ubuntu Hoary'
30 include_long_descriptions: True
31- index_compressors: [u'gzip', u'bzip2']
32+ index_compressors: ['gzip', 'bzip2']
33 language_pack_full_export_requested: False
34 main_archive_link: 'http://.../ubuntu/+archive/primary'
35 name: 'hoary'
36@@ -89,8 +89,7 @@ For distroseries we publish a subset of its attributes.
37 resource_type_link: ...
38 self_link: 'http://.../ubuntu/hoary'
39 status: 'Active Development'
40- suite_names:
41- [u'Release', u'Security', u'Updates', u'Proposed', u'Backports']
42+ suite_names: ['Release', 'Security', 'Updates', 'Proposed', 'Backports']
43 summary: 'Hoary is the ...
44 supported: False
45 title: 'The Hoary Hedgehog Release'
46diff --git a/lib/lp/registry/stories/webservice/xx-project-registry.txt b/lib/lp/registry/stories/webservice/xx-project-registry.txt
47index c92b677..4b2a349 100644
48--- a/lib/lp/registry/stories/webservice/xx-project-registry.txt
49+++ b/lib/lp/registry/stories/webservice/xx-project-registry.txt
50@@ -174,7 +174,7 @@ Projects are available at their canonical URL on the API virtual host.
51 is_permitted: True
52 license_approved: False
53 license_info: None
54- licenses: [u'MIT / X / Expat Licence']
55+ licenses: ['MIT / X / Expat Licence']
56 logo_link: 'http://.../firefox/logo'
57 name: 'firefox'
58 official_answers: True
59@@ -1021,14 +1021,16 @@ Project release files
60 Project release files can be added to a project release using the API
61 'add_file' method.
62
63+ >>> import io
64+
65 >>> files_url = '/firefox/1.0/1.0.0/files'
66 >>> ff_100_files = webservice.get(files_url).jsonBody()
67 >>> print_self_link_of_entries(ff_100_files)
68
69 >>> pr_url = '/firefox/1.0/1.0.0'
70 >>> ff_100 = webservice.get(pr_url).jsonBody()
71- >>> file_content=b"first attachment file content \xff"
72- >>> sig_file_content=b"hash hash hash \xff"
73+ >>> file_content=io.BytesIO(b"first attachment file content \xff")
74+ >>> sig_file_content=io.BytesIO(b"hash hash hash \xff")
75 >>> response = webservice.named_post(ff_100['self_link'], 'add_file',
76 ... filename='filename.txt',
77 ... file_content=file_content,
78@@ -1058,16 +1060,18 @@ And it has been uploaded correctly.
79 >>> login('bac@canonical.com')
80 >>> concrete_one_zero = getUtility(IProductSet)['firefox'].getRelease(
81 ... '1.0.0')
82- >>> concrete_one_zero.files[0].libraryfile.read() == file_content
83+ >>> concrete_one_zero.files[0].libraryfile.read() == (
84+ ... file_content.getvalue())
85 True
86- >>> concrete_one_zero.files[0].signature.read() == sig_file_content
87+ >>> concrete_one_zero.files[0].signature.read() == (
88+ ... sig_file_content.getvalue())
89 True
90 >>> logout()
91
92 The file type and description are optional. If no signature is
93 available then it must be explicitly set to None.
94
95- >>> file_content=b"second attachment file content"
96+ >>> file_content=io.BytesIO(b"second attachment file content")
97 >>> response = webservice.named_post(ff_100['self_link'], 'add_file',
98 ... filename='filename2.txt',
99 ... file_content=file_content,
100diff --git a/requirements/launchpad.txt b/requirements/launchpad.txt
101index 2f43397..215976c 100644
102--- a/requirements/launchpad.txt
103+++ b/requirements/launchpad.txt
104@@ -68,7 +68,7 @@ lazr.delegates==2.0.4
105 lazr.enum==1.2
106 lazr.jobrunner==0.16
107 lazr.lifecycle==1.2
108-lazr.restful==0.23.0
109+lazr.restful==1.0.0
110 lazr.restfulclient==0.14.3
111 lazr.sshserver==0.1.11
112 lazr.uri==1.0.5
113@@ -83,6 +83,8 @@ mistune==0.8.3
114 mock==1.0.1
115 mocker==1.1.1
116 monotonic==1.5
117+multipart==0.1.1; python_version < "3"
118+multipart==0.2.3; python_version >= "3"
119 netaddr==0.7.19
120 oauth==1.0
121 oauthlib==3.1.0
122@@ -177,6 +179,7 @@ zope.app.publication==4.3.1
123 zope.app.publisher==4.2.0
124 zope.app.server==4.0.0
125 zope.app.wsgi==4.3.0
126+zope.publisher==6.0.0
127 zope.sendmail==5.1
128 zope.server==4.0.2
129 # lp:~launchpad-committers/zope.session:launchpad

Subscribers

People subscribed via source and target branches

to status/vote changes: