| 1 | |
|---|
| 2 | New patches: |
|---|
| 3 | |
|---|
| 4 | [use buildbot2 and service script if winxp. merge easy_install changes to trunk. |
|---|
| 5 | erik@purins.com**20080503064118] { |
|---|
| 6 | move ./contrib/windows/buildbot2.bat ./contrib/windows/buildbot.cmd |
|---|
| 7 | addfile ./ez_setup.py |
|---|
| 8 | hunk ./ez_setup.py 1 |
|---|
| 9 | +#!python |
|---|
| 10 | +"""Bootstrap setuptools installation |
|---|
| 11 | + |
|---|
| 12 | +If you want to use setuptools in your package's setup.py, just include this |
|---|
| 13 | +file in the same directory with it, and add this to the top of your setup.py:: |
|---|
| 14 | + |
|---|
| 15 | + from ez_setup import use_setuptools |
|---|
| 16 | + use_setuptools() |
|---|
| 17 | + |
|---|
| 18 | +If you want to require a specific version of setuptools, set a download |
|---|
| 19 | +mirror, or use an alternate download directory, you can do so by supplying |
|---|
| 20 | +the appropriate options to ``use_setuptools()``. |
|---|
| 21 | + |
|---|
| 22 | +This file can also be run as a script to install or upgrade setuptools. |
|---|
| 23 | +""" |
|---|
| 24 | +import sys |
|---|
| 25 | +DEFAULT_VERSION = "0.6c8" |
|---|
| 26 | +DEFAULT_URL = "http://pypi.python.org/packages/%s/s/setuptools/" % sys.version[:3] |
|---|
| 27 | + |
|---|
| 28 | +md5_data = { |
|---|
| 29 | + 'setuptools-0.6b1-py2.3.egg': '8822caf901250d848b996b7f25c6e6ca', |
|---|
| 30 | + 'setuptools-0.6b1-py2.4.egg': 'b79a8a403e4502fbb85ee3f1941735cb', |
|---|
| 31 | + 'setuptools-0.6b2-py2.3.egg': '5657759d8a6d8fc44070a9d07272d99b', |
|---|
| 32 | + 'setuptools-0.6b2-py2.4.egg': '4996a8d169d2be661fa32a6e52e4f82a', |
|---|
| 33 | + 'setuptools-0.6b3-py2.3.egg': 'bb31c0fc7399a63579975cad9f5a0618', |
|---|
| 34 | + 'setuptools-0.6b3-py2.4.egg': '38a8c6b3d6ecd22247f179f7da669fac', |
|---|
| 35 | + 'setuptools-0.6b4-py2.3.egg': '62045a24ed4e1ebc77fe039aa4e6f7e5', |
|---|
| 36 | + 'setuptools-0.6b4-py2.4.egg': '4cb2a185d228dacffb2d17f103b3b1c4', |
|---|
| 37 | + 'setuptools-0.6c1-py2.3.egg': 'b3f2b5539d65cb7f74ad79127f1a908c', |
|---|
| 38 | + 'setuptools-0.6c1-py2.4.egg': 'b45adeda0667d2d2ffe14009364f2a4b', |
|---|
| 39 | + 'setuptools-0.6c2-py2.3.egg': 'f0064bf6aa2b7d0f3ba0b43f20817c27', |
|---|
| 40 | + 'setuptools-0.6c2-py2.4.egg': '616192eec35f47e8ea16cd6a122b7277', |
|---|
| 41 | + 'setuptools-0.6c3-py2.3.egg': 'f181fa125dfe85a259c9cd6f1d7b78fa', |
|---|
| 42 | + 'setuptools-0.6c3-py2.4.egg': 'e0ed74682c998bfb73bf803a50e7b71e', |
|---|
| 43 | + 'setuptools-0.6c3-py2.5.egg': 'abef16fdd61955514841c7c6bd98965e', |
|---|
| 44 | + 'setuptools-0.6c4-py2.3.egg': 'b0b9131acab32022bfac7f44c5d7971f', |
|---|
| 45 | + 'setuptools-0.6c4-py2.4.egg': '2a1f9656d4fbf3c97bf946c0a124e6e2', |
|---|
| 46 | + 'setuptools-0.6c4-py2.5.egg': '8f5a052e32cdb9c72bcf4b5526f28afc', |
|---|
| 47 | + 'setuptools-0.6c5-py2.3.egg': 'ee9fd80965da04f2f3e6b3576e9d8167', |
|---|
| 48 | + 'setuptools-0.6c5-py2.4.egg': 'afe2adf1c01701ee841761f5bcd8aa64', |
|---|
| 49 | + 'setuptools-0.6c5-py2.5.egg': 'a8d3f61494ccaa8714dfed37bccd3d5d', |
|---|
| 50 | + 'setuptools-0.6c6-py2.3.egg': '35686b78116a668847237b69d549ec20', |
|---|
| 51 | + 'setuptools-0.6c6-py2.4.egg': '3c56af57be3225019260a644430065ab', |
|---|
| 52 | + 'setuptools-0.6c6-py2.5.egg': 'b2f8a7520709a5b34f80946de5f02f53', |
|---|
| 53 | + 'setuptools-0.6c7-py2.3.egg': '209fdf9adc3a615e5115b725658e13e2', |
|---|
| 54 | + 'setuptools-0.6c7-py2.4.egg': '5a8f954807d46a0fb67cf1f26c55a82e', |
|---|
| 55 | + 'setuptools-0.6c7-py2.5.egg': '45d2ad28f9750e7434111fde831e8372', |
|---|
| 56 | + 'setuptools-0.6c8-py2.3.egg': '50759d29b349db8cfd807ba8303f1902', |
|---|
| 57 | + 'setuptools-0.6c8-py2.4.egg': 'cba38d74f7d483c06e9daa6070cce6de', |
|---|
| 58 | + 'setuptools-0.6c8-py2.5.egg': '1721747ee329dc150590a58b3e1ac95b', |
|---|
| 59 | +} |
|---|
| 60 | + |
|---|
| 61 | +import sys, os |
|---|
| 62 | + |
|---|
| 63 | +def _validate_md5(egg_name, data): |
|---|
| 64 | + if egg_name in md5_data: |
|---|
| 65 | + from md5 import md5 |
|---|
| 66 | + digest = md5(data).hexdigest() |
|---|
| 67 | + if digest != md5_data[egg_name]: |
|---|
| 68 | + print >>sys.stderr, ( |
|---|
| 69 | + "md5 validation of %s failed! (Possible download problem?)" |
|---|
| 70 | + % egg_name |
|---|
| 71 | + ) |
|---|
| 72 | + sys.exit(2) |
|---|
| 73 | + return data |
|---|
| 74 | + |
|---|
| 75 | + |
|---|
| 76 | +def use_setuptools( |
|---|
| 77 | + version=DEFAULT_VERSION, download_base=DEFAULT_URL, to_dir=os.curdir, |
|---|
| 78 | + download_delay=15 |
|---|
| 79 | +): |
|---|
| 80 | + """Automatically find/download setuptools and make it available on sys.path |
|---|
| 81 | + |
|---|
| 82 | + `version` should be a valid setuptools version number that is available |
|---|
| 83 | + as an egg for download under the `download_base` URL (which should end with |
|---|
| 84 | + a '/'). `to_dir` is the directory where setuptools will be downloaded, if |
|---|
| 85 | + it is not already available. If `download_delay` is specified, it should |
|---|
| 86 | + be the number of seconds that will be paused before initiating a download, |
|---|
| 87 | + should one be required. If an older version of setuptools is installed, |
|---|
| 88 | + this routine will print a message to ``sys.stderr`` and raise SystemExit in |
|---|
| 89 | + an attempt to abort the calling script. |
|---|
| 90 | + """ |
|---|
| 91 | + was_imported = 'pkg_resources' in sys.modules or 'setuptools' in sys.modules |
|---|
| 92 | + def do_download(): |
|---|
| 93 | + egg = download_setuptools(version, download_base, to_dir, download_delay) |
|---|
| 94 | + sys.path.insert(0, egg) |
|---|
| 95 | + import setuptools; setuptools.bootstrap_install_from = egg |
|---|
| 96 | + try: |
|---|
| 97 | + import pkg_resources |
|---|
| 98 | + except ImportError: |
|---|
| 99 | + return do_download() |
|---|
| 100 | + try: |
|---|
| 101 | + pkg_resources.require("setuptools>="+version); return |
|---|
| 102 | + except pkg_resources.VersionConflict, e: |
|---|
| 103 | + if was_imported: |
|---|
| 104 | + print >>sys.stderr, ( |
|---|
| 105 | + "The required version of setuptools (>=%s) is not available, and\n" |
|---|
| 106 | + "can't be installed while this script is running. Please install\n" |
|---|
| 107 | + " a more recent version first, using 'easy_install -U setuptools'." |
|---|
| 108 | + "\n\n(Currently using %r)" |
|---|
| 109 | + ) % (version, e.args[0]) |
|---|
| 110 | + sys.exit(2) |
|---|
| 111 | + else: |
|---|
| 112 | + del pkg_resources, sys.modules['pkg_resources'] # reload ok |
|---|
| 113 | + return do_download() |
|---|
| 114 | + except pkg_resources.DistributionNotFound: |
|---|
| 115 | + return do_download() |
|---|
| 116 | + |
|---|
| 117 | +def download_setuptools( |
|---|
| 118 | + version=DEFAULT_VERSION, download_base=DEFAULT_URL, to_dir=os.curdir, |
|---|
| 119 | + delay = 15 |
|---|
| 120 | +): |
|---|
| 121 | + """Download setuptools from a specified location and return its filename |
|---|
| 122 | + |
|---|
| 123 | + `version` should be a valid setuptools version number that is available |
|---|
| 124 | + as an egg for download under the `download_base` URL (which should end |
|---|
| 125 | + with a '/'). `to_dir` is the directory where the egg will be downloaded. |
|---|
| 126 | + `delay` is the number of seconds to pause before an actual download attempt. |
|---|
| 127 | + """ |
|---|
| 128 | + import urllib2, shutil |
|---|
| 129 | + egg_name = "setuptools-%s-py%s.egg" % (version,sys.version[:3]) |
|---|
| 130 | + url = download_base + egg_name |
|---|
| 131 | + saveto = os.path.join(to_dir, egg_name) |
|---|
| 132 | + src = dst = None |
|---|
| 133 | + if not os.path.exists(saveto): # Avoid repeated downloads |
|---|
| 134 | + try: |
|---|
| 135 | + from distutils import log |
|---|
| 136 | + if delay: |
|---|
| 137 | + log.warn(""" |
|---|
| 138 | +--------------------------------------------------------------------------- |
|---|
| 139 | +This script requires setuptools version %s to run (even to display |
|---|
| 140 | +help). I will attempt to download it for you (from |
|---|
| 141 | +%s), but |
|---|
| 142 | +you may need to enable firewall access for this script first. |
|---|
| 143 | +I will start the download in %d seconds. |
|---|
| 144 | + |
|---|
| 145 | +(Note: if this machine does not have network access, please obtain the file |
|---|
| 146 | + |
|---|
| 147 | + %s |
|---|
| 148 | + |
|---|
| 149 | +and place it in this directory before rerunning this script.) |
|---|
| 150 | +---------------------------------------------------------------------------""", |
|---|
| 151 | + version, download_base, delay, url |
|---|
| 152 | + ); from time import sleep; sleep(delay) |
|---|
| 153 | + log.warn("Downloading %s", url) |
|---|
| 154 | + src = urllib2.urlopen(url) |
|---|
| 155 | + # Read/write all in one block, so we don't create a corrupt file |
|---|
| 156 | + # if the download is interrupted. |
|---|
| 157 | + data = _validate_md5(egg_name, src.read()) |
|---|
| 158 | + dst = open(saveto,"wb"); dst.write(data) |
|---|
| 159 | + finally: |
|---|
| 160 | + if src: src.close() |
|---|
| 161 | + if dst: dst.close() |
|---|
| 162 | + return os.path.realpath(saveto) |
|---|
| 163 | + |
|---|
| 164 | + |
|---|
| 165 | + |
|---|
| 166 | + |
|---|
| 167 | + |
|---|
| 168 | + |
|---|
| 169 | + |
|---|
| 170 | + |
|---|
| 171 | + |
|---|
| 172 | + |
|---|
| 173 | + |
|---|
| 174 | + |
|---|
| 175 | + |
|---|
| 176 | + |
|---|
| 177 | + |
|---|
| 178 | + |
|---|
| 179 | + |
|---|
| 180 | + |
|---|
| 181 | + |
|---|
| 182 | + |
|---|
| 183 | + |
|---|
| 184 | + |
|---|
| 185 | + |
|---|
| 186 | + |
|---|
| 187 | + |
|---|
| 188 | + |
|---|
| 189 | + |
|---|
| 190 | + |
|---|
| 191 | + |
|---|
| 192 | + |
|---|
| 193 | + |
|---|
| 194 | + |
|---|
| 195 | + |
|---|
| 196 | + |
|---|
| 197 | + |
|---|
| 198 | + |
|---|
| 199 | +def main(argv, version=DEFAULT_VERSION): |
|---|
| 200 | + """Install or upgrade setuptools and EasyInstall""" |
|---|
| 201 | + try: |
|---|
| 202 | + import setuptools |
|---|
| 203 | + except ImportError: |
|---|
| 204 | + egg = None |
|---|
| 205 | + try: |
|---|
| 206 | + egg = download_setuptools(version, delay=0) |
|---|
| 207 | + sys.path.insert(0,egg) |
|---|
| 208 | + from setuptools.command.easy_install import main |
|---|
| 209 | + return main(list(argv)+[egg]) # we're done here |
|---|
| 210 | + finally: |
|---|
| 211 | + if egg and os.path.exists(egg): |
|---|
| 212 | + os.unlink(egg) |
|---|
| 213 | + else: |
|---|
| 214 | + if setuptools.__version__ == '0.0.1': |
|---|
| 215 | + print >>sys.stderr, ( |
|---|
| 216 | + "You have an obsolete version of setuptools installed. Please\n" |
|---|
| 217 | + "remove it from your system entirely before rerunning this script." |
|---|
| 218 | + ) |
|---|
| 219 | + sys.exit(2) |
|---|
| 220 | + |
|---|
| 221 | + req = "setuptools>="+version |
|---|
| 222 | + import pkg_resources |
|---|
| 223 | + try: |
|---|
| 224 | + pkg_resources.require(req) |
|---|
| 225 | + except pkg_resources.VersionConflict: |
|---|
| 226 | + try: |
|---|
| 227 | + from setuptools.command.easy_install import main |
|---|
| 228 | + except ImportError: |
|---|
| 229 | + from easy_install import main |
|---|
| 230 | + main(list(argv)+[download_setuptools(delay=0)]) |
|---|
| 231 | + sys.exit(0) # try to force an exit |
|---|
| 232 | + else: |
|---|
| 233 | + if argv: |
|---|
| 234 | + from setuptools.command.easy_install import main |
|---|
| 235 | + main(argv) |
|---|
| 236 | + else: |
|---|
| 237 | + print "Setuptools version",version,"or greater has been installed." |
|---|
| 238 | + print '(Run "ez_setup.py -U setuptools" to reinstall or upgrade.)' |
|---|
| 239 | + |
|---|
| 240 | +def update_md5(filenames): |
|---|
| 241 | + """Update our built-in md5 registry""" |
|---|
| 242 | + |
|---|
| 243 | + import re |
|---|
| 244 | + from md5 import md5 |
|---|
| 245 | + |
|---|
| 246 | + for name in filenames: |
|---|
| 247 | + base = os.path.basename(name) |
|---|
| 248 | + f = open(name,'rb') |
|---|
| 249 | + md5_data[base] = md5(f.read()).hexdigest() |
|---|
| 250 | + f.close() |
|---|
| 251 | + |
|---|
| 252 | + data = [" %r: %r,\n" % it for it in md5_data.items()] |
|---|
| 253 | + data.sort() |
|---|
| 254 | + repl = "".join(data) |
|---|
| 255 | + |
|---|
| 256 | + import inspect |
|---|
| 257 | + srcfile = inspect.getsourcefile(sys.modules[__name__]) |
|---|
| 258 | + f = open(srcfile, 'rb'); src = f.read(); f.close() |
|---|
| 259 | + |
|---|
| 260 | + match = re.search("\nmd5_data = {\n([^}]+)}", src) |
|---|
| 261 | + if not match: |
|---|
| 262 | + print >>sys.stderr, "Internal error!" |
|---|
| 263 | + sys.exit(2) |
|---|
| 264 | + |
|---|
| 265 | + src = src[:match.start(1)] + repl + src[match.end(1):] |
|---|
| 266 | + f = open(srcfile,'w') |
|---|
| 267 | + f.write(src) |
|---|
| 268 | + f.close() |
|---|
| 269 | + |
|---|
| 270 | + |
|---|
| 271 | +if __name__=='__main__': |
|---|
| 272 | + if len(sys.argv)>2 and sys.argv[1]=='--md5update': |
|---|
| 273 | + update_md5(sys.argv[2:]) |
|---|
| 274 | + else: |
|---|
| 275 | + main(sys.argv[1:]) |
|---|
| 276 | + |
|---|
| 277 | + |
|---|
| 278 | + |
|---|
| 279 | + |
|---|
| 280 | + |
|---|
| 281 | addfile ./setup.cfg |
|---|
| 282 | hunk ./setup.cfg 1 |
|---|
| 283 | +[easy_install] |
|---|
| 284 | +find_links = http://buildbot.net |
|---|
| 285 | hunk ./setup.py 1 |
|---|
| 286 | -#! /usr/bin/env python |
|---|
| 287 | - |
|---|
| 288 | -import sys, os, re |
|---|
| 289 | -from distutils.core import setup |
|---|
| 290 | -from buildbot import version |
|---|
| 291 | - |
|---|
| 292 | -# Path: twisted!cvstoys!buildbot |
|---|
| 293 | -from distutils.command.install_data import install_data |
|---|
| 294 | -class install_data_twisted(install_data): |
|---|
| 295 | - """make sure data files are installed in package. |
|---|
| 296 | - this is evil. |
|---|
| 297 | - copied from Twisted/setup.py. |
|---|
| 298 | - """ |
|---|
| 299 | - def finalize_options(self): |
|---|
| 300 | - self.set_undefined_options('install', |
|---|
| 301 | - ('install_lib', 'install_dir') |
|---|
| 302 | - ) |
|---|
| 303 | - install_data.finalize_options(self) |
|---|
| 304 | - |
|---|
| 305 | -long_description=""" |
|---|
| 306 | -The BuildBot is a system to automate the compile/test cycle required by |
|---|
| 307 | -most software projects to validate code changes. By automatically |
|---|
| 308 | -rebuilding and testing the tree each time something has changed, build |
|---|
| 309 | -problems are pinpointed quickly, before other developers are |
|---|
| 310 | -inconvenienced by the failure. The guilty developer can be identified |
|---|
| 311 | -and harassed without human intervention. By running the builds on a |
|---|
| 312 | -variety of platforms, developers who do not have the facilities to test |
|---|
| 313 | -their changes everywhere before checkin will at least know shortly |
|---|
| 314 | -afterwards whether they have broken the build or not. Warning counts, |
|---|
| 315 | -lint checks, image size, compile time, and other build parameters can |
|---|
| 316 | -be tracked over time, are more visible, and are therefore easier to |
|---|
| 317 | -improve. |
|---|
| 318 | -""" |
|---|
| 319 | - |
|---|
| 320 | -scripts = ["bin/buildbot"] |
|---|
| 321 | -if sys.platform == "win32": |
|---|
| 322 | - scripts.append("contrib/windows/buildbot.bat") |
|---|
| 323 | - scripts.append("contrib/windows/buildbot_service.py") |
|---|
| 324 | - |
|---|
| 325 | -testmsgs = [] |
|---|
| 326 | -for f in os.listdir("buildbot/test/mail"): |
|---|
| 327 | - if f.endswith("~"): |
|---|
| 328 | - continue |
|---|
| 329 | - if re.search(r'\.\d+$', f): |
|---|
| 330 | - testmsgs.append("buildbot/test/mail/%s" % f) |
|---|
| 331 | - |
|---|
| 332 | -setup_args = { |
|---|
| 333 | - 'name': "buildbot", |
|---|
| 334 | - 'version': version, |
|---|
| 335 | - 'description': "BuildBot build automation system", |
|---|
| 336 | - 'long_description': long_description, |
|---|
| 337 | - 'author': "Brian Warner", |
|---|
| 338 | - 'author_email': "warner-buildbot@lothar.com", |
|---|
| 339 | - 'url': "http://buildbot.net/", |
|---|
| 340 | - 'license': "GNU GPL", |
|---|
| 341 | - # does this classifiers= mean that this can't be installed on 2.2/2.3? |
|---|
| 342 | - 'classifiers': [ |
|---|
| 343 | - 'Development Status :: 4 - Beta', |
|---|
| 344 | - 'Environment :: No Input/Output (Daemon)', |
|---|
| 345 | - 'Environment :: Web Environment', |
|---|
| 346 | - 'Intended Audience :: Developers', |
|---|
| 347 | - 'License :: OSI Approved :: GNU General Public License (GPL)', |
|---|
| 348 | - 'Topic :: Software Development :: Build Tools', |
|---|
| 349 | - 'Topic :: Software Development :: Testing', |
|---|
| 350 | - ], |
|---|
| 351 | - |
|---|
| 352 | - 'packages': ["buildbot", |
|---|
| 353 | - "buildbot.status", "buildbot.status.web", |
|---|
| 354 | - "buildbot.changes", |
|---|
| 355 | - "buildbot.steps", |
|---|
| 356 | - "buildbot.process", |
|---|
| 357 | - "buildbot.clients", |
|---|
| 358 | - "buildbot.slave", |
|---|
| 359 | - "buildbot.scripts", |
|---|
| 360 | - "buildbot.test", |
|---|
| 361 | - ], |
|---|
| 362 | - 'data_files': [("buildbot", ["buildbot/buildbot.png"]), |
|---|
| 363 | - ("buildbot/clients", ["buildbot/clients/debug.glade"]), |
|---|
| 364 | - ("buildbot/status/web", |
|---|
| 365 | - ["buildbot/status/web/classic.css", |
|---|
| 366 | - "buildbot/status/web/index.html", |
|---|
| 367 | - "buildbot/status/web/robots.txt", |
|---|
| 368 | - ]), |
|---|
| 369 | - ("buildbot/scripts", ["buildbot/scripts/sample.cfg"]), |
|---|
| 370 | - ("buildbot/test/mail", testmsgs), |
|---|
| 371 | - ("buildbot/test/subdir", ["buildbot/test/subdir/emit.py"]), |
|---|
| 372 | - ], |
|---|
| 373 | - 'scripts ': scripts, |
|---|
| 374 | - 'cmdclass': {'install_data': install_data_twisted}, |
|---|
| 375 | - } |
|---|
| 376 | - |
|---|
| 377 | -try: |
|---|
| 378 | - # If setuptools is installed, then we'll add setuptools-specific arguments |
|---|
| 379 | - # to the setup args. |
|---|
| 380 | - import setuptools |
|---|
| 381 | -except ImportError: |
|---|
| 382 | - pass |
|---|
| 383 | -else: |
|---|
| 384 | - setup_args['install_requires'] = ['twisted >= 2.4.0'] |
|---|
| 385 | - entry_points={ |
|---|
| 386 | - 'console_scripts': [ |
|---|
| 387 | - 'buildbot = buildbot.scripts.runner:run' |
|---|
| 388 | - ] |
|---|
| 389 | - }, |
|---|
| 390 | - |
|---|
| 391 | -setup(**setup_args) |
|---|
| 392 | - |
|---|
| 393 | -# Local Variables: |
|---|
| 394 | -# fill-column: 71 |
|---|
| 395 | -# End: |
|---|
| 396 | +#! /usr/bin/env python |
|---|
| 397 | +"""The BuildBot is a system to automate the compile/test cycle |
|---|
| 398 | +required by most software projects to validate code changes. |
|---|
| 399 | +By automatically rebuilding and testing the tree each time |
|---|
| 400 | +something has changed, build problems are pinpointed quickly, |
|---|
| 401 | +before other developers are inconvenienced by the failure. |
|---|
| 402 | +The guilty developer can be identified and harassed without |
|---|
| 403 | +human intervention. By running the builds on a variety of platforms, |
|---|
| 404 | +developers who do not have the facilities to test their changes |
|---|
| 405 | +everywhere before checkin will at least know shortly afterwards |
|---|
| 406 | +whether they have broken the build or not. Warning counts, |
|---|
| 407 | +lint checks, image size, compile time, and other build parameters |
|---|
| 408 | +can be tracked over time, are more visible, and are therefore |
|---|
| 409 | +easier to improve. |
|---|
| 410 | +""" |
|---|
| 411 | + |
|---|
| 412 | +import sys, os, re |
|---|
| 413 | +from buildbot import version |
|---|
| 414 | + |
|---|
| 415 | +try: |
|---|
| 416 | + # you could use ez_setup, if you think all buildbot users want setuptools. |
|---|
| 417 | + # you would want to distribute ez_setup with your package. |
|---|
| 418 | + #from ez_setup import use_setuptools() |
|---|
| 419 | + #use_setuptools() |
|---|
| 420 | + from setuptools import setup, find_packages |
|---|
| 421 | +except ImportError: |
|---|
| 422 | + from distutils.core import setup |
|---|
| 423 | + |
|---|
| 424 | +# Path: twisted!cvstoys!buildbot |
|---|
| 425 | +from distutils.command.install_data import install_data |
|---|
| 426 | +class install_data_twisted(install_data): |
|---|
| 427 | + """make sure data files are installed in package. |
|---|
| 428 | + this is evil. |
|---|
| 429 | + copied from Twisted/setup.py. |
|---|
| 430 | + """ |
|---|
| 431 | + def finalize_options(self): |
|---|
| 432 | + self.set_undefined_options('install', |
|---|
| 433 | + ('install_lib', 'install_dir') |
|---|
| 434 | + ) |
|---|
| 435 | + install_data.finalize_options(self) |
|---|
| 436 | + |
|---|
| 437 | +scripts = ["bin/buildbot"] |
|---|
| 438 | +if sys.platform == "win32": |
|---|
| 439 | + if hasattr(sys,'getwindowsversion'): |
|---|
| 440 | + major, minor, build, platform, text = sys.getwindowsversion() |
|---|
| 441 | + #(5, 1, 2600, 2, 'Service Pack 2') |
|---|
| 442 | + """ |
|---|
| 443 | + Return a tuple containing five components, describing the Windows version currently running. The elements are major, minor, build, platform, and text. text contains a string while all other values are integers. |
|---|
| 444 | + platform may be one of the following values: |
|---|
| 445 | + Constant Platform |
|---|
| 446 | + 0 (VER_PLATFORM_WIN32s) Win32s on Windows 3.1 |
|---|
| 447 | + 1 (VER_PLATFORM_WIN32_WINDOWS) Windows 95/98/ME |
|---|
| 448 | + 2 (VER_PLATFORM_WIN32_NT) Windows NT/2000/XP |
|---|
| 449 | + 3 (VER_PLATFORM_WIN32_CE) Windows CE |
|---|
| 450 | + |
|---|
| 451 | + This function wraps the Win32 GetVersionEx() function; see the Microsoft documentation for more information about these fields. |
|---|
| 452 | + Availability: Windows. New in version 2.3 |
|---|
| 453 | + """ |
|---|
| 454 | + if platform == 1: |
|---|
| 455 | + scripts.append("contrib/windows/buildbot.bat") |
|---|
| 456 | + elif platform == 2: |
|---|
| 457 | + # Um, what does Vista report as? |
|---|
| 458 | + scripts.append("contrib/windows/buildbot.cmd") |
|---|
| 459 | + scripts.append("contrib/windows/buildbot_service.py") |
|---|
| 460 | + else: |
|---|
| 461 | + scripts.append("contrib/windows/buildbot.bat") |
|---|
| 462 | + |
|---|
| 463 | +testmsgs = [] |
|---|
| 464 | +for f in os.listdir("buildbot/test/mail"): |
|---|
| 465 | + if f.endswith("~"): |
|---|
| 466 | + continue |
|---|
| 467 | + if re.search(r'\.\d+$', f): |
|---|
| 468 | + testmsgs.append("buildbot/test/mail/%s" % f) |
|---|
| 469 | + |
|---|
| 470 | +classifiers = [ |
|---|
| 471 | + 'Development Status :: 4 - Beta', |
|---|
| 472 | + 'Environment :: No Input/Output (Daemon)', |
|---|
| 473 | + 'Environment :: Web Environment', |
|---|
| 474 | + 'Intended Audience :: Developers', |
|---|
| 475 | + 'License :: OSI Approved :: GNU General Public License (GPL)', |
|---|
| 476 | + 'Topic :: Software Development :: Build Tools', |
|---|
| 477 | + 'Topic :: Software Development :: Testing', |
|---|
| 478 | + ] |
|---|
| 479 | + |
|---|
| 480 | +packages = ["buildbot", |
|---|
| 481 | + "buildbot.changes", |
|---|
| 482 | + "buildbot.clients", |
|---|
| 483 | + "buildbot.process", |
|---|
| 484 | + "buildbot.scripts", |
|---|
| 485 | + "buildbot.slave", |
|---|
| 486 | + "buildbot.status", "buildbot.status.web", |
|---|
| 487 | + "buildbot.steps", |
|---|
| 488 | + "buildbot.test", |
|---|
| 489 | + ] |
|---|
| 490 | + |
|---|
| 491 | +description = "BuildBot build automation system" |
|---|
| 492 | + |
|---|
| 493 | +name = "buildbot" |
|---|
| 494 | + |
|---|
| 495 | +author = "Brian Warner" |
|---|
| 496 | + |
|---|
| 497 | +data_files=[("buildbot", ["buildbot/buildbot.png"]), |
|---|
| 498 | + ("buildbot/clients", ["buildbot/clients/debug.glade"]), |
|---|
| 499 | + ("buildbot/status/web", |
|---|
| 500 | + ["buildbot/status/web/classic.css", |
|---|
| 501 | + "buildbot/status/web/index.html", |
|---|
| 502 | + "buildbot/status/web/robots.txt", |
|---|
| 503 | + ]), |
|---|
| 504 | + ("buildbot/scripts", ["buildbot/scripts/sample.cfg"]), |
|---|
| 505 | + ("buildbot/test/mail", testmsgs), |
|---|
| 506 | + ("buildbot/test/subdir", ["buildbot/test/subdir/emit.py"]), |
|---|
| 507 | + ] |
|---|
| 508 | + |
|---|
| 509 | +author_email = "warner-buildbot@lothar.com" |
|---|
| 510 | + |
|---|
| 511 | +cmdclass={'install_data': install_data_twisted} |
|---|
| 512 | + |
|---|
| 513 | +url = "http://buildbot.net/" |
|---|
| 514 | + |
|---|
| 515 | +license = "GNU GPL" |
|---|
| 516 | + |
|---|
| 517 | +# if you need a min version, state that. |
|---|
| 518 | +install_requires = ['twisted >= 2.4.0'] |
|---|
| 519 | + |
|---|
| 520 | +setup_args = { |
|---|
| 521 | + 'name' : name, |
|---|
| 522 | + 'version': version, |
|---|
| 523 | + 'description': description, |
|---|
| 524 | + 'long_description': __doc__, |
|---|
| 525 | + 'author': author, |
|---|
| 526 | + 'author_email': author_email, |
|---|
| 527 | + 'url': url, |
|---|
| 528 | + 'license': license, |
|---|
| 529 | + 'classifiers': classifiers, |
|---|
| 530 | + 'scripts': scripts, |
|---|
| 531 | + 'data_files': data_files, |
|---|
| 532 | + 'cmdclass': cmdclass, |
|---|
| 533 | + } |
|---|
| 534 | + |
|---|
| 535 | +#use different install args |
|---|
| 536 | +#depending on if user has setuptools. |
|---|
| 537 | +if 'find_packages' in dir(): |
|---|
| 538 | + setup_args['install_requires'] = install_requires |
|---|
| 539 | + setup_args['packages'] = find_packages() |
|---|
| 540 | + # But, maybe it's not zip-safe. |
|---|
| 541 | + # On win32 when omitted, |
|---|
| 542 | + # setuptools decides to put buildbot |
|---|
| 543 | + # in an egg dir, not .egg archive |
|---|
| 544 | + setup_args['zip_safe'] = True |
|---|
| 545 | + |
|---|
| 546 | + entry_points = { |
|---|
| 547 | + 'console_scripts': [ |
|---|
| 548 | + 'buildbot = buildbot.scripts.runner:run' |
|---|
| 549 | + ] |
|---|
| 550 | + }, |
|---|
| 551 | +else: |
|---|
| 552 | + setup_args['packages'] = packages |
|---|
| 553 | + |
|---|
| 554 | +setup(**setup_args) |
|---|
| 555 | + |
|---|
| 556 | +# Local Variables: |
|---|
| 557 | +# fill-column: 71 |
|---|
| 558 | +# End: |
|---|
| 559 | } |
|---|
| 560 | |
|---|
| 561 | [document changes to setup.py since it is mostly a reorg to make it legible to me and might be hard to diff visually. |
|---|
| 562 | erik@purins.com**20080503153917] { |
|---|
| 563 | hunk ./setup.py 16 |
|---|
| 564 | - |
|---|
| 565 | +# Moving the long description to __doc__ string puts the info at the top. |
|---|
| 566 | +# feels more like a module description there. |
|---|
| 567 | +# alternately, you could make it the doc string of buildbot and also |
|---|
| 568 | +# import that below like: |
|---|
| 569 | +# >>>from buildbot import __doc__ as long_description |
|---|
| 570 | hunk ./setup.py 47 |
|---|
| 571 | +# buildbot.bat is written for python23, but |
|---|
| 572 | +# buildbot2.bat looks xp-friendly. |
|---|
| 573 | +# renamed it so both can be invoked as 'buildbot' (cmd and bat are the same and can co-exist) |
|---|
| 574 | +# and only install xp .cmd on xp, only install service if computer is NT. |
|---|
| 575 | hunk ./setup.py 83 |
|---|
| 576 | +# split the assignment of setup arg values |
|---|
| 577 | +# so assigning to arg value and |
|---|
| 578 | +# running setup with args |
|---|
| 579 | +# is more clear. |
|---|
| 580 | + |
|---|
| 581 | hunk ./setup.py 98 |
|---|
| 582 | +#alphabatized. anal, I know. |
|---|
| 583 | hunk ./setup.py 136 |
|---|
| 584 | -# if you need a min version, state that. |
|---|
| 585 | hunk ./setup.py 139 |
|---|
| 586 | - 'name' : name, |
|---|
| 587 | - 'version': version, |
|---|
| 588 | - 'description': description, |
|---|
| 589 | + 'name' : name, |
|---|
| 590 | + 'version': version, |
|---|
| 591 | + 'description': description, |
|---|
| 592 | hunk ./setup.py 143 |
|---|
| 593 | - 'author': author, |
|---|
| 594 | - 'author_email': author_email, |
|---|
| 595 | - 'url': url, |
|---|
| 596 | - 'license': license, |
|---|
| 597 | - 'classifiers': classifiers, |
|---|
| 598 | - 'scripts': scripts, |
|---|
| 599 | - 'data_files': data_files, |
|---|
| 600 | - 'cmdclass': cmdclass, |
|---|
| 601 | + 'author': author, |
|---|
| 602 | + 'author_email': author_email, |
|---|
| 603 | + 'url': url, |
|---|
| 604 | + 'license': license, |
|---|
| 605 | + 'classifiers': classifiers, |
|---|
| 606 | + 'scripts': scripts, |
|---|
| 607 | + 'data_files': data_files, |
|---|
| 608 | + 'cmdclass': cmdclass, |
|---|
| 609 | hunk ./setup.py 155 |
|---|
| 610 | +#maybe find_packages() breaks your api by adding additional ones, I dunno. |
|---|
| 611 | +#but if you someday go all setuptools, |
|---|
| 612 | +#you can remove the explicit package list. |
|---|
| 613 | hunk ./setup.py 159 |
|---|
| 614 | - setup_args['install_requires'] = install_requires |
|---|
| 615 | hunk ./setup.py 160 |
|---|
| 616 | - # But, maybe it's not zip-safe. |
|---|
| 617 | - # On win32 when omitted, |
|---|
| 618 | - # setuptools decides to put buildbot |
|---|
| 619 | - # in an egg dir, not .egg archive |
|---|
| 620 | + setup_args['install_requires'] = install_requires |
|---|
| 621 | + # But, maybe it's not zip-safe. |
|---|
| 622 | + # On win32 when omitted, |
|---|
| 623 | + # setuptools decides to put buildbot |
|---|
| 624 | + # in an egg dir, not .egg archive |
|---|
| 625 | hunk ./setup.py 166 |
|---|
| 626 | - |
|---|
| 627 | } |
|---|
| 628 | |
|---|
| 629 | Context: |
|---|
| 630 | |
|---|
| 631 | [for source mode=copy, use cp -RPp instead of cp -r. Closes #86 |
|---|
| 632 | warner@lothar.com**20080429163120] |
|---|
| 633 | [sample.cfg: fix comments, closes #193 |
|---|
| 634 | warner@lothar.com**20080429162427] |
|---|
| 635 | [bonsaipoller: apply fixes from Ben Hearsum, closes #216 |
|---|
| 636 | warner@lothar.com**20080429162108] |
|---|
| 637 | [MailNotifier: add mode=passing. Closes #169 |
|---|
| 638 | warner@lothar.com**20080429160409] |
|---|
| 639 | [status/tinderbox.py: add useChangeTim= argument, closes #213 |
|---|
| 640 | warner@lothar.com**20080429154719] |
|---|
| 641 | [svnpoller: fix broken log message |
|---|
| 642 | warner@lothar.com**20080429154455] |
|---|
| 643 | [status/tinderbox.py: fix scope of logEncoding |
|---|
| 644 | warner@lothar.com**20080429154000] |
|---|
| 645 | [changelog for #231 patch |
|---|
| 646 | warner@lothar.com**20080429152845] |
|---|
| 647 | [#231:docs-fix.patch |
|---|
| 648 | dustin@v.igoro.us**20080412015359 |
|---|
| 649 | Small documentation patch by Christian Theune (ctheune) |
|---|
| 650 | ] |
|---|
| 651 | [changelog for zooko's optional-setuptools setup.py patches |
|---|
| 652 | warner@lothar.com**20080424224922] |
|---|
| 653 | [setup: add a console_scripts entry point so that if setuptools is present at install time an executable suitable for your platform will be created |
|---|
| 654 | zooko@zooko.com**20080415034501] |
|---|
| 655 | [setup: declare dependency on twisted >= 2.4.0 |
|---|
| 656 | zooko@zooko.com**20080415034224] |
|---|
| 657 | [changelog for zooko's non-behavior-changing setup.py patches |
|---|
| 658 | warner@lothar.com**20080424224658] |
|---|
| 659 | [shebang usr bin env python |
|---|
| 660 | zooko@zooko.com**20080415033828 |
|---|
| 661 | This makes it possible for me to execute "./setup.py", even on cygwin. |
|---|
| 662 | |
|---|
| 663 | ] |
|---|
| 664 | [setup: pass a dict of setup_args instead of passing a bunch of keyword args to setup |
|---|
| 665 | zooko@zooko.com**20080415033745 |
|---|
| 666 | (This is a preparation for adding optional setuptools features.) |
|---|
| 667 | ] |
|---|
| 668 | [add changelog for zooko's bin/buildbot patch |
|---|
| 669 | warner@lothar.com**20080424223548] |
|---|
| 670 | [shebang usr bin env python |
|---|
| 671 | zooko@zooko.com**20080313185918] |
|---|
| 672 | [README: add Twisted-8.0.1 to the list of known-good versions |
|---|
| 673 | warner@lothar.com**20080424221637] |
|---|
| 674 | [bump version to 0.7.7+ while between releases |
|---|
| 675 | warner@lothar.com**20080415203010] |
|---|
| 676 | [TAG buildbot-0.7.7 |
|---|
| 677 | warner@lothar.com**20080330025903] |
|---|
| 678 | Patch bundle hash: |
|---|
| 679 | d9a9ae3d59e6c1e8f9ebd13d155dd6e4b06ecacc |
|---|