[Zope3-checkins] SVN: zope.testing/trunk/ Converted to a buildout.
Jim Fulton
jim at zope.com
Wed Sep 20 15:00:29 EDT 2006
Log message for revision 70262:
Converted to a buildout.
Changed:
U zope.testing/trunk/INSTALL.txt
A zope.testing/trunk/bootstrap.py
A zope.testing/trunk/buildout.cfg
D zope.testing/trunk/test.py
-=-
Modified: zope.testing/trunk/INSTALL.txt
===================================================================
--- zope.testing/trunk/INSTALL.txt 2006-09-20 18:52:04 UTC (rev 70261)
+++ zope.testing/trunk/INSTALL.txt 2006-09-20 19:00:29 UTC (rev 70262)
@@ -1,72 +1,23 @@
Installing This Package
=======================
-Prerequisites
--------------
+This software is distributed via distutils source distributions and
+Python eggs and is installed in the usual ways.
-The installation steps below assume that you have the cool new 'setuptools'
-package installed in your Python. Here is where to get it:
-
- $ wget http://peak.telecommunity.com/dist/ez_setup.py
- $ /path/to/your/python ez_setup.py # req. write access to 'site-packages'
-
-
- - Docs for EasyInstall:
- http://peak.telecommunity.com/DevCenter/EasyInstall
-
- - Docs for setuptools:
- http://peak.telecommunity.com/DevCenter/setuptools
-
- - Docs for eggs:
- http://peak.telecommunity.com/DevCenter/PythonEggs
-
-
Installing a Development Checkout
---------------------------------
-Check out the package from subversion:
+Run bootstrap.py to create a buildout script::
- $ svn co svn+ssh://svn.zope.org/repos/main/zope.testing/trunk \
- src/zope.testing
- $ cd src/zope.testing
+ python bootstrap.py
-Install it as a "devlopment egg" (which also installs its "hard"
-dependencies):
+Run the generated buildout script::
- $ /path/to/your/python setup.py devel
+ bin/buildout
-The installation of dependency eggs uses the 'setup.cfg' file in
-the checkout. You can supply '--find-links' on the command line to
-point it at a non-standard package repository.
-
-
Running the Tests
-----------------
-You can then run the tests from the checkout directory:
+You can then run the tests from the checkout directory::
- $ /path/to/your/python test.py
- Running:
- .............
- Ran 13 tests with 0 failures and 0 errors in 0.094 seconds.
-
-
-Installing a Source Distribution
---------------------------------
-
-You can also install it from a source distribution:
-
- $ /path/to/easy_install --find-links="...." -eb src zope.testing
- $ cd src/zope.testing
- $ /path/to/your/python setup.py devel
-
-
-Installing a Binary Egg
------------------------
-
-Install the package as a "binary egg" (which also installs its "hard"
-dependencies):
-
- $ /path/to/easy_install --find-links="...." zope.testing
-
-
+ bin/test
Added: zope.testing/trunk/bootstrap.py
===================================================================
--- zope.testing/trunk/bootstrap.py 2006-09-20 18:52:04 UTC (rev 70261)
+++ zope.testing/trunk/bootstrap.py 2006-09-20 19:00:29 UTC (rev 70262)
@@ -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$
+"""
+
+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)
Property changes on: zope.testing/trunk/bootstrap.py
___________________________________________________________________
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
Added: zope.testing/trunk/buildout.cfg
===================================================================
--- zope.testing/trunk/buildout.cfg 2006-09-20 18:52:04 UTC (rev 70261)
+++ zope.testing/trunk/buildout.cfg 2006-09-20 19:00:29 UTC (rev 70262)
@@ -0,0 +1,8 @@
+[buildout]
+develop = .
+parts = test
+
+[test]
+recipe = zc.recipe.testrunner
+eggs = zope.testing
+
Property changes on: zope.testing/trunk/buildout.cfg
___________________________________________________________________
Name: svn:eol-style
+ native
Deleted: zope.testing/trunk/test.py
===================================================================
--- zope.testing/trunk/test.py 2006-09-20 18:52:04 UTC (rev 70261)
+++ zope.testing/trunk/test.py 2006-09-20 19:00:29 UTC (rev 70262)
@@ -1,34 +0,0 @@
-#!/usr/bin/env python
-##############################################################################
-#
-# Copyright (c) 2004 Zope Corporation and Contributors.
-# All Rights Reserved.
-#
-# This software is subject to the provisions of the Zope Public License,
-# Version 2.0 (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.
-#
-##############################################################################
-"""Sample test script using zope.testing.testrunner
-
-see zope.testing testrunner.txt
-
-$Id$
-"""
-
-import os, sys
-
-src = os.path.join(os.path.split(sys.argv[0])[0], 'src')
-sys.path.insert(0, src) # put at beginning to avoid one in site_packages
-
-from zope.testing import testrunner
-
-defaults = [
- '--path', src,
- '--tests-pattern', '^tests$',
- ]
-
-sys.exit(testrunner.run(defaults))
More information about the Zope3-Checkins
mailing list