Merge lp:~gary/lazr.config/build-license-changes into lp:~launchpad-pqm/lazr.config/devel

Proposed by Gary Poster
Status: Merged
Merged at revision: not available
Proposed branch: lp:~gary/lazr.config/build-license-changes
Merge into: lp:~launchpad-pqm/lazr.config/devel
Diff against target: None lines
To merge this branch: bzr merge lp:~gary/lazr.config/build-license-changes
Reviewer Review Type Date Requested Status
LAZR Developers Pending
Review via email: mp+4854@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Gary Poster (gary) wrote :

The same changes as for the other lazr packages:

- license specifies v3 of LGPL

- buildout updates

Thanks

Gary

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

Subscribers

People subscribed via source and target branches