Merge lp:~gary/lazr.delegates/build-license-changes into lp:~launchpad-pqm/lazr.delegates/devel
- build-license-changes
- Merge into devel
Proposed by
Gary Poster
Status: | Merged |
---|---|
Approved by: | Francis J. Lacoste |
Approved revision: | 4 |
Merged at revision: | not available |
Proposed branch: | lp:~gary/lazr.delegates/build-license-changes |
Merge into: | lp:~launchpad-pqm/lazr.delegates/devel |
Diff against target: | None lines |
To merge this branch: | bzr merge lp:~gary/lazr.delegates/build-license-changes |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Francis J. Lacoste (community) | Approve | ||
Review via email: mp+4856@code.launchpad.net |
Commit message
Description of the change
To post a comment you must log in.
Revision history for this message
Gary Poster (gary) wrote : | # |
Revision history for this message
Francis J. Lacoste (flacoste) wrote : | # |
On March 24, 2009, Gary Poster wrote:
> Gary Poster has proposed merging
> lp:~gary/lazr.delegates/build-license-changes into lp:lazr.delegates.
>
> Requested reviews:
> LAZR Developers (lazr-developers)
>
> The same changes as for the other lazr packages:
>
> - license specifies v3 of LGPL
>
> - buildout updates
>
status approved
review approve
Nothing to say here.
--
Francis J. Lacoste
<email address hidden>
review:
Approve
- 5. By Gary Poster
-
1.0.1
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file '.bzrignore' |
2 | --- .bzrignore 2008-12-15 22:21:53 +0000 |
3 | +++ .bzrignore 2009-03-24 18:52:52 +0000 |
4 | @@ -1,8 +1,11 @@ |
5 | -TEST_THIS_REST_BEFORE_REGISTERING.txt |
6 | bin |
7 | develop-eggs |
8 | -eggs |
9 | +.installed.cfg |
10 | +develop-eggs |
11 | parts |
12 | -src/*.egg-info |
13 | -.installed.cfg |
14 | +*.egg-info |
15 | +tags |
16 | +TAGS |
17 | +build |
18 | +*.egg |
19 | dist |
20 | |
21 | === modified file 'CHANGES.txt' |
22 | --- CHANGES.txt 2008-12-15 22:21:53 +0000 |
23 | +++ CHANGES.txt 2009-03-24 18:56:04 +0000 |
24 | @@ -1,1 +1,16 @@ |
25 | Please see CHANGES.txt in the package. |
26 | + |
27 | +.. |
28 | + This file is part of lazr.delegates. |
29 | + |
30 | + lazr.delegates is free software: you can redistribute it and/or modify it |
31 | + under the terms of the GNU Lesser General Public License as published by |
32 | + the Free Software Foundation, version 3 of the License. |
33 | + |
34 | + lazr.delegates is distributed in the hope that it will be useful, but |
35 | + WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY |
36 | + or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public |
37 | + License for more details. |
38 | + |
39 | + You should have received a copy of the GNU Lesser General Public License |
40 | + along with lazr.delegates. If not, see <http://www.gnu.org/licenses/>. |
41 | |
42 | === renamed file 'DEVELOP.txt' => 'HACKING.txt' |
43 | --- DEVELOP.txt 2008-12-15 22:21:53 +0000 |
44 | +++ HACKING.txt 2009-03-24 19:51:29 +0000 |
45 | @@ -1,59 +1,41 @@ |
46 | +.. |
47 | + This file is part of lazr.delegates. |
48 | + |
49 | + lazr.delegates is free software: you can redistribute it and/or modify it |
50 | + under the terms of the GNU Lesser General Public License as published by |
51 | + the Free Software Foundation, version 3 of the License. |
52 | + |
53 | + lazr.delegates is distributed in the hope that it will be useful, but |
54 | + WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY |
55 | + or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public |
56 | + License for more details. |
57 | + |
58 | + You should have received a copy of the GNU Lesser General Public License |
59 | + along with lazr.delegates. If not, see <http://www.gnu.org/licenses/>. |
60 | + |
61 | This project uses zc.buildout for development. |
62 | |
63 | -To develop or run tests, first run ``$DESIRED_PYTHON bootstrap.py`` in this |
64 | -directory, where you replace ``$DESIRED_PYTHON`` with the python that should |
65 | -be used to build and run this project. A non-system Python is highly |
66 | -recommended, but not required. |
67 | - |
68 | -Then run ``./bin/buildout``. (NOTE: Ubuntu Intrepid users, see bottom of this |
69 | -document if this generates errors.) |
70 | - |
71 | -You can now run tests with ``./bin/test``. Use ``./bin/test --help`` to read |
72 | -about the many options. |
73 | - |
74 | -To gain access to a Python interpreter with the package and its dependent eggs |
75 | -available, use ``./bin/py``. |
76 | - |
77 | -You can generate ctags and idutils files for a variety of editors using |
78 | -``./bin/tags`` (see ``./bin/tags --help``). The advantage of the files |
79 | -generated from this utility is that they include the sourcecode from the eggs |
80 | -used in this buildout. |
81 | - |
82 | -To generate distributions, use ``./bin/buildout setup . SETUP_CMD [...]``. |
83 | -That is, you can use ``./bin/buildout setup .`` as if it were |
84 | -``python setup.py``. The intended advantage is easy access to a pristine, |
85 | -local version of setuptools. |
86 | - |
87 | -Every project using zc.buildout will keep its own collection of eggs by |
88 | -default. You may want to cache these eggs, and their downloaded |
89 | -distributions, globally. To do so, perform the following instructions. |
90 | - |
91 | -- ``mkdir -p ~/.buildout/eggs`` |
92 | -- ``mkdir ~/.buildout/download-cache`` |
93 | -- Create ``~/.buildout/default.cfg`` with the following content, replacing |
94 | - "$HOME" with the path to your home:: |
95 | - |
96 | - [buildout] |
97 | - eggs-directory=$HOME/.buildout/eggs |
98 | - download-cache=$HOME/.buildout/download-cache |
99 | - |
100 | -Ubunutu Intrepid Problem |
101 | -======================== |
102 | - |
103 | -Intrepid has a bug working with buildout. You may have to hack to fix it. |
104 | -Here's an example of the Python 2.4 version of the hack. |
105 | - |
106 | -$ sudo rm /usr/lib/python2.4/site-packages/GMenuSimpleEditor/*.py |
107 | -$ sudo ln |
108 | --s /var/lib/python-support/python2.4/GMenuSimpleEditor/*.py /usr/lib/python2.4/site-packages/GMenuSimpleEditor/ |
109 | - |
110 | -Python 2.5 would need the same kind of fix (replace all three instances of |
111 | -"python2.4" with "python2.5" in the above). |
112 | - |
113 | -The author of this document tried an Intrepid upgrade and an aptitude |
114 | -reinstall of python-gmenu to no avail before doing the rough-and-tumble change |
115 | -described above. |
116 | - |
117 | -See |
118 | -https://bugs.edge.launchpad.net/ubuntu/+source/gnome-menus/+bug/301571 and the |
119 | -bug linked to it by datakid. |
120 | +============ |
121 | +Introduction |
122 | +============ |
123 | + |
124 | +These are guidelines for hacking on the lazr.delegates project. But first, |
125 | +please see the common hacking guidelines at: |
126 | + |
127 | + http://dev.launchpad.net/Hacking |
128 | + |
129 | + |
130 | +Getting help |
131 | +------------ |
132 | + |
133 | +If you find bugs in this package, you can report them here: |
134 | + |
135 | + https://launchpad.net/lazr.delegates |
136 | + |
137 | +If you want to discuss this package, join the team and mailing list here: |
138 | + |
139 | + https://launchpad.net/~lazr-developers |
140 | + |
141 | +or send a message to: |
142 | + |
143 | + lazr-developers@lists.launchpad.net |
144 | |
145 | === modified file 'MANIFEST.in' |
146 | --- MANIFEST.in 2008-12-15 22:21:53 +0000 |
147 | +++ MANIFEST.in 2009-03-24 18:52:52 +0000 |
148 | @@ -1,2 +1,2 @@ |
149 | -include *.txt MANIFEST.in |
150 | -recursive-include src *.txt *.py |
151 | +exclude MANIFEST.in buildout.cfg bootstrap.py .bzrignore |
152 | +prune _bootstrap |
153 | |
154 | === modified file 'README.txt' |
155 | --- README.txt 2008-12-15 22:21:53 +0000 |
156 | +++ README.txt 2009-03-24 19:51:29 +0000 |
157 | @@ -1,1 +1,16 @@ |
158 | Easily write objects that delegate behavior. |
159 | + |
160 | +.. |
161 | + This file is part of lazr.delegates. |
162 | + |
163 | + lazr.delegates is free software: you can redistribute it and/or modify it |
164 | + under the terms of the GNU Lesser General Public License as published by |
165 | + the Free Software Foundation, version 3 of the License. |
166 | + |
167 | + lazr.delegates is distributed in the hope that it will be useful, but |
168 | + WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY |
169 | + or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public |
170 | + License for more details. |
171 | + |
172 | + You should have received a copy of the GNU Lesser General Public License |
173 | + along with lazr.delegates. If not, see <http://www.gnu.org/licenses/>. |
174 | |
175 | === added directory '_bootstrap' |
176 | === added file '_bootstrap/COPYRIGHT.txt' |
177 | --- _bootstrap/COPYRIGHT.txt 1970-01-01 00:00:00 +0000 |
178 | +++ _bootstrap/COPYRIGHT.txt 2009-03-24 18:52:52 +0000 |
179 | @@ -0,0 +1,9 @@ |
180 | +Copyright (c) 2004-2009 Zope Corporation and Contributors. |
181 | +All Rights Reserved. |
182 | + |
183 | +This software is subject to the provisions of the Zope Public License, |
184 | +Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. |
185 | +THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED |
186 | +WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
187 | +WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS |
188 | +FOR A PARTICULAR PURPOSE. |
189 | |
190 | === added file '_bootstrap/LICENSE.txt' |
191 | --- _bootstrap/LICENSE.txt 1970-01-01 00:00:00 +0000 |
192 | +++ _bootstrap/LICENSE.txt 2009-03-24 18:52:52 +0000 |
193 | @@ -0,0 +1,54 @@ |
194 | +Zope Public License (ZPL) Version 2.1 |
195 | +------------------------------------- |
196 | + |
197 | +A copyright notice accompanies this license document that |
198 | +identifies the copyright holders. |
199 | + |
200 | +This license has been certified as open source. It has also |
201 | +been designated as GPL compatible by the Free Software |
202 | +Foundation (FSF). |
203 | + |
204 | +Redistribution and use in source and binary forms, with or |
205 | +without modification, are permitted provided that the |
206 | +following conditions are met: |
207 | + |
208 | +1. Redistributions in source code must retain the |
209 | + accompanying copyright notice, this list of conditions, |
210 | + and the following disclaimer. |
211 | + |
212 | +2. Redistributions in binary form must reproduce the accompanying |
213 | + copyright notice, this list of conditions, and the |
214 | + following disclaimer in the documentation and/or other |
215 | + materials provided with the distribution. |
216 | + |
217 | +3. Names of the copyright holders must not be used to |
218 | + endorse or promote products derived from this software |
219 | + without prior written permission from the copyright |
220 | + holders. |
221 | + |
222 | +4. The right to distribute this software or to use it for |
223 | + any purpose does not give you the right to use |
224 | + Servicemarks (sm) or Trademarks (tm) of the copyright |
225 | + holders. Use of them is covered by separate agreement |
226 | + with the copyright holders. |
227 | + |
228 | +5. If any files are modified, you must cause the modified |
229 | + files to carry prominent notices stating that you changed |
230 | + the files and the date of any change. |
231 | + |
232 | +Disclaimer |
233 | + |
234 | + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' |
235 | + AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT |
236 | + NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY |
237 | + AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN |
238 | + NO EVENT SHALL THE COPYRIGHT HOLDERS BE |
239 | + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, |
240 | + EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
241 | + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
242 | + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) |
243 | + HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
244 | + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE |
245 | + OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
246 | + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH |
247 | + DAMAGE. |
248 | \ No newline at end of file |
249 | |
250 | === renamed file 'bootstrap.py' => '_bootstrap/bootstrap.py' |
251 | === added symlink 'bootstrap.py' |
252 | === target is '_bootstrap/bootstrap.py' |
253 | === modified file 'buildout.cfg' |
254 | --- buildout.cfg 2008-12-15 22:21:53 +0000 |
255 | +++ buildout.cfg 2009-03-24 19:51:29 +0000 |
256 | @@ -2,6 +2,7 @@ |
257 | parts = |
258 | interpreter |
259 | test |
260 | + docs |
261 | tags |
262 | unzip = true |
263 | |
264 | @@ -10,7 +11,14 @@ |
265 | [test] |
266 | recipe = zc.recipe.testrunner |
267 | eggs = lazr.delegates |
268 | -defaults = '--tests-pattern ^tests --exit-with-status'.split() |
269 | +defaults = '--tests-pattern ^tests --exit-with-status --suite-name additional_tests'.split() |
270 | + |
271 | +[docs] |
272 | +recipe = z3c.recipe.sphinxdoc |
273 | +eggs = lazr.delegates [docs] |
274 | +index-doc = README |
275 | +default.css = |
276 | +layout.html = |
277 | |
278 | [interpreter] |
279 | recipe = zc.recipe.egg |
280 | |
281 | === added file 'ez_setup.py' |
282 | --- ez_setup.py 1970-01-01 00:00:00 +0000 |
283 | +++ ez_setup.py 2009-03-24 18:52:52 +0000 |
284 | @@ -0,0 +1,241 @@ |
285 | +#!python |
286 | +"""Bootstrap setuptools installation |
287 | + |
288 | +If you want to use setuptools in your package's setup.py, just include this |
289 | +file in the same directory with it, and add this to the top of your setup.py:: |
290 | + |
291 | + from ez_setup import use_setuptools |
292 | + use_setuptools() |
293 | + |
294 | +If you want to require a specific version of setuptools, set a download |
295 | +mirror, or use an alternate download directory, you can do so by supplying |
296 | +the appropriate options to ``use_setuptools()``. |
297 | + |
298 | +This file can also be run as a script to install or upgrade setuptools. |
299 | +""" |
300 | +import sys |
301 | +DEFAULT_VERSION = "0.6c8" |
302 | +DEFAULT_URL = "http://pypi.python.org/packages/%s/s/setuptools/" % sys.version[:3] |
303 | + |
304 | +md5_data = { |
305 | + 'setuptools-0.6b1-py2.3.egg': '8822caf901250d848b996b7f25c6e6ca', |
306 | + 'setuptools-0.6b1-py2.4.egg': 'b79a8a403e4502fbb85ee3f1941735cb', |
307 | + 'setuptools-0.6b2-py2.3.egg': '5657759d8a6d8fc44070a9d07272d99b', |
308 | + 'setuptools-0.6b2-py2.4.egg': '4996a8d169d2be661fa32a6e52e4f82a', |
309 | + 'setuptools-0.6b3-py2.3.egg': 'bb31c0fc7399a63579975cad9f5a0618', |
310 | + 'setuptools-0.6b3-py2.4.egg': '38a8c6b3d6ecd22247f179f7da669fac', |
311 | + 'setuptools-0.6b4-py2.3.egg': '62045a24ed4e1ebc77fe039aa4e6f7e5', |
312 | + 'setuptools-0.6b4-py2.4.egg': '4cb2a185d228dacffb2d17f103b3b1c4', |
313 | + 'setuptools-0.6c1-py2.3.egg': 'b3f2b5539d65cb7f74ad79127f1a908c', |
314 | + 'setuptools-0.6c1-py2.4.egg': 'b45adeda0667d2d2ffe14009364f2a4b', |
315 | + 'setuptools-0.6c2-py2.3.egg': 'f0064bf6aa2b7d0f3ba0b43f20817c27', |
316 | + 'setuptools-0.6c2-py2.4.egg': '616192eec35f47e8ea16cd6a122b7277', |
317 | + 'setuptools-0.6c3-py2.3.egg': 'f181fa125dfe85a259c9cd6f1d7b78fa', |
318 | + 'setuptools-0.6c3-py2.4.egg': 'e0ed74682c998bfb73bf803a50e7b71e', |
319 | + 'setuptools-0.6c3-py2.5.egg': 'abef16fdd61955514841c7c6bd98965e', |
320 | + 'setuptools-0.6c4-py2.3.egg': 'b0b9131acab32022bfac7f44c5d7971f', |
321 | + 'setuptools-0.6c4-py2.4.egg': '2a1f9656d4fbf3c97bf946c0a124e6e2', |
322 | + 'setuptools-0.6c4-py2.5.egg': '8f5a052e32cdb9c72bcf4b5526f28afc', |
323 | + 'setuptools-0.6c5-py2.3.egg': 'ee9fd80965da04f2f3e6b3576e9d8167', |
324 | + 'setuptools-0.6c5-py2.4.egg': 'afe2adf1c01701ee841761f5bcd8aa64', |
325 | + 'setuptools-0.6c5-py2.5.egg': 'a8d3f61494ccaa8714dfed37bccd3d5d', |
326 | + 'setuptools-0.6c6-py2.3.egg': '35686b78116a668847237b69d549ec20', |
327 | + 'setuptools-0.6c6-py2.4.egg': '3c56af57be3225019260a644430065ab', |
328 | + 'setuptools-0.6c6-py2.5.egg': 'b2f8a7520709a5b34f80946de5f02f53', |
329 | + 'setuptools-0.6c7-py2.3.egg': '209fdf9adc3a615e5115b725658e13e2', |
330 | + 'setuptools-0.6c7-py2.4.egg': '5a8f954807d46a0fb67cf1f26c55a82e', |
331 | + 'setuptools-0.6c7-py2.5.egg': '45d2ad28f9750e7434111fde831e8372', |
332 | + 'setuptools-0.6c8-py2.3.egg': '50759d29b349db8cfd807ba8303f1902', |
333 | + 'setuptools-0.6c8-py2.4.egg': 'cba38d74f7d483c06e9daa6070cce6de', |
334 | + 'setuptools-0.6c8-py2.5.egg': '1721747ee329dc150590a58b3e1ac95b', |
335 | +} |
336 | + |
337 | +import sys, os |
338 | + |
339 | +def _validate_md5(egg_name, data): |
340 | + if egg_name in md5_data: |
341 | + from md5 import md5 |
342 | + digest = md5(data).hexdigest() |
343 | + if digest != md5_data[egg_name]: |
344 | + print >>sys.stderr, ( |
345 | + "md5 validation of %s failed! (Possible download problem?)" |
346 | + % egg_name |
347 | + ) |
348 | + sys.exit(2) |
349 | + return data |
350 | + |
351 | + |
352 | +def use_setuptools( |
353 | + version=DEFAULT_VERSION, download_base=DEFAULT_URL, to_dir=os.curdir, |
354 | + download_delay=15, min_version=None |
355 | +): |
356 | + """Automatically find/download setuptools and make it available on sys.path |
357 | + |
358 | + `version` should be a valid setuptools version number that is available |
359 | + as an egg for download under the `download_base` URL (which should end with |
360 | + a '/'). `to_dir` is the directory where setuptools will be downloaded, if |
361 | + it is not already available. If `download_delay` is specified, it should |
362 | + be the number of seconds that will be paused before initiating a download, |
363 | + should one be required. If an older version of setuptools is installed, |
364 | + this routine will print a message to ``sys.stderr`` and raise SystemExit in |
365 | + an attempt to abort the calling script. |
366 | + """ |
367 | + # Work around a hack in the ez_setup.py file from simplejson==1.7.3. |
368 | + if min_version: |
369 | + version = min_version |
370 | + |
371 | + was_imported = 'pkg_resources' in sys.modules or 'setuptools' in sys.modules |
372 | + def do_download(): |
373 | + egg = download_setuptools(version, download_base, to_dir, download_delay) |
374 | + sys.path.insert(0, egg) |
375 | + import setuptools; setuptools.bootstrap_install_from = egg |
376 | + try: |
377 | + import pkg_resources |
378 | + except ImportError: |
379 | + return do_download() |
380 | + try: |
381 | + pkg_resources.require("setuptools>="+version); return |
382 | + except pkg_resources.VersionConflict, e: |
383 | + if was_imported: |
384 | + print >>sys.stderr, ( |
385 | + "The required version of setuptools (>=%s) is not available, and\n" |
386 | + "can't be installed while this script is running. Please install\n" |
387 | + " a more recent version first, using 'easy_install -U setuptools'." |
388 | + "\n\n(Currently using %r)" |
389 | + ) % (version, e.args[0]) |
390 | + sys.exit(2) |
391 | + else: |
392 | + del pkg_resources, sys.modules['pkg_resources'] # reload ok |
393 | + return do_download() |
394 | + except pkg_resources.DistributionNotFound: |
395 | + return do_download() |
396 | + |
397 | +def download_setuptools( |
398 | + version=DEFAULT_VERSION, download_base=DEFAULT_URL, to_dir=os.curdir, |
399 | + delay = 15 |
400 | +): |
401 | + """Download setuptools from a specified location and return its filename |
402 | + |
403 | + `version` should be a valid setuptools version number that is available |
404 | + as an egg for download under the `download_base` URL (which should end |
405 | + with a '/'). `to_dir` is the directory where the egg will be downloaded. |
406 | + `delay` is the number of seconds to pause before an actual download attempt. |
407 | + """ |
408 | + import urllib2, shutil |
409 | + egg_name = "setuptools-%s-py%s.egg" % (version,sys.version[:3]) |
410 | + url = download_base + egg_name |
411 | + saveto = os.path.join(to_dir, egg_name) |
412 | + src = dst = None |
413 | + if not os.path.exists(saveto): # Avoid repeated downloads |
414 | + try: |
415 | + from distutils import log |
416 | + if delay: |
417 | + log.warn(""" |
418 | +--------------------------------------------------------------------------- |
419 | +This script requires setuptools version %s to run (even to display |
420 | +help). I will attempt to download it for you (from |
421 | +%s), but |
422 | +you may need to enable firewall access for this script first. |
423 | +I will start the download in %d seconds. |
424 | + |
425 | +(Note: if this machine does not have network access, please obtain the file |
426 | + |
427 | + %s |
428 | + |
429 | +and place it in this directory before rerunning this script.) |
430 | +---------------------------------------------------------------------------""", |
431 | + version, download_base, delay, url |
432 | + ); from time import sleep; sleep(delay) |
433 | + log.warn("Downloading %s", url) |
434 | + src = urllib2.urlopen(url) |
435 | + # Read/write all in one block, so we don't create a corrupt file |
436 | + # if the download is interrupted. |
437 | + data = _validate_md5(egg_name, src.read()) |
438 | + dst = open(saveto,"wb"); dst.write(data) |
439 | + finally: |
440 | + if src: src.close() |
441 | + if dst: dst.close() |
442 | + return os.path.realpath(saveto) |
443 | + |
444 | +def main(argv, version=DEFAULT_VERSION): |
445 | + """Install or upgrade setuptools and EasyInstall""" |
446 | + try: |
447 | + import setuptools |
448 | + except ImportError: |
449 | + egg = None |
450 | + try: |
451 | + egg = download_setuptools(version, delay=0) |
452 | + sys.path.insert(0,egg) |
453 | + from setuptools.command.easy_install import main |
454 | + return main(list(argv)+[egg]) # we're done here |
455 | + finally: |
456 | + if egg and os.path.exists(egg): |
457 | + os.unlink(egg) |
458 | + else: |
459 | + if setuptools.__version__ == '0.0.1': |
460 | + print >>sys.stderr, ( |
461 | + "You have an obsolete version of setuptools installed. Please\n" |
462 | + "remove it from your system entirely before rerunning this script." |
463 | + ) |
464 | + sys.exit(2) |
465 | + |
466 | + req = "setuptools>="+version |
467 | + import pkg_resources |
468 | + try: |
469 | + pkg_resources.require(req) |
470 | + except pkg_resources.VersionConflict: |
471 | + try: |
472 | + from setuptools.command.easy_install import main |
473 | + except ImportError: |
474 | + from easy_install import main |
475 | + main(list(argv)+[download_setuptools(delay=0)]) |
476 | + sys.exit(0) # try to force an exit |
477 | + else: |
478 | + if argv: |
479 | + from setuptools.command.easy_install import main |
480 | + main(argv) |
481 | + else: |
482 | + print "Setuptools version",version,"or greater has been installed." |
483 | + print '(Run "ez_setup.py -U setuptools" to reinstall or upgrade.)' |
484 | + |
485 | +def update_md5(filenames): |
486 | + """Update our built-in md5 registry""" |
487 | + |
488 | + import re |
489 | + from md5 import md5 |
490 | + |
491 | + for name in filenames: |
492 | + base = os.path.basename(name) |
493 | + f = open(name,'rb') |
494 | + md5_data[base] = md5(f.read()).hexdigest() |
495 | + f.close() |
496 | + |
497 | + data = [" %r: %r,\n" % it for it in md5_data.items()] |
498 | + data.sort() |
499 | + repl = "".join(data) |
500 | + |
501 | + import inspect |
502 | + srcfile = inspect.getsourcefile(sys.modules[__name__]) |
503 | + f = open(srcfile, 'rb'); src = f.read(); f.close() |
504 | + |
505 | + match = re.search("\nmd5_data = {\n([^}]+)}", src) |
506 | + if not match: |
507 | + print >>sys.stderr, "Internal error!" |
508 | + sys.exit(2) |
509 | + |
510 | + src = src[:match.start(1)] + repl + src[match.end(1):] |
511 | + f = open(srcfile,'w') |
512 | + f.write(src) |
513 | + f.close() |
514 | + |
515 | + |
516 | +if __name__=='__main__': |
517 | + if len(sys.argv)>2 and sys.argv[1]=='--md5update': |
518 | + update_md5(sys.argv[2:]) |
519 | + else: |
520 | + main(sys.argv[1:]) |
521 | + |
522 | + |
523 | + |
524 | + |
525 | + |
526 | |
527 | === modified file 'setup.py' (properties changed: -x to +x) |
528 | --- setup.py 2008-12-15 22:21:53 +0000 |
529 | +++ setup.py 2009-03-24 19:51:29 +0000 |
530 | @@ -1,5 +1,25 @@ |
531 | -# Copyright 2008 Canonical Ltd. All rights reserved. |
532 | - |
533 | +#!/usr/bin/env python |
534 | + |
535 | +# Copyright 2008-2009 Canonical Ltd. All rights reserved. |
536 | +# |
537 | +# This file is part of lazr.delegates. |
538 | +# |
539 | +# lazr.delegates is free software: you can redistribute it and/or modify it |
540 | +# under the terms of the GNU Lesser General Public License as published by |
541 | +# the Free Software Foundation, version 3 of the License. |
542 | +# |
543 | +# lazr.delegates is distributed in the hope that it will be useful, but |
544 | +# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY |
545 | +# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public |
546 | +# License for more details. |
547 | +# |
548 | +# You should have received a copy of the GNU Lesser General Public License |
549 | +# along with lazr.delegates. If not, see <http://www.gnu.org/licenses/>. |
550 | + |
551 | +import ez_setup |
552 | +ez_setup.use_setuptools() |
553 | + |
554 | +import sys |
555 | from setuptools import setup, find_packages |
556 | |
557 | # generic helpers primarily for the long_description |
558 | @@ -16,9 +36,13 @@ |
559 | return '\n'.join(res) |
560 | # end generic helpers |
561 | |
562 | + |
563 | +sys.path.insert(0, 'src') |
564 | +from lazr.delegates import __version__ |
565 | + |
566 | setup( |
567 | name='lazr.delegates', |
568 | - version='1.0b1', |
569 | + version=__version__, |
570 | namespace_packages=['lazr'], |
571 | packages=find_packages('src'), |
572 | package_dir={'':'src'}, |
573 | @@ -26,7 +50,7 @@ |
574 | zip_safe=False, |
575 | maintainer='LAZR Developers', |
576 | maintainer_email='lazr-developers@lists.launchpad.net', |
577 | - description=open('README.txt').readlines()[0].strip(), |
578 | + description=open('README.txt').readline().strip(), |
579 | long_description=generate( |
580 | 'src/lazr/delegates/README.txt', |
581 | 'src/lazr/delegates/CHANGES.txt'), |
582 | @@ -36,10 +60,17 @@ |
583 | 'zope.interface', |
584 | ], |
585 | url='https://launchpad.net/lazr.delegates', |
586 | + download_url= 'https://launchpad.net/lazr.delegates/+download', |
587 | classifiers=[ |
588 | "Development Status :: 5 - Production/Stable", |
589 | "Intended Audience :: Developers", |
590 | "License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)", |
591 | "Operating System :: OS Independent", |
592 | "Programming Language :: Python"], |
593 | + extras_require=dict( |
594 | + docs=['Sphinx', |
595 | + 'z3c.recipe.sphinxdoc'] |
596 | + ), |
597 | + setup_requires=['eggtestinfo', 'setuptools_bzr'], |
598 | + test_suite='lazr.delegates.tests', |
599 | ) |
600 | |
601 | === modified file 'src/lazr/__init__.py' |
602 | --- src/lazr/__init__.py 2008-12-15 22:21:53 +0000 |
603 | +++ src/lazr/__init__.py 2009-03-24 19:51:29 +0000 |
604 | @@ -1,4 +1,18 @@ |
605 | # Copyright 2008 Canonical Ltd. All rights reserved. |
606 | +# |
607 | +# This file is part of lazr.delegates. |
608 | +# |
609 | +# lazr.delegates is free software: you can redistribute it and/or modify it |
610 | +# under the terms of the GNU Lesser General Public License as published by |
611 | +# the Free Software Foundation, version 3 of the License. |
612 | +# |
613 | +# lazr.delegates is distributed in the hope that it will be useful, but |
614 | +# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY |
615 | +# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public |
616 | +# License for more details. |
617 | +# |
618 | +# You should have received a copy of the GNU Lesser General Public License |
619 | +# along with lazr.delegates. If not, see <http://www.gnu.org/licenses/>. |
620 | |
621 | # this is a namespace package |
622 | try: |
623 | |
624 | === modified file 'src/lazr/delegates/CHANGES.txt' |
625 | --- src/lazr/delegates/CHANGES.txt 2008-12-15 22:21:53 +0000 |
626 | +++ src/lazr/delegates/CHANGES.txt 2009-03-24 19:51:29 +0000 |
627 | @@ -2,7 +2,14 @@ |
628 | Changes |
629 | ======= |
630 | |
631 | -1.0b1 (2008-12-08) |
632 | +1.0.1 (2009-03-24) |
633 | ================== |
634 | |
635 | +- specify only v3 of LGPL |
636 | + |
637 | +- build/developer improvements |
638 | + |
639 | +1.0 (2008-12-19) |
640 | +================ |
641 | + |
642 | - Initial release |
643 | |
644 | === modified file 'src/lazr/delegates/README.txt' |
645 | --- src/lazr/delegates/README.txt 2008-12-15 22:21:53 +0000 |
646 | +++ src/lazr/delegates/README.txt 2009-03-24 19:51:29 +0000 |
647 | @@ -1,3 +1,18 @@ |
648 | +.. |
649 | + This file is part of lazr.delegates. |
650 | + |
651 | + lazr.delegates is free software: you can redistribute it and/or modify it |
652 | + under the terms of the GNU Lesser General Public License as published by |
653 | + the Free Software Foundation, version 3 of the License. |
654 | + |
655 | + lazr.delegates is distributed in the hope that it will be useful, but |
656 | + WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY |
657 | + or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public |
658 | + License for more details. |
659 | + |
660 | + You should have received a copy of the GNU Lesser General Public License |
661 | + along with lazr.delegates. If not, see <http://www.gnu.org/licenses/>. |
662 | + |
663 | The ``lazr.delegates`` Package |
664 | ****************************** |
665 | |
666 | @@ -39,7 +54,7 @@ |
667 | ... baz = 'hi baz!' |
668 | |
669 | SomeClass can implement IFoo by delegating to an instance of BaseFoo |
670 | -stored in the 'context' attribute. Note that ``delagates`` takes the |
671 | +stored in the 'context' attribute. Note that ``delegates`` takes the |
672 | interface as the argument. By default, 'context' is the attribute |
673 | containing the object to which the interface implementation is |
674 | delegated. |
675 | @@ -170,3 +185,13 @@ |
676 | Traceback (most recent call last): |
677 | ... |
678 | NotImplementedError |
679 | + |
680 | +=============== |
681 | +Other Documents |
682 | +=============== |
683 | + |
684 | +.. toctree:: |
685 | + :glob: |
686 | + |
687 | + * |
688 | + docs/* |
689 | |
690 | === added file 'src/lazr/delegates/__init__.py' |
691 | --- src/lazr/delegates/__init__.py 1970-01-01 00:00:00 +0000 |
692 | +++ src/lazr/delegates/__init__.py 2009-03-24 19:51:29 +0000 |
693 | @@ -0,0 +1,30 @@ |
694 | +# Copyright 2008 Canonical Ltd. All rights reserved. |
695 | +# |
696 | +# This file is part of lazr.delegates. |
697 | +# |
698 | +# lazr.delegates is free software: you can redistribute it and/or modify it |
699 | +# under the terms of the GNU Lesser General Public License as published by |
700 | +# the Free Software Foundation, version 3 of the License. |
701 | +# |
702 | +# lazr.delegates is distributed in the hope that it will be useful, but |
703 | +# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY |
704 | +# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public |
705 | +# License for more details. |
706 | +# |
707 | +# You should have received a copy of the GNU Lesser General Public License |
708 | +# along with lazr.delegates. If not, see <http://www.gnu.org/licenses/>. |
709 | + |
710 | +"""Decorator helpers that simplify class composition.""" |
711 | + |
712 | +__version__ = 1.0 |
713 | + |
714 | +# Re-export in such a way that __version__ can still be imported if |
715 | +# dependencies are not yet available. |
716 | +try: |
717 | + # While we generally frown on "*" imports, this, combined with the fact we |
718 | + # only test code from this module, means that we can verify what has been |
719 | + # exported. |
720 | + from lazr.delegates._delegates import * |
721 | + from lazr.delegates._delegates import __all__ |
722 | +except ImportError: |
723 | + pass |
724 | |
725 | === renamed file 'src/lazr/delegates/__init__.py' => 'src/lazr/delegates/_delegates.py' |
726 | --- src/lazr/delegates/__init__.py 2008-12-15 22:21:53 +0000 |
727 | +++ src/lazr/delegates/_delegates.py 2009-03-24 19:51:29 +0000 |
728 | @@ -1,4 +1,18 @@ |
729 | # Copyright 2008 Canonical Ltd. All rights reserved. |
730 | +# |
731 | +# This file is part of lazr.delegates. |
732 | +# |
733 | +# lazr.delegates is free software: you can redistribute it and/or modify it |
734 | +# under the terms of the GNU Lesser General Public License as published by |
735 | +# the Free Software Foundation, version 3 of the License. |
736 | +# |
737 | +# lazr.delegates is distributed in the hope that it will be useful, but |
738 | +# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY |
739 | +# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public |
740 | +# License for more details. |
741 | +# |
742 | +# You should have received a copy of the GNU Lesser General Public License |
743 | +# along with lazr.delegates. If not, see <http://www.gnu.org/licenses/>. |
744 | |
745 | """Decorator helpers that simplify class composition.""" |
746 | |
747 | |
748 | === added directory 'src/lazr/delegates/tests' |
749 | === added file 'src/lazr/delegates/tests/__init__.py' |
750 | --- src/lazr/delegates/tests/__init__.py 1970-01-01 00:00:00 +0000 |
751 | +++ src/lazr/delegates/tests/__init__.py 2009-03-24 19:51:29 +0000 |
752 | @@ -0,0 +1,16 @@ |
753 | +# Copyright 2008 Canonical Ltd. All rights reserved. |
754 | +# |
755 | +# This file is part of lazr.delegates. |
756 | +# |
757 | +# lazr.delegates is free software: you can redistribute it and/or modify it |
758 | +# under the terms of the GNU Lesser General Public License as published by |
759 | +# the Free Software Foundation, version 3 of the License. |
760 | +# |
761 | +# lazr.delegates is distributed in the hope that it will be useful, but |
762 | +# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY |
763 | +# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public |
764 | +# License for more details. |
765 | +# |
766 | +# You should have received a copy of the GNU Lesser General Public License |
767 | +# along with lazr.delegates. If not, see <http://www.gnu.org/licenses/>. |
768 | +"""Tests for lazr.delegates""" |
769 | |
770 | === renamed file 'src/lazr/delegates/tests.py' => 'src/lazr/delegates/tests/test_docs.py' |
771 | --- src/lazr/delegates/tests.py 2008-12-15 22:21:53 +0000 |
772 | +++ src/lazr/delegates/tests/test_docs.py 2009-03-24 19:51:29 +0000 |
773 | @@ -1,17 +1,51 @@ |
774 | -# Copyright 2008 Canonical Ltd. All rights reserved. |
775 | +# Copyright 2008-2009 Canonical Ltd. All rights reserved. |
776 | +# |
777 | +# This file is part of lazr.delegates |
778 | +# |
779 | +# lazr.delegates is free software: you can redistribute it and/or modify it |
780 | +# under the terms of the GNU Lesser General Public License as published by |
781 | +# the Free Software Foundation, version 3 of the License. |
782 | +# |
783 | +# lazr.delegates is distributed in the hope that it will be useful, but |
784 | +# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY |
785 | +# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public |
786 | +# License for more details. |
787 | +# |
788 | +# You should have received a copy of the GNU Lesser General Public License |
789 | +# along with lazr.delegates. If not, see <http://www.gnu.org/licenses/>. |
790 | +"Test harness for doctests." |
791 | |
792 | -"""Test harness.""" |
793 | +# pylint: disable-msg=E0611,W0142 |
794 | |
795 | __metaclass__ = type |
796 | -__all__ = [] |
797 | +__all__ = [ |
798 | + 'additional_tests', |
799 | + ] |
800 | |
801 | +import atexit |
802 | import doctest |
803 | +import os |
804 | +from pkg_resources import ( |
805 | + resource_filename, resource_exists, resource_listdir, cleanup_resources) |
806 | import unittest |
807 | |
808 | - |
809 | -def test_suite(): |
810 | +DOCTEST_FLAGS = ( |
811 | + doctest.ELLIPSIS | |
812 | + doctest.NORMALIZE_WHITESPACE | |
813 | + doctest.REPORT_NDIFF) |
814 | + |
815 | + |
816 | +def additional_tests(): |
817 | + "Run the doc tests (README.txt and docs/*, if any exist)" |
818 | + doctest_files = [ |
819 | + os.path.abspath(resource_filename('lazr.delegates', 'README.txt'))] |
820 | + if resource_exists('lazr.delegates', 'docs'): |
821 | + for name in resource_listdir('lazr.delegates', 'docs'): |
822 | + if name.endswith('.txt'): |
823 | + doctest_files.append( |
824 | + os.path.abspath( |
825 | + resource_filename('lazr.delegates', 'docs/%s' % name))) |
826 | + kwargs = dict(module_relative=False, optionflags=DOCTEST_FLAGS) |
827 | + atexit.register(cleanup_resources) |
828 | return unittest.TestSuite(( |
829 | - doctest.DocFileSuite( |
830 | - 'README.txt', |
831 | - optionflags=doctest.NORMALIZE_WHITESPACE,), |
832 | - )) |
833 | + doctest.DocFileSuite(*doctest_files, **kwargs))) |
The same changes as for the other lazr packages:
- license specifies v3 of LGPL
- buildout updates
Thanks
Gary