[Checkins] SVN: Sandbox/thefunny42/kgs.test/trunk/ Start to refactor package.
Sylvain Viollon
sylvain at infrae.com
Tue Jan 27 04:33:35 EST 2009
Log message for revision 95094:
Start to refactor package.
Changed:
D Sandbox/thefunny42/kgs.test/trunk/build.py
A Sandbox/thefunny42/kgs.test/trunk/kgs_test.py
A Sandbox/thefunny42/kgs.test/trunk/setup.py
A Sandbox/thefunny42/kgs.test/trunk/src/
-=-
Deleted: Sandbox/thefunny42/kgs.test/trunk/build.py
===================================================================
--- Sandbox/thefunny42/kgs.test/trunk/build.py 2009-01-27 09:24:39 UTC (rev 95093)
+++ Sandbox/thefunny42/kgs.test/trunk/build.py 2009-01-27 09:33:34 UTC (rev 95094)
@@ -1,120 +0,0 @@
-import os.path
-import os
-import popen2
-import glob
-from pkg_resources import Environment, WorkingSet
-from zc.buildout import easy_install
-
-# Configuration
-ZOPE3_SVN = os.getenv('ZOPE3_SVN',
- 'svn://svn.zope.org/repos/main/')
-EGG_CACHE = os.getenv('PYTHON_CACHE_EGG',
- '/Users/sylvain/Library/Buildout/eggs')
-DEVELOP_EGG = 'develop-eggs'
-BLACKLIST = ['zope.agxassociation', 'zope.app.css', 'zope.app.demo', \
- 'zope.app.fssync', 'zope.app.recorder', \
- 'zope.app.schemacontent', 'zope.app.sqlexpr', \
- 'zope.app.styleguide', 'zope.app.tests', \
- 'zope.app.versioncontrol', 'zope.app.zopetop', \
- 'zope.bobo', 'zope.browserzcml2', 'zope.fssync', \
- 'zope.generic', 'zope.importtool', 'zope.kgs', \
- 'zope.release', 'zope.pytz', 'zope.timestamp', \
- 'zope.tutorial', 'zope.ucol', 'zope.weakset', \
- 'zope.webdev', 'zope.xmlpickle',]
-DELETE_LIST = ['zope.app.boston',]
-IGNORED = BLACKLIST + DELETE_LIST
-
-# Collect project
-projects = []
-svn_list, _ = popen2.popen2("svn ls %s" % ZOPE3_SVN)
-for project in svn_list:
- project = project[:-2]
- if project in IGNORED:
- continue
- parts = project.split('.')
- if parts[0] in ('zope', 'grokcore', ):
- projects.append(project)
-
-# Write buildout and makefile
-kgs_conf = open('kgs.cfg', 'w')
-trunk_conf = open('trunk.cfg', 'w')
-makefile = open('Makefile', 'w')
-
-kgs_conf.write("""
-[buildout]
-extends = versions.cfg
-#versions = versions
-newest = true
-unzip = true
-parts =
-""")
-makefile.write("""
-all: """)
-trunk_conf.write("""
-[buildout]
-extends = kgs.cfg
-develop =
-""")
-
-for project in projects:
- script_name = project.replace('.', '-')
- kgs_conf.write(" test-%s\n" % script_name)
- makefile.write(" test-%s" % script_name)
- trunk_conf.write(" %s\n" % project)
-
-makefile.write("""
-
-test-%:
- $(CURDIR)/bin/$@
-""")
-
-if not os.path.isdir(DEVELOP_EGG):
- os.mkdir(DEVELOP_EGG)
-
-def to_test(project, packages):
- if 'test' in packages[0].extras:
- return project + ' [test]'
- return project
-
-kgs_env = Environment([EGG_CACHE,])
-kgs_ws = WorkingSet(kgs_env)
-trunk_env = Environment([DEVELOP_EGG,])
-
-for project in projects:
- print project
- if not os.path.isdir(project):
- os.system('svn co %s/%s/trunk %s' % (ZOPE3_SVN, project, project))
-
- script_name = project.replace('.', '-')
-
- # Released version
- packages = kgs_env[project]
- if not len(packages):
- easy_install.install(project, EGG_CACHE, working_set=kgs_ws)
- packages = kgs_env[project]
-
- kgs_conf.write("""
-[test-%s]
-recipe = zc.recipe.testrunner
-eggs = %s
-""" % (script_name, to_test(project, packages)))
-
- # Trunk version
- packages = trunk_env[project]
- if not len(packages):
- easy_install.develop(os.path.abspath(project),
- os.path.abspath(DEVELOP_EGG))
- # Rescan evrything, trunk_env.scan don't seems to work
- trunk_env = Environment([DEVELOP_EGG,])
- packages = trunk_env[project]
-
- trunk_conf.write("""
-[test-%s]
-recipe = zc.recipe.testrunner
-eggs = %s
-""" % (script_name, to_test(project, packages)))
-
-
-# Clean develop-eggs, otherwise if you choose KGS you still have trunk
-for path in os.listdir(DEVELOP_EGG):
- os.remove(DEVELOP_EGG + '/' + path)
Copied: Sandbox/thefunny42/kgs.test/trunk/kgs_test.py (from rev 95075, Sandbox/thefunny42/kgs.test/trunk/build.py)
===================================================================
--- Sandbox/thefunny42/kgs.test/trunk/kgs_test.py (rev 0)
+++ Sandbox/thefunny42/kgs.test/trunk/kgs_test.py 2009-01-27 09:33:34 UTC (rev 95094)
@@ -0,0 +1,132 @@
+import os.path
+import os
+import popen2
+import glob
+from pkg_resources import Environment, WorkingSet
+from zc.buildout import easy_install
+
+# Configuration
+ZOPE3_SVN = os.getenv('ZOPE3_SVN',
+ 'svn://svn.zope.org/repos/main/')
+EGG_CACHE = os.getenv('PYTHON_CACHE_EGG',
+ '/Users/sylvain/Library/Buildout/eggs')
+DEVELOP_EGG = 'develop-eggs'
+BLACKLIST = ['zope.agxassociation', 'zope.app.css', 'zope.app.demo', \
+ 'zope.app.fssync', 'zope.app.recorder', \
+ 'zope.app.schemacontent', 'zope.app.sqlexpr', \
+ 'zope.app.styleguide', 'zope.app.tests', \
+ 'zope.app.versioncontrol', 'zope.app.zopetop', \
+ 'zope.bobo', 'zope.browserzcml2', 'zope.fssync', \
+ 'zope.generic', 'zope.importtool', 'zope.kgs', \
+ 'zope.release', 'zope.pytz', 'zope.timestamp', \
+ 'zope.tutorial', 'zope.ucol', 'zope.weakset', \
+ 'zope.webdev', 'zope.xmlpickle',]
+DELETE_LIST = ['zope.app.boston',]
+IGNORED = BLACKLIST + DELETE_LIST
+
+
+def to_test(project, packages):
+ """Gives back the egg to test.
+ """
+ if 'test' in packages[0].extras:
+ return project + ' [test]'
+ return project
+
+def main():
+ """Create buildout.cfg for running test independently on a set of
+ packages.
+ """
+
+ # Collect project
+ projects = []
+ svn_list, _ = popen2.popen2("svn ls %s" % ZOPE3_SVN)
+ for project in svn_list:
+ project = project[:-2]
+ if project in IGNORED:
+ continue
+ parts = project.split('.')
+ if parts[0] in ('zope', 'grokcore', ):
+ projects.append(project)
+
+ # Write buildout and makefile
+ kgs_conf = open('kgs.cfg', 'w')
+ trunk_conf = open('trunk.cfg', 'w')
+ makefile = open('Makefile', 'w')
+
+ kgs_conf.write("""
+[buildout]
+extends = versions.cfg
+#versions = versions
+newest = true
+unzip = true
+parts =
+""")
+ makefile.write("""
+all: """)
+ trunk_conf.write("""
+[buildout]
+extends = kgs.cfg
+develop =
+""")
+
+ for project in projects:
+ script_name = project.replace('.', '-')
+ kgs_conf.write(" test-%s\n" % script_name)
+ makefile.write(" test-%s" % script_name)
+ trunk_conf.write(" %s\n" % project)
+
+ makefile.write("""
+
+test-%:
+ $(CURDIR)/bin/$@
+""")
+
+ if not os.path.isdir(DEVELOP_EGG):
+ os.mkdir(DEVELOP_EGG)
+
+
+ kgs_env = Environment([EGG_CACHE,])
+ kgs_ws = WorkingSet(kgs_env)
+ trunk_env = Environment([DEVELOP_EGG,])
+
+ for project in projects:
+ print project
+ if not os.path.isdir(project):
+ os.system('svn co %s/%s/trunk %s' % (ZOPE3_SVN, project, project))
+
+ script_name = project.replace('.', '-')
+
+ # Released version
+ packages = kgs_env[project]
+ if not len(packages):
+ easy_install.install(project, EGG_CACHE, working_set=kgs_ws)
+ packages = kgs_env[project]
+
+ kgs_conf.write("""
+[test-%s]
+recipe = zc.recipe.testrunner
+eggs = %s
+""" % (script_name, to_test(project, packages)))
+
+ # Trunk version
+ packages = trunk_env[project]
+ if not len(packages):
+ easy_install.develop(os.path.abspath(project),
+ os.path.abspath(DEVELOP_EGG))
+ # Rescan evrything, trunk_env.scan don't seems to work
+ trunk_env = Environment([DEVELOP_EGG,])
+ packages = trunk_env[project]
+
+ trunk_conf.write("""
+[test-%s]
+recipe = zc.recipe.testrunner
+eggs = %s
+""" % (script_name, to_test(project, packages)))
+
+
+ # Clean develop-eggs, otherwise if you choose KGS you still have trunk
+ for path in os.listdir(DEVELOP_EGG):
+ os.remove(DEVELOP_EGG + '/' + path)
+
+if __name__ == '__main__':
+ main()
Property changes on: Sandbox/thefunny42/kgs.test/trunk/kgs_test.py
___________________________________________________________________
Added: svn:mergeinfo
+
Added: Sandbox/thefunny42/kgs.test/trunk/setup.py
===================================================================
--- Sandbox/thefunny42/kgs.test/trunk/setup.py (rev 0)
+++ Sandbox/thefunny42/kgs.test/trunk/setup.py 2009-01-27 09:33:34 UTC (rev 95094)
@@ -0,0 +1,30 @@
+from setuptools import setup, find_packages
+
+
+setup(name='kgs.test',
+ version = '1.0dev',
+ author='Grok Contributors',
+ author_email='grok-dev at zope.org',
+ description='Tool to create test environement for KGS.',
+ long_description='',
+ keywords = "zope3 setuptools egg kgs",
+ classifiers = [
+ 'Intended Audience :: Developers',
+ 'License :: OSI Approved :: Zope Public License',
+ 'Programming Language :: Python',
+ 'Operating System :: OS Independent',
+ 'Framework :: Zope3'],
+ url='',
+ license='ZPL 2.1',
+ packages=find_packages('src'),
+ package_dir = {'': 'src'},
+ install_requires=[
+ 'setuptools',
+ 'zc.buildout',
+ ],
+ entry_points = dict(console_scripts=[
+ 'kgs_test = kgs_test:main',
+ ]),
+ include_package_data = True,
+ zip_safe = True,
+ )
More information about the Checkins
mailing list