[Checkins] SVN: z3c.recipe.subprocess/trunk/ Paste script layout

Ross Patterson me at rpatterson.net
Wed Dec 19 11:40:26 EST 2007


Log message for revision 82360:
  Paste script layout
  

Changed:
  A   z3c.recipe.subprocess/trunk/bootstrap.py
  A   z3c.recipe.subprocess/trunk/buildout.cfg
  A   z3c.recipe.subprocess/trunk/paste.cfg
  A   z3c.recipe.subprocess/trunk/setup.py
  A   z3c.recipe.subprocess/trunk/z3c/
  A   z3c.recipe.subprocess/trunk/z3c/__init__.py
  A   z3c.recipe.subprocess/trunk/z3c/recipe/
  A   z3c.recipe.subprocess/trunk/z3c/recipe/__init__.py
  A   z3c.recipe.subprocess/trunk/z3c/recipe/subprocess/
  A   z3c.recipe.subprocess/trunk/z3c/recipe/subprocess/README.txt
  A   z3c.recipe.subprocess/trunk/z3c/recipe/subprocess/__init__.py
  A   z3c.recipe.subprocess/trunk/z3c/recipe/subprocess/docs/
  A   z3c.recipe.subprocess/trunk/z3c/recipe/subprocess/docs/README.txt
  A   z3c.recipe.subprocess/trunk/z3c/recipe/subprocess/tests/
  A   z3c.recipe.subprocess/trunk/z3c/recipe/subprocess/tests/__init__.py
  A   z3c.recipe.subprocess/trunk/z3c/recipe/subprocess/tests/test_docs.py

-=-
Added: z3c.recipe.subprocess/trunk/bootstrap.py
===================================================================
--- z3c.recipe.subprocess/trunk/bootstrap.py	                        (rev 0)
+++ z3c.recipe.subprocess/trunk/bootstrap.py	2007-12-19 16:40:25 UTC (rev 82360)
@@ -0,0 +1,53 @@
+##############################################################################
+#
+# 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)
+

Added: z3c.recipe.subprocess/trunk/buildout.cfg
===================================================================
--- z3c.recipe.subprocess/trunk/buildout.cfg	                        (rev 0)
+++ z3c.recipe.subprocess/trunk/buildout.cfg	2007-12-19 16:40:25 UTC (rev 82360)
@@ -0,0 +1,8 @@
+[buildout]
+develop = .
+parts = test
+
+[test]
+recipe = zc.recipe.testrunner
+eggs = z3c.recipe.subprocess [test]
+

Added: z3c.recipe.subprocess/trunk/paste.cfg
===================================================================
--- z3c.recipe.subprocess/trunk/paste.cfg	                        (rev 0)
+++ z3c.recipe.subprocess/trunk/paste.cfg	2007-12-19 16:40:25 UTC (rev 82360)
@@ -0,0 +1,16 @@
+[pastescript]
+# python2.4 /usr/bin/paster create -t recipe --config=paste.cfg --svn-repository=svn+ssh://rossp@svn.zope.org/repos/main z3c.recipe.subprocess &
+namespace_package = z3c
+namespace_package2 = recipe
+egg = z3c.recipe.subprocess
+url = http://cheeseshop.python.org/pypi/z3c.recipe.subprocess
+description = Generate buildout scripts for starting and stopping processes
+author = Ross Patterson
+author_email = me at rpatterson.net
+license_name = GPL
+version = 0.1
+plus = +
+zip_safe = False
+keywords = 
+long_description = 
+dot = .

Added: z3c.recipe.subprocess/trunk/setup.py
===================================================================
--- z3c.recipe.subprocess/trunk/setup.py	                        (rev 0)
+++ z3c.recipe.subprocess/trunk/setup.py	2007-12-19 16:40:25 UTC (rev 82360)
@@ -0,0 +1,45 @@
+# -*- coding: utf-8 -*-
+"""
+This module contains the tool of z3c.recipe.subprocess
+"""
+import os
+from setuptools import setup, find_packages
+
+version = '0.1'
+
+README = os.path.join(os.path.dirname(__file__), 
+                      'z3c',
+                      'recipe',
+                      'subprocess', 'docs', 'README.txt')
+
+long_description = open(README).read() + '\n\n' 
+
+entry_point = 'z3c.recipe.subprocess:Recipe'
+
+entry_points = {"zc.buildout": ["default = %s" % entry_point]}
+
+setup(name='z3c.recipe.subprocess',
+      version=version,
+      description="Generate buildout scripts for starting and stopping processes",
+      long_description=long_description,
+      # Get more strings from http://www.python.org/pypi?%3Aaction=list_classifiers
+      classifiers=[
+        "Programming Language :: Python",
+        "Topic :: Software Development :: Libraries :: Python Modules",
+        ],
+      keywords='',
+      author='Ross Patterson',
+      author_email='me at rpatterson.net',
+      url='http://cheeseshop.python.org/pypi/z3c.recipe.subprocess',
+      license='GPL',
+      packages=find_packages(exclude=['ez_setup']),
+      namespace_packages=['z3c.recipe'],
+      include_package_data=True,
+      zip_safe=True,
+      install_requires=['setuptools',
+                        'zope.testing',
+                        'zc.buildout'
+                        # -*- Extra requirements: -*-
+                        ],
+      entry_points=entry_points,
+      )

Added: z3c.recipe.subprocess/trunk/z3c/__init__.py
===================================================================
--- z3c.recipe.subprocess/trunk/z3c/__init__.py	                        (rev 0)
+++ z3c.recipe.subprocess/trunk/z3c/__init__.py	2007-12-19 16:40:25 UTC (rev 82360)
@@ -0,0 +1,6 @@
+# See http://peak.telecommunity.com/DevCenter/setuptools#namespace-packages
+try:
+    __import__('pkg_resources').declare_namespace(__name__)
+except ImportError:
+    from pkgutil import extend_path
+    __path__ = extend_path(__path__, __name__)

Added: z3c.recipe.subprocess/trunk/z3c/recipe/__init__.py
===================================================================
--- z3c.recipe.subprocess/trunk/z3c/recipe/__init__.py	                        (rev 0)
+++ z3c.recipe.subprocess/trunk/z3c/recipe/__init__.py	2007-12-19 16:40:25 UTC (rev 82360)
@@ -0,0 +1,6 @@
+# See http://peak.telecommunity.com/DevCenter/setuptools#namespace-packages
+try:
+    __import__('pkg_resources').declare_namespace(__name__)
+except ImportError:
+    from pkgutil import extend_path
+    __path__ = extend_path(__path__, __name__)

Added: z3c.recipe.subprocess/trunk/z3c/recipe/subprocess/README.txt
===================================================================
--- z3c.recipe.subprocess/trunk/z3c/recipe/subprocess/README.txt	                        (rev 0)
+++ z3c.recipe.subprocess/trunk/z3c/recipe/subprocess/README.txt	2007-12-19 16:40:25 UTC (rev 82360)
@@ -0,0 +1,2 @@
+see docs/README.txt
+

Added: z3c.recipe.subprocess/trunk/z3c/recipe/subprocess/__init__.py
===================================================================
--- z3c.recipe.subprocess/trunk/z3c/recipe/subprocess/__init__.py	                        (rev 0)
+++ z3c.recipe.subprocess/trunk/z3c/recipe/subprocess/__init__.py	2007-12-19 16:40:25 UTC (rev 82360)
@@ -0,0 +1,19 @@
+# -*- coding: utf-8 -*-
+"""Recipe subprocess"""
+
+class Recipe(object):
+    """This recipe is used by zc.buildout"""
+
+    def __init__(self, buildout, name, options):
+        self.name, self.options = name, options
+
+    def install(self):
+        """installer"""
+        # XXX do the job here
+        # returns installed files
+        return tuple()
+
+    def update(self):
+        """updater"""
+        pass
+

Added: z3c.recipe.subprocess/trunk/z3c/recipe/subprocess/docs/README.txt
===================================================================
--- z3c.recipe.subprocess/trunk/z3c/recipe/subprocess/docs/README.txt	                        (rev 0)
+++ z3c.recipe.subprocess/trunk/z3c/recipe/subprocess/docs/README.txt	2007-12-19 16:40:25 UTC (rev 82360)
@@ -0,0 +1,19 @@
+================
+z3c.recipe.subprocess package
+================
+
+.. contents::
+
+What is z3c.recipe.subprocess ?
+==================
+
+Explain here what is the purpose of z3c.recipe.subprocess.
+
+How to use z3c.recipe.subprocess ?
+=====================
+
+Explain here how the package is used. Points to doctests here !
+
+
+
+

Added: z3c.recipe.subprocess/trunk/z3c/recipe/subprocess/tests/__init__.py
===================================================================
--- z3c.recipe.subprocess/trunk/z3c/recipe/subprocess/tests/__init__.py	                        (rev 0)
+++ z3c.recipe.subprocess/trunk/z3c/recipe/subprocess/tests/__init__.py	2007-12-19 16:40:25 UTC (rev 82360)
@@ -0,0 +1 @@
+

Added: z3c.recipe.subprocess/trunk/z3c/recipe/subprocess/tests/test_docs.py
===================================================================
--- z3c.recipe.subprocess/trunk/z3c/recipe/subprocess/tests/test_docs.py	                        (rev 0)
+++ z3c.recipe.subprocess/trunk/z3c/recipe/subprocess/tests/test_docs.py	2007-12-19 16:40:25 UTC (rev 82360)
@@ -0,0 +1,51 @@
+# -*- coding: utf-8 -*-
+"""
+Generic Test case for 'z3c.recipe.subprocess' doctest
+"""
+__docformat__ = 'restructuredtext'
+
+import unittest
+import doctest
+import sys
+import os
+
+from zope.testing import doctest
+
+current_dir = os.path.dirname(__file__)
+
+def doc_suite(test_dir, setUp=None, tearDown=None, globs=None):
+    """Returns a test suite, based on doctests found in /doctest."""
+    suite = []
+    if globs is None:
+        globs = globals()
+
+    globs['test_dir'] = current_dir
+    
+    flags = (doctest.ELLIPSIS | doctest.NORMALIZE_WHITESPACE |
+             doctest.REPORT_ONLY_FIRST_FAILURE)
+
+    package_dir = os.path.split(test_dir)[0]
+    if package_dir not in sys.path:
+        sys.path.append(package_dir)
+
+    doctest_dir = os.path.join(package_dir, 'docs')
+
+    # filtering files on extension
+    docs = [os.path.join(doctest_dir, doc) for doc in
+            os.listdir(doctest_dir) if doc.endswith('.txt')]
+
+    for test in docs:
+        suite.append(doctest.DocFileSuite(test, optionflags=flags, 
+                                          globs=globs, setUp=setUp, 
+                                          tearDown=tearDown,
+                                          module_relative=False))
+
+    return unittest.TestSuite(suite)
+
+def test_suite():
+    """returns the test suite"""
+    return doc_suite(current_dir)
+
+if __name__ == '__main__':
+    unittest.main(defaultTest='test_suite')
+



More information about the Checkins mailing list