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
=== modified file '.bzrignore'
--- .bzrignore 2008-12-15 22:22:12 +0000
+++ .bzrignore 2009-03-24 17:31:47 +0000
@@ -1,8 +1,11 @@
1TEST_THIS_REST_BEFORE_REGISTERING.txt
2bin1bin
3develop-eggs2develop-eggs
4eggs3.installed.cfg
4develop-eggs
5parts5parts
6src/*.egg-info6*.egg-info
7.installed.cfg7tags
8TAGS
9build
10*.egg
8dist11dist
912
=== modified file 'CHANGES.txt'
--- CHANGES.txt 2008-12-19 19:36:16 +0000
+++ CHANGES.txt 2009-03-24 17:31:47 +0000
@@ -5,8 +5,7 @@
55
6 lazr.config is free software: you can redistribute it and/or modify it6 lazr.config is free software: you can redistribute it and/or modify it
7 under the terms of the GNU Lesser General Public License as published by7 under the terms of the GNU Lesser General Public License as published by
8 the Free Software Foundation, either version 3 of the License, or (at your8 the Free Software Foundation, version 3 of the License.
9 option) any later version.
109
11 lazr.config is distributed in the hope that it will be useful, but WITHOUT10 lazr.config is distributed in the hope that it will be useful, but WITHOUT
12 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or11 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
1312
=== renamed file 'DEVELOP.txt' => 'HACKING.txt'
--- DEVELOP.txt 2008-12-19 19:36:16 +0000
+++ HACKING.txt 2009-03-24 17:31:47 +0000
@@ -3,8 +3,7 @@
33
4 lazr.config is free software: you can redistribute it and/or modify it4 lazr.config is free software: you can redistribute it and/or modify it
5 under the terms of the GNU Lesser General Public License as published by5 under the terms of the GNU Lesser General Public License as published by
6 the Free Software Foundation, either version 3 of the License, or (at your6 the Free Software Foundation, version 3 of the License.
7 option) any later version.
87
9 lazr.config is distributed in the hope that it will be useful, but WITHOUT8 lazr.config is distributed in the hope that it will be useful, but WITHOUT
10 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or9 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
@@ -16,141 +15,27 @@
1615
17This project uses zc.buildout for development.16This project uses zc.buildout for development.
1817
19Basics18============
20======19Introduction
2120============
22To develop or run tests, first run ``$DESIRED_PYTHON bootstrap.py`` in this21
23directory, where you replace ``$DESIRED_PYTHON`` with the python that should22These are guidelines for hacking on the lazr.config project. But first,
24be used to build and run this project. A non-system Python is highly23please see the common hacking guidelines at:
25recommended, but not required.24
2625 http://dev.launchpad.net/Hacking
27Then run ``./bin/buildout``. (NOTE: Ubuntu Intrepid users, see bottom of this26
28document if this generates errors.)27
2928Getting help
30You can now run tests with ``./bin/test``. Use ``./bin/test --help`` to read
31about the many options.
32
33To gain access to a Python interpreter with the package and its dependent eggs
34available, use ``./bin/py``.
35
36You can generate ctags and idutils files for a variety of editors using
37``./bin/tags`` (see ``./bin/tags --help``). The advantage of the files
38generated from this utility is that they include the sourcecode from the eggs
39used in this buildout.
40
41To generate distributions, use ``./bin/buildout setup . SETUP_CMD [...]``.
42That is, you can use ``./bin/buildout setup .`` as if it were
43``python setup.py``. The intended advantage is easy access to a pristine,
44local version of setuptools.
45
46Global Cache
47============
48
49Every project using zc.buildout will keep its own collection of eggs by
50default. You may want to cache these eggs, and their downloaded
51distributions, globally. To do so, perform the following instructions.
52
53- ``mkdir -p ~/.buildout/eggs``
54- ``mkdir ~/.buildout/download-cache``
55- Create ``~/.buildout/default.cfg`` with the following content, replacing
56 "$HOME" with the path to your home::
57
58 [buildout]
59 eggs-directory=$HOME/.buildout/eggs
60 download-cache=$HOME/.buildout/download-cache
61
62Working with Unreleased Packages
63================================
64
65You may want to develop with an unreleased distribution of another package.
66To do so, you have many options. Here are three.
67
68Source
69------
70
71If you have a source package, you can add it to this buildout (temporarily or,
72if really appropriate, permanently) as follows.
73
74NOTE: We'll use "this software" to refer to the software/buildout to which you
75want to add a source package; and "the other software" to refer to the source
76package that you want to add.
77
78- Add the top-level directory (the one with the setup.py) of the other
79 software to somewhere accessible to this software. You might use ``bzr
80 add``, symbolic links, svn externals, or whatever the appropriate tool is
81 for the situation. A reasonable option is to add it in the top-level
82 directory of this software.
83- In this software's buildout.cfg, in the [buildout] section, look for a
84 ``develop`` key. It will probably look like this: ``develop = .``.
85 Edit it to include the directory of the other software. For instance, if
86 you added it at the top level of this software's tree in a folder called
87 "lazr_foo," you would change the line in buildout.cfg to read
88 ``develop = . lazr_foo``.
89- Rerun ``bin/buildout``.
90
91Barring version conflicts in your setup.py or buildout configuration (which
92will be reported as errors when you run `bin/buildout``), you should now be
93using the source version of the dependency. Look at one of the scripts in
94``bin``, such as ``bin/test`` to verify, if you like.
95
96To undo, remove the line in buildout.conf, remove the other software's
97directory if necessary for cleanliness, and rerun ``bin/buildout``.
98
99Distribution
100------------29------------
10130
102If you have a source distribution or an egg, and you set up the download-cache31If you find bugs in this package, you can report them here:
103as described in the `Global Cache`_ section above, you can put the32
104distribution (sdist or egg) in the download-cache's ``dist`` directory.33 https://launchpad.net/lazr.config
105Then rerun bin/buildout.34
10635If you want to discuss this package, join the team and mailing list here:
107Alternatively, if you have an egg, you can put it in your eggs directory, or36
108in the shared eggs directory as described in the `Global Cache`_ section, if37 https://launchpad.net/~lazr-developers
109you are using that. The rerun bin/buildout.38
11039or send a message to:
111In both cases, to undo, you must remove the egg from the local or shared40
112``eggs`` directory. If you used the ``download-cache/dist`` directory, you41 lazr-developers@lists.launchpad.net
113must also remove it from there.
114
115Private Source
116--------------
117
118If you want to distribute a source distribution privately, see
119http://pypi.python.org/pypi/zc.buildoutsftp/.
120
121References
122==========
123
124There is much, much more to learn about zc.buildout. It works well for small
125packages, but is even better for big projects. For more information about
126zc.buildout:
127
128- http://grok.zope.org/documentation/tutorial/introduction-to-zc.buildout
129
130 Presentation notes of an introduction to zc.buildout by its author, Jim
131 Fulton.
132
133- http://pypi.python.org/pypi/zc.buildout
134
135 The user manual.
136
137Ubunutu Intrepid Problem
138========================
139
140Intrepid has a bug working with buildout. You may have to hack to fix it.
141Here's an example of the Python 2.4 version of the hack.
142
143$ sudo rm /usr/lib/python2.4/site-packages/GMenuSimpleEditor/*.py
144$ sudo ln
145-s /var/lib/python-support/python2.4/GMenuSimpleEditor/*.py /usr/lib/python2.4/site-packages/GMenuSimpleEditor/
146
147Python 2.5 would need the same kind of fix (replace all three instances of
148"python2.4" with "python2.5" in the above).
149
150The author of this document tried an Intrepid upgrade and an aptitude
151reinstall of python-gmenu to no avail before doing the rough-and-tumble change
152described above.
153
154See
155https://bugs.edge.launchpad.net/ubuntu/+source/gnome-menus/+bug/301571 and the
156bug linked to it by datakid.
15742
=== modified file 'MANIFEST.in'
--- MANIFEST.in 2008-12-15 22:22:12 +0000
+++ MANIFEST.in 2009-03-24 17:31:47 +0000
@@ -1,2 +1,2 @@
1include *.txt MANIFEST.in1exclude MANIFEST.in buildout.cfg bootstrap.py .bzrignore
2recursive-include src *.txt *.py *.conf2prune _bootstrap
33
=== modified file 'README.txt'
--- README.txt 2008-12-19 19:36:16 +0000
+++ README.txt 2009-03-24 17:31:47 +0000
@@ -5,8 +5,7 @@
55
6 lazr.config is free software: you can redistribute it and/or modify it6 lazr.config is free software: you can redistribute it and/or modify it
7 under the terms of the GNU Lesser General Public License as published by7 under the terms of the GNU Lesser General Public License as published by
8 the Free Software Foundation, either version 3 of the License, or (at your8 the Free Software Foundation, version 3 of the License.
9 option) any later version.
109
11 lazr.config is distributed in the hope that it will be useful, but WITHOUT10 lazr.config is distributed in the hope that it will be useful, but WITHOUT
12 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or11 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
1312
=== added directory '_bootstrap'
=== added file '_bootstrap/COPYRIGHT.txt'
--- _bootstrap/COPYRIGHT.txt 1970-01-01 00:00:00 +0000
+++ _bootstrap/COPYRIGHT.txt 2009-03-24 17:31:47 +0000
@@ -0,0 +1,9 @@
1Copyright (c) 2004-2009 Zope Corporation and Contributors.
2All Rights Reserved.
3
4This software is subject to the provisions of the Zope Public License,
5Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
6THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
7WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
8WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
9FOR A PARTICULAR PURPOSE.
010
=== added file '_bootstrap/LICENSE.txt'
--- _bootstrap/LICENSE.txt 1970-01-01 00:00:00 +0000
+++ _bootstrap/LICENSE.txt 2009-03-24 17:31:47 +0000
@@ -0,0 +1,54 @@
1Zope Public License (ZPL) Version 2.1
2-------------------------------------
3
4A copyright notice accompanies this license document that
5identifies the copyright holders.
6
7This license has been certified as open source. It has also
8been designated as GPL compatible by the Free Software
9Foundation (FSF).
10
11Redistribution and use in source and binary forms, with or
12without modification, are permitted provided that the
13following conditions are met:
14
151. Redistributions in source code must retain the
16 accompanying copyright notice, this list of conditions,
17 and the following disclaimer.
18
192. Redistributions in binary form must reproduce the accompanying
20 copyright notice, this list of conditions, and the
21 following disclaimer in the documentation and/or other
22 materials provided with the distribution.
23
243. Names of the copyright holders must not be used to
25 endorse or promote products derived from this software
26 without prior written permission from the copyright
27 holders.
28
294. The right to distribute this software or to use it for
30 any purpose does not give you the right to use
31 Servicemarks (sm) or Trademarks (tm) of the copyright
32 holders. Use of them is covered by separate agreement
33 with the copyright holders.
34
355. If any files are modified, you must cause the modified
36 files to carry prominent notices stating that you changed
37 the files and the date of any change.
38
39Disclaimer
40
41 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS''
42 AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT
43 NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
44 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
45 NO EVENT SHALL THE COPYRIGHT HOLDERS BE
46 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
47 EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
48 LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
49 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
50 HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
51 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
52 OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
53 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
54 DAMAGE.
0\ No newline at end of file55\ No newline at end of file
156
=== renamed file 'bootstrap.py' => '_bootstrap/bootstrap.py'
=== added symlink 'bootstrap.py'
=== target is '_bootstrap/bootstrap.py'
=== modified file 'buildout.cfg'
--- buildout.cfg 2008-12-15 22:22:12 +0000
+++ buildout.cfg 2009-03-24 17:36:13 +0000
@@ -2,6 +2,7 @@
2parts =2parts =
3 interpreter3 interpreter
4 test4 test
5 docs
5 tags6 tags
6unzip = true7unzip = true
78
@@ -10,7 +11,14 @@
10[test]11[test]
11recipe = zc.recipe.testrunner12recipe = zc.recipe.testrunner
12eggs = lazr.config13eggs = lazr.config
13defaults = '--tests-pattern ^tests --exit-with-status'.split()14defaults = '--tests-pattern ^tests --exit-with-status --suite-name additional_tests'.split()
15
16[docs]
17recipe = z3c.recipe.sphinxdoc
18eggs = lazr.config [docs]
19index-doc = README
20default.css =
21layout.html =
1422
15[interpreter]23[interpreter]
16recipe = zc.recipe.egg24recipe = zc.recipe.egg
1725
=== added file 'ez_setup.py'
--- ez_setup.py 1970-01-01 00:00:00 +0000
+++ ez_setup.py 2009-03-24 17:31:47 +0000
@@ -0,0 +1,241 @@
1#!python
2"""Bootstrap setuptools installation
3
4If you want to use setuptools in your package's setup.py, just include this
5file in the same directory with it, and add this to the top of your setup.py::
6
7 from ez_setup import use_setuptools
8 use_setuptools()
9
10If you want to require a specific version of setuptools, set a download
11mirror, or use an alternate download directory, you can do so by supplying
12the appropriate options to ``use_setuptools()``.
13
14This file can also be run as a script to install or upgrade setuptools.
15"""
16import sys
17DEFAULT_VERSION = "0.6c8"
18DEFAULT_URL = "http://pypi.python.org/packages/%s/s/setuptools/" % sys.version[:3]
19
20md5_data = {
21 'setuptools-0.6b1-py2.3.egg': '8822caf901250d848b996b7f25c6e6ca',
22 'setuptools-0.6b1-py2.4.egg': 'b79a8a403e4502fbb85ee3f1941735cb',
23 'setuptools-0.6b2-py2.3.egg': '5657759d8a6d8fc44070a9d07272d99b',
24 'setuptools-0.6b2-py2.4.egg': '4996a8d169d2be661fa32a6e52e4f82a',
25 'setuptools-0.6b3-py2.3.egg': 'bb31c0fc7399a63579975cad9f5a0618',
26 'setuptools-0.6b3-py2.4.egg': '38a8c6b3d6ecd22247f179f7da669fac',
27 'setuptools-0.6b4-py2.3.egg': '62045a24ed4e1ebc77fe039aa4e6f7e5',
28 'setuptools-0.6b4-py2.4.egg': '4cb2a185d228dacffb2d17f103b3b1c4',
29 'setuptools-0.6c1-py2.3.egg': 'b3f2b5539d65cb7f74ad79127f1a908c',
30 'setuptools-0.6c1-py2.4.egg': 'b45adeda0667d2d2ffe14009364f2a4b',
31 'setuptools-0.6c2-py2.3.egg': 'f0064bf6aa2b7d0f3ba0b43f20817c27',
32 'setuptools-0.6c2-py2.4.egg': '616192eec35f47e8ea16cd6a122b7277',
33 'setuptools-0.6c3-py2.3.egg': 'f181fa125dfe85a259c9cd6f1d7b78fa',
34 'setuptools-0.6c3-py2.4.egg': 'e0ed74682c998bfb73bf803a50e7b71e',
35 'setuptools-0.6c3-py2.5.egg': 'abef16fdd61955514841c7c6bd98965e',
36 'setuptools-0.6c4-py2.3.egg': 'b0b9131acab32022bfac7f44c5d7971f',
37 'setuptools-0.6c4-py2.4.egg': '2a1f9656d4fbf3c97bf946c0a124e6e2',
38 'setuptools-0.6c4-py2.5.egg': '8f5a052e32cdb9c72bcf4b5526f28afc',
39 'setuptools-0.6c5-py2.3.egg': 'ee9fd80965da04f2f3e6b3576e9d8167',
40 'setuptools-0.6c5-py2.4.egg': 'afe2adf1c01701ee841761f5bcd8aa64',
41 'setuptools-0.6c5-py2.5.egg': 'a8d3f61494ccaa8714dfed37bccd3d5d',
42 'setuptools-0.6c6-py2.3.egg': '35686b78116a668847237b69d549ec20',
43 'setuptools-0.6c6-py2.4.egg': '3c56af57be3225019260a644430065ab',
44 'setuptools-0.6c6-py2.5.egg': 'b2f8a7520709a5b34f80946de5f02f53',
45 'setuptools-0.6c7-py2.3.egg': '209fdf9adc3a615e5115b725658e13e2',
46 'setuptools-0.6c7-py2.4.egg': '5a8f954807d46a0fb67cf1f26c55a82e',
47 'setuptools-0.6c7-py2.5.egg': '45d2ad28f9750e7434111fde831e8372',
48 'setuptools-0.6c8-py2.3.egg': '50759d29b349db8cfd807ba8303f1902',
49 'setuptools-0.6c8-py2.4.egg': 'cba38d74f7d483c06e9daa6070cce6de',
50 'setuptools-0.6c8-py2.5.egg': '1721747ee329dc150590a58b3e1ac95b',
51}
52
53import sys, os
54
55def _validate_md5(egg_name, data):
56 if egg_name in md5_data:
57 from md5 import md5
58 digest = md5(data).hexdigest()
59 if digest != md5_data[egg_name]:
60 print >>sys.stderr, (
61 "md5 validation of %s failed! (Possible download problem?)"
62 % egg_name
63 )
64 sys.exit(2)
65 return data
66
67
68def use_setuptools(
69 version=DEFAULT_VERSION, download_base=DEFAULT_URL, to_dir=os.curdir,
70 download_delay=15, min_version=None
71):
72 """Automatically find/download setuptools and make it available on sys.path
73
74 `version` should be a valid setuptools version number that is available
75 as an egg for download under the `download_base` URL (which should end with
76 a '/'). `to_dir` is the directory where setuptools will be downloaded, if
77 it is not already available. If `download_delay` is specified, it should
78 be the number of seconds that will be paused before initiating a download,
79 should one be required. If an older version of setuptools is installed,
80 this routine will print a message to ``sys.stderr`` and raise SystemExit in
81 an attempt to abort the calling script.
82 """
83 # Work around a hack in the ez_setup.py file from simplejson==1.7.3.
84 if min_version:
85 version = min_version
86
87 was_imported = 'pkg_resources' in sys.modules or 'setuptools' in sys.modules
88 def do_download():
89 egg = download_setuptools(version, download_base, to_dir, download_delay)
90 sys.path.insert(0, egg)
91 import setuptools; setuptools.bootstrap_install_from = egg
92 try:
93 import pkg_resources
94 except ImportError:
95 return do_download()
96 try:
97 pkg_resources.require("setuptools>="+version); return
98 except pkg_resources.VersionConflict, e:
99 if was_imported:
100 print >>sys.stderr, (
101 "The required version of setuptools (>=%s) is not available, and\n"
102 "can't be installed while this script is running. Please install\n"
103 " a more recent version first, using 'easy_install -U setuptools'."
104 "\n\n(Currently using %r)"
105 ) % (version, e.args[0])
106 sys.exit(2)
107 else:
108 del pkg_resources, sys.modules['pkg_resources'] # reload ok
109 return do_download()
110 except pkg_resources.DistributionNotFound:
111 return do_download()
112
113def download_setuptools(
114 version=DEFAULT_VERSION, download_base=DEFAULT_URL, to_dir=os.curdir,
115 delay = 15
116):
117 """Download setuptools from a specified location and return its filename
118
119 `version` should be a valid setuptools version number that is available
120 as an egg for download under the `download_base` URL (which should end
121 with a '/'). `to_dir` is the directory where the egg will be downloaded.
122 `delay` is the number of seconds to pause before an actual download attempt.
123 """
124 import urllib2, shutil
125 egg_name = "setuptools-%s-py%s.egg" % (version,sys.version[:3])
126 url = download_base + egg_name
127 saveto = os.path.join(to_dir, egg_name)
128 src = dst = None
129 if not os.path.exists(saveto): # Avoid repeated downloads
130 try:
131 from distutils import log
132 if delay:
133 log.warn("""
134---------------------------------------------------------------------------
135This script requires setuptools version %s to run (even to display
136help). I will attempt to download it for you (from
137%s), but
138you may need to enable firewall access for this script first.
139I will start the download in %d seconds.
140
141(Note: if this machine does not have network access, please obtain the file
142
143 %s
144
145and place it in this directory before rerunning this script.)
146---------------------------------------------------------------------------""",
147 version, download_base, delay, url
148 ); from time import sleep; sleep(delay)
149 log.warn("Downloading %s", url)
150 src = urllib2.urlopen(url)
151 # Read/write all in one block, so we don't create a corrupt file
152 # if the download is interrupted.
153 data = _validate_md5(egg_name, src.read())
154 dst = open(saveto,"wb"); dst.write(data)
155 finally:
156 if src: src.close()
157 if dst: dst.close()
158 return os.path.realpath(saveto)
159
160def main(argv, version=DEFAULT_VERSION):
161 """Install or upgrade setuptools and EasyInstall"""
162 try:
163 import setuptools
164 except ImportError:
165 egg = None
166 try:
167 egg = download_setuptools(version, delay=0)
168 sys.path.insert(0,egg)
169 from setuptools.command.easy_install import main
170 return main(list(argv)+[egg]) # we're done here
171 finally:
172 if egg and os.path.exists(egg):
173 os.unlink(egg)
174 else:
175 if setuptools.__version__ == '0.0.1':
176 print >>sys.stderr, (
177 "You have an obsolete version of setuptools installed. Please\n"
178 "remove it from your system entirely before rerunning this script."
179 )
180 sys.exit(2)
181
182 req = "setuptools>="+version
183 import pkg_resources
184 try:
185 pkg_resources.require(req)
186 except pkg_resources.VersionConflict:
187 try:
188 from setuptools.command.easy_install import main
189 except ImportError:
190 from easy_install import main
191 main(list(argv)+[download_setuptools(delay=0)])
192 sys.exit(0) # try to force an exit
193 else:
194 if argv:
195 from setuptools.command.easy_install import main
196 main(argv)
197 else:
198 print "Setuptools version",version,"or greater has been installed."
199 print '(Run "ez_setup.py -U setuptools" to reinstall or upgrade.)'
200
201def update_md5(filenames):
202 """Update our built-in md5 registry"""
203
204 import re
205 from md5 import md5
206
207 for name in filenames:
208 base = os.path.basename(name)
209 f = open(name,'rb')
210 md5_data[base] = md5(f.read()).hexdigest()
211 f.close()
212
213 data = [" %r: %r,\n" % it for it in md5_data.items()]
214 data.sort()
215 repl = "".join(data)
216
217 import inspect
218 srcfile = inspect.getsourcefile(sys.modules[__name__])
219 f = open(srcfile, 'rb'); src = f.read(); f.close()
220
221 match = re.search("\nmd5_data = {\n([^}]+)}", src)
222 if not match:
223 print >>sys.stderr, "Internal error!"
224 sys.exit(2)
225
226 src = src[:match.start(1)] + repl + src[match.end(1):]
227 f = open(srcfile,'w')
228 f.write(src)
229 f.close()
230
231
232if __name__=='__main__':
233 if len(sys.argv)>2 and sys.argv[1]=='--md5update':
234 update_md5(sys.argv[2:])
235 else:
236 main(sys.argv[1:])
237
238
239
240
241
0242
=== modified file 'setup.py' (properties changed: -x to +x)
--- setup.py 2009-01-05 20:39:16 +0000
+++ setup.py 2009-03-24 17:31:47 +0000
@@ -1,11 +1,12 @@
1#!/usr/bin/env python
2
1# Copyright 2008-2009 Canonical Ltd. All rights reserved.3# Copyright 2008-2009 Canonical Ltd. All rights reserved.
2#4#
3# This file is part of lazr.config.5# This file is part of lazr.config.
4#6#
5# lazr.config is free software: you can redistribute it and/or modify it7# lazr.config is free software: you can redistribute it and/or modify it
6# under the terms of the GNU Lesser General Public License as published by8# under the terms of the GNU Lesser General Public License as published by
7# the Free Software Foundation, either version 3 of the License, or (at your9# the Free Software Foundation, version 3 of the License.
8# option) any later version.
9#10#
10# lazr.config is distributed in the hope that it will be useful, but WITHOUT11# lazr.config is distributed in the hope that it will be useful, but WITHOUT
11# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or12# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
@@ -15,6 +16,10 @@
15# You should have received a copy of the GNU Lesser General Public License16# You should have received a copy of the GNU Lesser General Public License
16# along with lazr.config. If not, see <http://www.gnu.org/licenses/>.17# along with lazr.config. If not, see <http://www.gnu.org/licenses/>.
1718
19import ez_setup
20ez_setup.use_setuptools()
21
22import sys
18from setuptools import setup, find_packages23from setuptools import setup, find_packages
1924
20# generic helpers primarily for the long_description25# generic helpers primarily for the long_description
@@ -31,9 +36,13 @@
31 return '\n'.join(res)36 return '\n'.join(res)
32# end generic helpers37# end generic helpers
3338
39
40sys.path.insert(0, 'src')
41from lazr.config import __version__
42
34setup(43setup(
35 name='lazr.config',44 name='lazr.config',
36 version='1.1',45 version=__version__,
37 namespace_packages=['lazr'],46 namespace_packages=['lazr'],
38 packages=find_packages('src'),47 packages=find_packages('src'),
39 package_dir={'':'src'},48 package_dir={'':'src'},
@@ -52,10 +61,17 @@
52 'lazr.delegates',61 'lazr.delegates',
53 ],62 ],
54 url='https://launchpad.net/lazr.config',63 url='https://launchpad.net/lazr.config',
64 download_url= 'https://launchpad.net/lazr.config/+download',
55 classifiers=[65 classifiers=[
56 "Development Status :: 5 - Production/Stable",66 "Development Status :: 5 - Production/Stable",
57 "Intended Audience :: Developers",67 "Intended Audience :: Developers",
58 "License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)",68 "License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)",
59 "Operating System :: OS Independent",69 "Operating System :: OS Independent",
60 "Programming Language :: Python"],70 "Programming Language :: Python"],
71 extras_require=dict(
72 docs=['Sphinx',
73 'z3c.recipe.sphinxdoc']
74 ),
75 setup_requires=['eggtestinfo', 'setuptools_bzr'],
76 test_suite='lazr.config.tests',
61 )77 )
6278
=== modified file 'src/lazr/__init__.py'
--- src/lazr/__init__.py 2009-01-05 20:39:16 +0000
+++ src/lazr/__init__.py 2009-03-24 17:31:47 +0000
@@ -4,8 +4,7 @@
4#4#
5# lazr.config is free software: you can redistribute it and/or modify it5# lazr.config is free software: you can redistribute it and/or modify it
6# under the terms of the GNU Lesser General Public License as published by6# under the terms of the GNU Lesser General Public License as published by
7# the Free Software Foundation, either version 3 of the License, or (at your7# the Free Software Foundation, version 3 of the License.
8# option) any later version.
9#8#
10# lazr.config is distributed in the hope that it will be useful, but WITHOUT9# lazr.config is distributed in the hope that it will be useful, but WITHOUT
11# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or10# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
1211
=== modified file 'src/lazr/config/CHANGES.txt'
--- src/lazr/config/CHANGES.txt 2009-01-05 20:39:16 +0000
+++ src/lazr/config/CHANGES.txt 2009-03-24 17:31:47 +0000
@@ -2,6 +2,14 @@
2Changes2Changes
3=======3=======
44
51.1.1 (2009-03-24)
6==================
7
8- License clarification: only v3 of the LGPL is offered at this time, not
9 subsequent versions.
10
11- Build is updated to support Sphinx docs and other small changes.
12
51.1 (2009-01-05)131.1 (2009-01-05)
6================14================
715
816
=== modified file 'src/lazr/config/README.txt'
--- src/lazr/config/README.txt 2009-01-05 20:26:07 +0000
+++ src/lazr/config/README.txt 2009-03-24 17:36:13 +0000
@@ -3,8 +3,7 @@
33
4 lazr.config is free software: you can redistribute it and/or modify it4 lazr.config is free software: you can redistribute it and/or modify it
5 under the terms of the GNU Lesser General Public License as published by5 under the terms of the GNU Lesser General Public License as published by
6 the Free Software Foundation, either version 3 of the License, or (at your6 the Free Software Foundation, version 3 of the License.
7 option) any later version.
87
9 lazr.config is distributed in the hope that it will be useful, but WITHOUT8 lazr.config is distributed in the hope that it will be useful, but WITHOUT
10 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or9 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
@@ -41,7 +40,7 @@
4140
42 >>> import lazr.config41 >>> import lazr.config
43 >>> testfiles_dir = path.normpath(path.join(42 >>> testfiles_dir = path.normpath(path.join(
44 ... path.dirname(lazr.config.__file__), 'testdata'))43 ... path.dirname(lazr.config.__file__), 'tests', 'testdata'))
45 >>> base_conf = path.join(testfiles_dir, 'base.conf')44 >>> base_conf = path.join(testfiles_dir, 'base.conf')
4645
47The config file contains sections enclosed in square brackets ([]).46The config file contains sections enclosed in square brackets ([]).
@@ -94,7 +93,7 @@
94 >>> schema.name93 >>> schema.name
95 'base.conf'94 'base.conf'
96 >>> schema.filename95 >>> schema.filename
97 '...lazr/config/testdata/base.conf'96 '...lazr/config/tests/testdata/base.conf'
9897
99If you provide an optional file-like object as a second argument to the98If you provide an optional file-like object as a second argument to the
100constructor, that is used instead of opening the named file implicitly.99constructor, that is used instead of opening the named file implicitly.
@@ -462,7 +461,7 @@
462 >>> config.name461 >>> config.name
463 'local.conf'462 'local.conf'
464 >>> config.filename463 >>> config.filename
465 '...lazr/config/testdata/local.conf'464 '...lazr/config/tests/testdata/local.conf'
466465
467The config can access the schema via the schema property.466The config can access the schema via the schema property.
468467
@@ -590,9 +589,9 @@
590The Section's type is the same type as the ConfigSchema.section_factory.589The Section's type is the same type as the ConfigSchema.section_factory.
591590
592 >>> section_1591 >>> section_1
593 <lazr.config.Section object at ...>592 <lazr.config...Section object at ...>
594 >>> config.schema.section_factory593 >>> config.schema.section_factory
595 <class 'lazr.config.Section'>594 <class 'lazr.config...Section'>
596595
597A key can be verified to be in a Section.596A key can be verified to be in a Section.
598597
@@ -1065,9 +1064,9 @@
10651064
1066 >>> implicit_config = implicit_schema.load(local_conf)1065 >>> implicit_config = implicit_schema.load(local_conf)
1067 >>> implicit_config1066 >>> implicit_config
1068 <lazr.config.Config object at ...>1067 <lazr.config...Config object at ...>
1069 >>> config1068 >>> config
1070 <lazr.config.Config object at ...>1069 <lazr.config...Config object at ...>
10711070
1072 >>> sections = sorted(section.name for section in config)1071 >>> sections = sorted(section.name for section in config)
1073 >>> implicit_sections = sorted(1072 >>> implicit_sections = sorted(
@@ -1081,7 +1080,7 @@
1081But the type of sections in the config support implicit typing.1080But the type of sections in the config support implicit typing.
10821081
1083 >>> implicit_config['section_3.app_b']1082 >>> implicit_config['section_3.app_b']
1084 <lazr.config.ImplicitTypeSection object at ...>1083 <lazr.config...ImplicitTypeSection object at ...>
10851084
1086ImplicitTypeSection, in contrast to Section, converts values that1085ImplicitTypeSection, in contrast to Section, converts values that
1087appear to be integer or boolean into ints and bools.1086appear to be integer or boolean into ints and bools.
@@ -1447,3 +1446,13 @@
1447 Traceback (most recent call last):1446 Traceback (most recent call last):
1448 ...1447 ...
1449 AttributeError: 'module' object has no attribute 'CHEESE'1448 AttributeError: 'module' object has no attribute 'CHEESE'
1449
1450===============
1451Other Documents
1452===============
1453
1454.. toctree::
1455 :glob:
1456
1457 *
1458 docs/*
14501459
=== added file 'src/lazr/config/__init__.py'
--- src/lazr/config/__init__.py 1970-01-01 00:00:00 +0000
+++ src/lazr/config/__init__.py 2009-03-24 17:31:47 +0000
@@ -0,0 +1,30 @@
1# Copyright 2007-2009 Canonical Ltd. All rights reserved.
2#
3# This file is part of lazr.config
4#
5# lazr.config is free software: you can redistribute it and/or modify it
6# under the terms of the GNU Lesser General Public License as published by
7# the Free Software Foundation, version 3 of the License.
8#
9# lazr.config is distributed in the hope that it will be useful, but WITHOUT
10# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
12# License for more details.
13#
14# You should have received a copy of the GNU Lesser General Public License
15# along with lazr.config. If not, see <http://www.gnu.org/licenses/>.
16
17"""A configuration file system."""
18
19__version__ = '1.1.1'
20
21# Re-export in such a way that __version__ can still be imported if
22# dependencies are not yet available.
23try:
24 # While we generally frown on "*" imports, this, combined with the fact we
25 # only test code from this module, means that we can verify what has been
26 # exported.
27 from lazr.config._config import *
28 from lazr.config._config import __all__
29except ImportError:
30 pass
031
=== renamed file 'src/lazr/config/__init__.py' => 'src/lazr/config/_config.py'
--- src/lazr/config/__init__.py 2009-01-05 20:39:16 +0000
+++ src/lazr/config/_config.py 2009-03-24 17:31:47 +0000
@@ -4,8 +4,7 @@
4#4#
5# lazr.config is free software: you can redistribute it and/or modify it5# lazr.config is free software: you can redistribute it and/or modify it
6# under the terms of the GNU Lesser General Public License as published by6# under the terms of the GNU Lesser General Public License as published by
7# the Free Software Foundation, either version 3 of the License, or (at your7# the Free Software Foundation, version 3 of the License.
8# option) any later version.
9#8#
10# lazr.config is distributed in the hope that it will be useful, but WITHOUT9# lazr.config is distributed in the hope that it will be useful, but WITHOUT
11# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or10# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
@@ -840,7 +839,7 @@
840839
841def as_log_level(value):840def as_log_level(value):
842 """Turn a string into a log level.841 """Turn a string into a log level.
843 842
844 :param value: A string with a value (case-insensitive) equal to one of the843 :param value: A string with a value (case-insensitive) equal to one of the
845 symbolic logging levels.844 symbolic logging levels.
846 :type value: string845 :type value: string
847846
=== modified file 'src/lazr/config/interfaces.py'
--- src/lazr/config/interfaces.py 2008-12-23 01:59:49 +0000
+++ src/lazr/config/interfaces.py 2009-03-24 17:31:47 +0000
@@ -1,4 +1,19 @@
1# Copyright 2007 Canonical Ltd. All rights reserved.1# Copyright 2007-2009 Canonical Ltd. All rights reserved.
2#
3# This file is part of lazr.config
4#
5# lazr.config is free software: you can redistribute it and/or modify it
6# under the terms of the GNU Lesser General Public License as published by
7# the Free Software Foundation, version 3 of the License.
8#
9# lazr.config is distributed in the hope that it will be useful, but WITHOUT
10# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
12# License for more details.
13#
14# You should have received a copy of the GNU Lesser General Public License
15# along with lazr.config. If not, see <http://www.gnu.org/licenses/>.
16
2# pylint: disable-msg=E0211,E0213,W023117# pylint: disable-msg=E0211,E0213,W0231
3"""Interfaces for process configuration.."""18"""Interfaces for process configuration.."""
419
520
=== added directory 'src/lazr/config/tests'
=== added file 'src/lazr/config/tests/__init__.py'
--- src/lazr/config/tests/__init__.py 1970-01-01 00:00:00 +0000
+++ src/lazr/config/tests/__init__.py 2009-03-24 17:31:47 +0000
@@ -0,0 +1,17 @@
1# Copyright 2007-2009 Canonical Ltd. All rights reserved.
2#
3# This file is part of lazr.config
4#
5# lazr.config is free software: you can redistribute it and/or modify it
6# under the terms of the GNU Lesser General Public License as published by
7# the Free Software Foundation, version 3 of the License.
8#
9# lazr.config is distributed in the hope that it will be useful, but WITHOUT
10# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
12# License for more details.
13#
14# You should have received a copy of the GNU Lesser General Public License
15# along with lazr.config. If not, see <http://www.gnu.org/licenses/>.
16
17"""Test package for lazr.config."""
018
=== renamed file 'src/lazr/config/tests.py' => 'src/lazr/config/tests/test_docs.py'
--- src/lazr/config/tests.py 2008-12-15 22:22:12 +0000
+++ src/lazr/config/tests/test_docs.py 2009-03-24 17:31:47 +0000
@@ -1,17 +1,51 @@
1# Copyright 2008 Canonical Ltd. All rights reserved.1# Copyright 2009 Canonical Ltd. All rights reserved.
2#
3# This file is part of lazr.config
4#
5# lazr.config is free software: you can redistribute it and/or modify it
6# under the terms of the GNU Lesser General Public License as published by
7# the Free Software Foundation, version 3 of the License.
8#
9# lazr.config is distributed in the hope that it will be useful, but WITHOUT
10# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
12# License for more details.
13#
14# You should have received a copy of the GNU Lesser General Public License
15# along with lazr.config. If not, see <http://www.gnu.org/licenses/>.
16"Test harness for doctests."
217
3"""Test harness."""18# pylint: disable-msg=E0611,W0142
419
5__metaclass__ = type20__metaclass__ = type
6__all__ = []21__all__ = [
22 'additional_tests',
23 ]
724
25import atexit
8import doctest26import doctest
27import os
28from pkg_resources import (
29 resource_filename, resource_exists, resource_listdir, cleanup_resources)
9import unittest30import unittest
1031
1132DOCTEST_FLAGS = (
12def test_suite():33 doctest.ELLIPSIS |
34 doctest.NORMALIZE_WHITESPACE |
35 doctest.REPORT_NDIFF)
36
37
38def additional_tests():
39 "Run the doc tests (README.txt and docs/*, if any exist)"
40 doctest_files = [
41 os.path.abspath(resource_filename('lazr.config', 'README.txt'))]
42 if resource_exists('lazr.config', 'docs'):
43 for name in resource_listdir('lazr.config', 'docs'):
44 if name.endswith('.txt'):
45 doctest_files.append(
46 os.path.abspath(
47 resource_filename('lazr.config', 'docs/%s' % name)))
48 kwargs = dict(module_relative=False, optionflags=DOCTEST_FLAGS)
49 atexit.register(cleanup_resources)
13 return unittest.TestSuite((50 return unittest.TestSuite((
14 doctest.DocFileSuite(51 doctest.DocFileSuite(*doctest_files, **kwargs)))
15 'README.txt',
16 optionflags=doctest.NORMALIZE_WHITESPACE|doctest.ELLIPSIS),
17 ))
1852
=== renamed directory 'src/lazr/config/testdata' => 'src/lazr/config/tests/testdata'

Subscribers

People subscribed via source and target branches