Start using buildout to bring in external dependencies.
This makes running tests easier in situations where dependencies are not always available, such as buildbot.
Thanks to Matthew Wilkes <matthew@matthewwilkes.co.uk> for help and moral support.
--- a/.hgignore Fri Jul 10 12:09:09 2009 +0200
+++ b/.hgignore Tue Jul 07 20:17:23 2009 -0500
@@ -12,6 +12,12 @@
*,cover
tests/.coverage
*.git
+*.egg-info
+eggs
+parts
+.installed.cfg
+bin
+develop-eggs
.gitignore
.DS_Store
.settings
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/bootstrap.py Tue Jul 07 20:17:23 2009 -0500
@@ -0,0 +1,52 @@
+##############################################################################
+#
+# Copyright (c) 2006 Zope Corporation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""Bootstrap a buildout-based project
+
+Simply run this script in a directory containing a buildout.cfg.
+The script accepts buildout command-line options, so you can
+use the -c option to specify an alternate configuration file.
+
+$Id: bootstrap.py 73144 2007-03-12 05:25:36Z baijum $
+"""
+
+import os, shutil, sys, tempfile, urllib2
+
+tmpeggs = tempfile.mkdtemp()
+
+ez = {}
+exec urllib2.urlopen('http://peak.telecommunity.com/dist/ez_setup.py'
+ ).read() in ez
+ez['use_setuptools'](to_dir=tmpeggs, download_delay=0)
+
+import pkg_resources
+
+cmd = 'from setuptools.command.easy_install import main; main()'
+if sys.platform == 'win32':
+ cmd = '"%s"' % cmd # work around spawn lamosity on windows
+
+ws = pkg_resources.working_set
+assert os.spawnle(
+ os.P_WAIT, sys.executable, sys.executable,
+ '-c', cmd, '-mqNxd', tmpeggs, 'zc.buildout',
+ dict(os.environ,
+ PYTHONPATH=
+ ws.find(pkg_resources.Requirement.parse('setuptools')).location
+ ),
+ ) == 0
+
+ws.add_entry(tmpeggs)
+ws.require('zc.buildout')
+import zc.buildout.buildout
+zc.buildout.buildout.main(sys.argv[1:] + ['bootstrap'])
+shutil.rmtree(tmpeggs)
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildout.cfg Tue Jul 07 20:17:23 2009 -0500
@@ -0,0 +1,44 @@
+[buildout]
+parts =
+ python
+ omelette
+develop =
+ .
+ thirdparty/google_appengine/lib/django
+ thirdparty/google_appengine/lib/yaml
+ thirdparty/google_appengine/lib/webob
+# commented out because antlr3 doesn't succeed at setup.py
+# thirdparty/google_appengine/lib/antlr3
+# commented out because doing so causes changes to the included version
+# thirdparty/coverage
+eggs =
+ melange
+ PyYAML
+ WebOb
+ gaeftest
+ zope.testbrowser
+ Paver
+ pylint
+# ditto above per-package
+# antlr_python_runtime
+# coverage
+
+[python]
+recipe = zc.recipe.egg
+interpreter = python
+eggs =
+ ${buildout:eggs}
+extra-paths =
+ ${buildout:directory}/app
+ ${buildout:directory}/thirdparty
+ ${buildout:directory}/thirdparty/google_appengine
+ ${buildout:directory}/thirdparty/google_appengine/lib
+ ${buildout:directory}/thirdparty/google_appengine/google
+
+[omelette]
+recipe = collective.recipe.omelette
+eggs =
+ ${python:eggs}
+packages =
+ ${buildout:directory}/app ./app
+ ${buildout:directory}/thirdparty/google_appengine/google ./google
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/setup.py Tue Jul 07 20:17:23 2009 -0500
@@ -0,0 +1,37 @@
+"""Minimal setup script to appease buildout for Melange.
+"""
+import os
+import re
+from setuptools import setup, find_packages
+
+match_version = re.compile("version: ([0-9\-]+)")
+try:
+ appyaml = open(os.path.join("app", "app.yaml.template"))
+ version = match_version.findall(appyaml.read())[0]
+except:
+ version = "UNKNOWN"
+
+
+setup(
+ name = 'melange',
+ description=("The goal of this project is to create a framework for "
+ "representing Open Source contribution workflows, such as"
+ " the existing Google Summer of Code TM (GSoC) program."),
+ version = version,
+ packages = find_packages(exclude=['app.django.*','thirdparty','parts']),
+ author=open("AUTHORS").read(),
+ url='http://code.google.com/p/soc',
+ license='Apache2',
+ install_requires = [
+ ],
+ tests_require=[
+ 'zope.testbrowser',
+ 'gaeftest',
+ 'nose',
+ ],
+ entry_points = {'console_scripts': ['run-tests = tests.run:main',
+ ],
+ },
+ include_package_data = True,
+ zip_safe = False,
+ )