Merge lp:~elopio/cloudspacesclient/tox into lp:cloudspacesclient

Proposed by Leo Arias
Status: Merged
Merged at revision: 46
Proposed branch: lp:~elopio/cloudspacesclient/tox
Merge into: lp:cloudspacesclient
Prerequisite: lp:~elopio/cloudspacesclient/get_file_metadata
Diff against target: 224 lines (+146/-14)
8 files modified
.bzrignore (+1/-0)
README (+17/-0)
requirements.txt (+2/-1)
setup.py (+51/-0)
src/cloudspacesclient/config/__init__.py (+8/-7)
src/cloudspacesclient/config/sample.conf (+9/-6)
src/cloudspacesclient/config/schema.py (+33/-0)
tox.ini (+25/-0)
To merge this branch: bzr merge lp:~elopio/cloudspacesclient/tox
Reviewer Review Type Date Requested Status
Richard Huddie (community) Approve
Review via email: mp+198144@code.launchpad.net

Commit message

Added the tox environment manager.

Description of the change

Changed configparser to configglue because it has a problem with virtualenv.

To post a comment you must log in.
lp:~elopio/cloudspacesclient/tox updated
50. By Leo Arias

Reverted the requirements, added setup.py.

51. By Leo Arias

Changed the requirement to configglue.

52. By Leo Arias

Remove extra space.

Revision history for this message
Richard Huddie (rhuddie) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added file '.bzrignore'
2--- .bzrignore 1970-01-01 00:00:00 +0000
3+++ .bzrignore 2013-12-07 06:24:24 +0000
4@@ -0,0 +1,1 @@
5+src/cloudspacesclient/config/local.conf
6
7=== added file 'README'
8--- README 1970-01-01 00:00:00 +0000
9+++ README 2013-12-07 06:24:24 +0000
10@@ -0,0 +1,17 @@
11+Conformance tests for servers implementing the Cloudspaces API.
12+
13+Requirements:
14+
15+ python 3.3
16+ tox >= 1.6.1
17+
18+Configure:
19+
20+ Create a file in src/cloudspacesclient/config/local.conf
21+ You can see the expected config options and sample values in
22+ src/cloudspacesclient/config/sample.conf
23+
24+Run the tests:
25+
26+ Run tox on the top-level directory:
27+ $ tox
28
29=== modified file 'requirements.txt'
30--- requirements.txt 2013-11-21 15:16:25 +0000
31+++ requirements.txt 2013-12-07 06:24:24 +0000
32@@ -1,7 +1,8 @@
33-configparser
34+configglue
35 requests
36 requests-oauthlib
37 ssoclient
38+bzr+http://bazaar.launchpad.net/~chipaca/+junk/cloudspacer
39
40 # For tests.
41 dateutil
42
43=== added file 'setup.py'
44--- setup.py 1970-01-01 00:00:00 +0000
45+++ setup.py 2013-12-07 06:24:24 +0000
46@@ -0,0 +1,51 @@
47+# Copyright (C) 2013 Canonical Ltd.
48+#
49+# This file is part of cloudspacesclient.
50+#
51+# cloudspacesclient is free software: you can redistribute it and/or modify
52+# it under the terms of the GNU General Public License as published by
53+# the Free Software Foundation, either version 3 of the License, or
54+# (at your option) any later version.
55+#
56+# cloudspacesclient is distributed in the hope that it will be useful,
57+# but WITHOUT ANY WARRANTY; without even the implied warranty of
58+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
59+# GNU General Public License for more details.
60+#
61+# You should have received a copy of the GNU General Public License
62+# along with cloudspacesclient. If not, see <http://www.gnu.org/licenses/>.
63+
64+import setuptools
65+
66+
67+VERSION = 0.1
68+
69+
70+setuptools.setup(
71+ name='cloudspacesprotocol',
72+ version=VERSION,
73+
74+ author='Ubuntu One Hackers',
75+ author_email='onlineservices@lists.launchpad.net',
76+ license='GPLv3+',
77+
78+ package_dir={'': 'src',},
79+ packages=setuptools.find_packages(),
80+ dependency_links=[
81+ 'bzr+http://bazaar.launchpad.net/~chipaca/+junk/cloudspacer'
82+ ],
83+ install_requires=[
84+ 'cloudspacer',
85+ 'configglue',
86+ 'requests',
87+ 'requests-oauthlib',
88+ 'ssoclient'
89+ ],
90+ tests_require=[
91+ 'python-dateutil',
92+ 'mock',
93+ 'testscenarios',
94+ 'validictory'
95+ ],
96+ test_suite='cloudspacesclient'
97+)
98
99=== modified file 'src/cloudspacesclient/config/__init__.py'
100--- src/cloudspacesclient/config/__init__.py 2013-11-19 06:58:43 +0000
101+++ src/cloudspacesclient/config/__init__.py 2013-12-07 06:24:24 +0000
102@@ -17,10 +17,12 @@
103
104 import os
105
106-import configparser
107-
108-
109-CONFIG_FILE = 'cloudspaces.conf'
110+from configglue import glue
111+
112+from cloudspacesclient.config import schema
113+
114+
115+CONFIG_FILE = 'local.conf'
116
117
118 def get_config_file():
119@@ -28,9 +30,8 @@
120 return os.path.join(config_dir, CONFIG_FILE)
121
122
123-_config = configparser.ConfigParser()
124-_config.read(get_config_file())
125+_glue = glue.configglue(schema.CloudspacesSchema, get_config_file())
126
127
128 def get(section, option):
129- return _config.get(section, option)
130+ return _glue.schema_parser.get(section, option)
131
132=== renamed file 'src/cloudspacesclient/config/cloudspaces.conf' => 'src/cloudspacesclient/config/sample.conf'
133--- src/cloudspacesclient/config/cloudspaces.conf 2013-12-05 23:30:32 +0000
134+++ src/cloudspacesclient/config/sample.conf 2013-12-07 06:24:24 +0000
135@@ -1,12 +1,15 @@
136 [cloudspaces]
137-#cloudspaces_server_url = http://u1.local:8003
138-cloudspaces_server_url = http://u1-precise:38096
139+cloudspaces_server_url = http://u1.local:8003
140 cloudspaces_server_adapter = cloudspacesclient.ubuntuone.UbuntuOneServer
141+# Use the existing user adapter if you can't create a new user for every test.
142+# cloudspaces_server_adapter = cloudspacesclient.ubuntuone.UbuntuOneServerWithExistingUser
143
144 [ubuntuone]
145 sso_server_url = http://sso.local:8001
146-#sso_server_url = http://u1-precise.local:8001
147-#sso_server_url = https://login.staging.ubuntu.com
148 ubuntuone_server_url = http://u1.local:8003
149-#ubuntuone_server_url = http://u1-precise.local:8003
150-#ubuntuone_server_url = https://staging.one.ubuntu.com
151+# Set the oauth values if you are testing the Ubuntu One server with an
152+# existing user.
153+# token_key =
154+# token_secret =
155+# consumer_key =
156+# consumer_secret =
157
158=== added file 'src/cloudspacesclient/config/schema.py'
159--- src/cloudspacesclient/config/schema.py 1970-01-01 00:00:00 +0000
160+++ src/cloudspacesclient/config/schema.py 2013-12-07 06:24:24 +0000
161@@ -0,0 +1,33 @@
162+# Copyright (C) 2013 Canonical Ltd.
163+#
164+# This file is part of cloudspacesclient.
165+#
166+# cloudspacesclient is free software: you can redistribute it and/or modify
167+# it under the terms of the GNU General Public License as published by
168+# the Free Software Foundation, either version 3 of the License, or
169+# (at your option) any later version.
170+#
171+# cloudspacesclient is distributed in the hope that it will be useful,
172+# but WITHOUT ANY WARRANTY; without even the implied warranty of
173+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
174+# GNU General Public License for more details.
175+#
176+# You should have received a copy of the GNU General Public License
177+# along with cloudspacesclient. If not, see <http://www.gnu.org/licenses/>.
178+
179+from configglue import schema
180+
181+
182+class CloudspacesSchema(schema.Schema):
183+
184+ class cloudspaces(schema.Section):
185+ cloudspaces_server_url = schema.StringOption(default=None)
186+ cloudspaces_server_adapter = schema.StringOption(default=None)
187+
188+ class ubuntuone(schema.Section):
189+ sso_server_url = schema.StringOption(default=None)
190+ ubuntuone_server_url = schema.StringOption(default=None)
191+ token_key = schema.StringOption(default=None)
192+ token_secret = schema.StringOption(default=None)
193+ consumer_key = schema.StringOption(default=None)
194+ consumer_secret = schema.StringOption(default=None)
195
196=== added file 'tox.ini'
197--- tox.ini 1970-01-01 00:00:00 +0000
198+++ tox.ini 2013-12-07 06:24:24 +0000
199@@ -0,0 +1,25 @@
200+# Copyright (C) 2013 Canonical Ltd.
201+#
202+# This file is part of cloudspacesclient.
203+#
204+# cloudspacesclient is free software: you can redistribute it and/or modify
205+# it under the terms of the GNU General Public License as published by
206+# the Free Software Foundation, either version 3 of the License, or
207+# (at your option) any later version.
208+#
209+# cloudspacesclient is distributed in the hope that it will be useful,
210+# but WITHOUT ANY WARRANTY; without even the implied warranty of
211+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
212+# GNU General Public License for more details.
213+#
214+# You should have received a copy of the GNU General Public License
215+# along with cloudspacesclient. If not, see <http://www.gnu.org/licenses/>.
216+
217+[tox]
218+envlist = py33
219+
220+[testenv]
221+deps = -rrequirements.txt
222+commands =
223+ {envpython} setup.py install
224+ {envpython} setup.py test

Subscribers

People subscribed via source and target branches

to all changes: