[Checkins] SVN: z3c.quickentry/trunk/ - added buildout
Michael Howitz
mh at gocept.com
Mon Aug 23 02:51:06 EDT 2010
Log message for revision 115877:
- added buildout
- made python package
- fixed tests
- replaces zope.testing.doctest[unit] by python's doctest module
Changed:
_U z3c.quickentry/trunk/
A z3c.quickentry/trunk/CHANGES.txt
A z3c.quickentry/trunk/bootstrap.py
A z3c.quickentry/trunk/buildout.cfg
A z3c.quickentry/trunk/setup.py
A z3c.quickentry/trunk/src/z3c/__init__.py
U z3c.quickentry/trunk/src/z3c/quickentry/README.txt
U z3c.quickentry/trunk/src/z3c/quickentry/tests.py
-=-
Property changes on: z3c.quickentry/trunk
___________________________________________________________________
Added: svn:ignore
+ develop-eggs
bin
parts
.installed.cfg
Added: z3c.quickentry/trunk/CHANGES.txt
===================================================================
--- z3c.quickentry/trunk/CHANGES.txt (rev 0)
+++ z3c.quickentry/trunk/CHANGES.txt 2010-08-23 06:51:05 UTC (rev 115877)
@@ -0,0 +1,10 @@
+=========
+ Changes
+=========
+
+0.1 (unreleased)
+================
+
+- Initial public release.
+
+
Property changes on: z3c.quickentry/trunk/CHANGES.txt
___________________________________________________________________
Added: svn:keywords
+ Id Rev Date
Added: svn:eol-style
+ native
Copied: z3c.quickentry/trunk/bootstrap.py (from rev 115622, zc.buildout/trunk/bootstrap/bootstrap.py)
===================================================================
--- z3c.quickentry/trunk/bootstrap.py (rev 0)
+++ z3c.quickentry/trunk/bootstrap.py 2010-08-23 06:51:05 UTC (rev 115877)
@@ -0,0 +1,116 @@
+##############################################################################
+#
+# Copyright (c) 2006 Zope Foundation 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.
+"""
+
+import os, shutil, sys, tempfile, urllib2
+from optparse import OptionParser
+
+tmpeggs = tempfile.mkdtemp()
+
+is_jython = sys.platform.startswith('java')
+
+# parsing arguments
+parser = OptionParser()
+parser.add_option("-v", "--version", dest="version",
+ help="use a specific zc.buildout version")
+parser.add_option("-d", "--distribute",
+ action="store_true", dest="distribute", default=False,
+ help="Use Distribute rather than Setuptools.")
+
+parser.add_option("-c", None, action="store", dest="config_file",
+ help=("Specify the path to the buildout configuration "
+ "file to be used."))
+
+options, args = parser.parse_args()
+
+# if -c was provided, we push it back into args for buildout' main function
+if options.config_file is not None:
+ args += ['-c', options.config_file]
+
+if options.version is not None:
+ VERSION = '==%s' % options.version
+else:
+ VERSION = ''
+
+USE_DISTRIBUTE = options.distribute
+args = args + ['bootstrap']
+
+try:
+ import pkg_resources
+ import setuptools
+ if not hasattr(pkg_resources, '_distribute'):
+ raise ImportError
+except ImportError:
+ ez = {}
+ if USE_DISTRIBUTE:
+ exec urllib2.urlopen('http://python-distribute.org/distribute_setup.py'
+ ).read() in ez
+ ez['use_setuptools'](to_dir=tmpeggs, download_delay=0, no_fake=True)
+ else:
+ exec urllib2.urlopen('http://peak.telecommunity.com/dist/ez_setup.py'
+ ).read() in ez
+ ez['use_setuptools'](to_dir=tmpeggs, download_delay=0)
+
+ reload(sys.modules['pkg_resources'])
+ import pkg_resources
+
+if sys.platform == 'win32':
+ def quote(c):
+ if ' ' in c:
+ return '"%s"' % c # work around spawn lamosity on windows
+ else:
+ return c
+else:
+ def quote (c):
+ return c
+
+cmd = 'from setuptools.command.easy_install import main; main()'
+ws = pkg_resources.working_set
+
+if USE_DISTRIBUTE:
+ requirement = 'distribute'
+else:
+ requirement = 'setuptools'
+
+if is_jython:
+ import subprocess
+
+ assert subprocess.Popen([sys.executable] + ['-c', quote(cmd), '-mqNxd',
+ quote(tmpeggs), 'zc.buildout' + VERSION],
+ env=dict(os.environ,
+ PYTHONPATH=
+ ws.find(pkg_resources.Requirement.parse(requirement)).location
+ ),
+ ).wait() == 0
+
+else:
+ assert os.spawnle(
+ os.P_WAIT, sys.executable, quote (sys.executable),
+ '-c', quote (cmd), '-mqNxd', quote (tmpeggs), 'zc.buildout' + VERSION,
+ dict(os.environ,
+ PYTHONPATH=
+ ws.find(pkg_resources.Requirement.parse(requirement)).location
+ ),
+ ) == 0
+
+ws.add_entry(tmpeggs)
+ws.require('zc.buildout' + VERSION)
+import zc.buildout.buildout
+zc.buildout.buildout.main(args)
+shutil.rmtree(tmpeggs)
Copied: z3c.quickentry/trunk/buildout.cfg (from rev 115395, z3c.mountpoint/trunk/buildout.cfg)
===================================================================
--- z3c.quickentry/trunk/buildout.cfg (rev 0)
+++ z3c.quickentry/trunk/buildout.cfg 2010-08-23 06:51:05 UTC (rev 115877)
@@ -0,0 +1,7 @@
+[buildout]
+develop = .
+parts = test
+
+[test]
+recipe = zc.recipe.testrunner
+eggs = z3c.quickentry [test]
Copied: z3c.quickentry/trunk/setup.py (from rev 115401, z3c.mountpoint/trunk/setup.py)
===================================================================
--- z3c.quickentry/trunk/setup.py (rev 0)
+++ z3c.quickentry/trunk/setup.py 2010-08-23 06:51:05 UTC (rev 115877)
@@ -0,0 +1,65 @@
+##############################################################################
+#
+# Copyright (c) 2007-2009 Zope Foundation 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.
+#
+##############################################################################
+"""Setup
+
+$Id$
+"""
+import os
+from setuptools import setup, find_packages
+
+def read(*rnames):
+ return open(os.path.join(os.path.dirname(__file__), *rnames)).read()
+
+version = '0.1dev'
+
+setup(
+ name='z3c.quickentry',
+ version=version,
+ author = "Stephan Richter and the Zope Community",
+ author_email = "zope-dev at zope.org",
+ description = (
+ "Allows a user to efficiently specify multiple values in one larger text block."),
+ long_description=(
+ read('src', 'z3c', 'quickentry', 'README.txt')
+ + '\n\n' +
+ read('CHANGES.txt')
+ ),
+ license = "ZPL 2.1",
+ keywords = "zope3 ui user date entry",
+ classifiers = [
+ 'Development Status :: 3 - Alpha',
+ 'Environment :: Web Environment',
+ 'Intended Audience :: Developers',
+ 'License :: OSI Approved :: Zope Public License',
+ 'Programming Language :: Python',
+ 'Natural Language :: English',
+ 'Operating System :: OS Independent',
+ 'Topic :: Internet :: WWW/HTTP',
+ 'Framework :: Zope3'],
+ url = 'http://pypi.python.org/pypi/z3c.quickentry',
+ packages = find_packages('src'),
+ package_dir = {'':'src'},
+ namespace_packages = ['z3c'],
+ extras_require = dict(
+ test = [
+ 'zope.testing',
+ 'zope.app.testing',
+ ],
+ ),
+ install_requires = [
+ 'setuptools',
+ ],
+ include_package_data = True,
+ zip_safe = False,
+ )
Copied: z3c.quickentry/trunk/src/z3c/__init__.py (from rev 115396, z3c.mountpoint/trunk/src/z3c/__init__.py)
===================================================================
--- z3c.quickentry/trunk/src/z3c/__init__.py (rev 0)
+++ z3c.quickentry/trunk/src/z3c/__init__.py 2010-08-23 06:51:05 UTC (rev 115877)
@@ -0,0 +1 @@
+__import__('pkg_resources').declare_namespace(__name__)
Modified: z3c.quickentry/trunk/src/z3c/quickentry/README.txt
===================================================================
--- z3c.quickentry/trunk/src/z3c/quickentry/README.txt 2010-08-23 06:35:34 UTC (rev 115876)
+++ z3c.quickentry/trunk/src/z3c/quickentry/README.txt 2010-08-23 06:51:05 UTC (rev 115877)
@@ -133,6 +133,7 @@
Let's also make sure it is processed correctly:
+ >>> from pprint import pprint
>>> pprint(AgeGenderPlugin('27M').process(None))
{'age': 27, 'gender': u'M'}
>>> pprint(AgeGenderPlugin('8F').process(None))
Modified: z3c.quickentry/trunk/src/z3c/quickentry/tests.py
===================================================================
--- z3c.quickentry/trunk/src/z3c/quickentry/tests.py 2010-08-23 06:35:34 UTC (rev 115876)
+++ z3c.quickentry/trunk/src/z3c/quickentry/tests.py 2010-08-23 06:51:05 UTC (rev 115877)
@@ -17,20 +17,15 @@
"""
__docformat__ = "reStructuredText"
-import unittest
-from zope.testing import doctest
-from zope.testing import doctestunit
from zope.app.testing import placelesssetup
+import doctest
+import unittest
def test_suite():
return unittest.TestSuite((
- doctestunit.DocFileSuite(
+ doctest.DocFileSuite(
'README.txt',
- globs={'pprint': doctestunit.pprint},
setUp=placelesssetup.setUp, tearDown=placelesssetup.tearDown,
optionflags=doctest.NORMALIZE_WHITESPACE|doctest.ELLIPSIS,
),
))
-
-if __name__ == '__main__':
- unittest.main(defaultTest='test_suite')
More information about the checkins
mailing list