[Checkins] SVN: RestrictedPython/ Eggify
Tres Seaver
tseaver at palladion.com
Wed Apr 5 11:41:48 EDT 2006
Log message for revision 66551:
Eggify
Changed:
A RestrictedPython/
A RestrictedPython/branches/
A RestrictedPython/tags/
A RestrictedPython/trunk/
A RestrictedPython/trunk/CHANGES.txt
A RestrictedPython/trunk/INSTALL.txt
A RestrictedPython/trunk/README.txt
A RestrictedPython/trunk/develop.py
A RestrictedPython/trunk/setup.cfg.in
A RestrictedPython/trunk/setup.py
A RestrictedPython/trunk/src/
A RestrictedPython/trunk/src/zope/
A RestrictedPython/trunk/src/zope/__init__.py
A RestrictedPython/trunk/test.py
A RestrictedPython/trunk/workspace/
A RestrictedPython/trunk/workspace/__init__.py
A RestrictedPython/trunk/workspace/develop.py
-=-
Added: RestrictedPython/trunk/CHANGES.txt
===================================================================
--- RestrictedPython/trunk/CHANGES.txt 2006-04-05 15:34:54 UTC (rev 66550)
+++ RestrictedPython/trunk/CHANGES.txt 2006-04-05 15:41:48 UTC (rev 66551)
@@ -0,0 +1,32 @@
+zope.XXX Package Changelog
+==========================
+
+zope.XXX version 3.2.1 (2006/03/26)
+-----------------------------------
+
+- Corresponds to the verison of the zope.XXX package shipped as part of
+ the Zope 3.2.1 release.
+
+zope.XXX version 3.2.0 (2006/01/05)
+-----------------------------------
+
+- Corresponds to the verison of the zope.XXX package shipped as part of
+ the Zope 3.2.0 release.
+
+zope.XXX version 3.1.0 (2005/10/03)
+-----------------------------------
+
+- Corresponds to the verison of the zope.XXX package shipped as part of
+ the Zope 3.1.0 release.
+
+zope.XXX version 3.0.1 (2005/07/27)
+-----------------------------------
+
+- Corresponds to the verison of the zope.XXX package shipped as part of
+ the Zope X3.0.1 release.
+
+zope.XXX version 3.0.0 (2004/11/07)
+-----------------------------------
+
+- Corresponds to the verison of the zope.XXX package shipped as part of
+ the Zope X3.0.0 release.
Property changes on: RestrictedPython/trunk/CHANGES.txt
___________________________________________________________________
Name: svn:eol-style
+ native
Added: RestrictedPython/trunk/INSTALL.txt
===================================================================
--- RestrictedPython/trunk/INSTALL.txt 2006-04-05 15:34:54 UTC (rev 66550)
+++ RestrictedPython/trunk/INSTALL.txt 2006-04-05 15:41:48 UTC (rev 66551)
@@ -0,0 +1,83 @@
+Installing This Package
+=======================
+
+Prerequisites
+-------------
+
+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:
+
+ $ svn co svn+ssh://svn.zope.org/repos/main/zope.XXX/trunk \
+ src/zope.XXX
+ $ cd src/zope.XXX
+
+Install it as a "devlopment egg" (which also installs its "hard"
+dependencies):
+
+ $ /path/to/your/python setup.py devel
+
+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
+-----------------
+
+To test the package, you will also need the 'zope.testing' package, which
+can't (yet) be automatically installed. Eventually, you should be able to
+type:
+
+ $ /path/to/your/python setup.py test
+
+and have it install the "testing dependencies." Today, the workaround
+is to install it manually:
+
+ $ /path/to/easy_install --find-links="...." zope.testing
+
+You can then run the tests (finally) 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.XXX
+ $ cd src/zope.XXX
+ $ /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.XXX
+
+
Property changes on: RestrictedPython/trunk/INSTALL.txt
___________________________________________________________________
Name: svn:eol-style
+ native
Added: RestrictedPython/trunk/README.txt
===================================================================
--- RestrictedPython/trunk/README.txt 2006-04-05 15:34:54 UTC (rev 66550)
+++ RestrictedPython/trunk/README.txt 2006-04-05 15:41:48 UTC (rev 66551)
@@ -0,0 +1,37 @@
+zope.XXX Package Readme
+=======================
+
+Overview
+--------
+
+Lorem ipsum delorem.
+
+Changes
+-------
+
+See CHANGES.txt.
+
+Installation
+------------
+
+See INSTALL.txt.
+
+
+Developer Resources
+-------------------
+
+- Subversion browser:
+
+ http://svn.zope.org/zope.XXX/
+
+- Read-only Subversion checkout:
+
+ $ svn co svn://svn.zope.org/repos/main/zope.XXX/trunk
+
+- Writable Subversion checkout:
+
+ $ svn co svn://svn.zope.org/repos/main/zope.XXX/trunk
+
+- Note that the 'src/zope/XXX' package is acutally a 'svn:externals' link
+ to the corresponding package in the Zope3 trunk (or to a specific tag,
+ for released versions of the package).
Property changes on: RestrictedPython/trunk/README.txt
___________________________________________________________________
Name: svn:eol-style
+ native
Added: RestrictedPython/trunk/develop.py
===================================================================
--- RestrictedPython/trunk/develop.py 2006-04-05 15:34:54 UTC (rev 66550)
+++ RestrictedPython/trunk/develop.py 2006-04-05 15:41:48 UTC (rev 66551)
@@ -0,0 +1,21 @@
+##############################################################################
+#
+# Copyright (c) 2004 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.
+#
+##############################################################################
+"""Workspace configuration wrapper script
+
+$Id$
+"""
+
+import workspace.develop
+
+workspace.develop.main()
Property changes on: RestrictedPython/trunk/develop.py
___________________________________________________________________
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
Added: RestrictedPython/trunk/setup.cfg.in
===================================================================
--- RestrictedPython/trunk/setup.cfg.in 2006-04-05 15:34:54 UTC (rev 66550)
+++ RestrictedPython/trunk/setup.cfg.in 2006-04-05 15:41:48 UTC (rev 66551)
@@ -0,0 +1,4 @@
+
+[egg_info]
+tag_build = .dev
+tag_svn_revision = 1
Added: RestrictedPython/trunk/setup.py
===================================================================
--- RestrictedPython/trunk/setup.py 2006-04-05 15:34:54 UTC (rev 66550)
+++ RestrictedPython/trunk/setup.py 2006-04-05 15:41:48 UTC (rev 66551)
@@ -0,0 +1,50 @@
+##############################################################################
+#
+# Copyright (c) 2004 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.
+#
+##############################################################################
+"""Setup for zope.i18nmessageid package
+
+$Id$
+"""
+
+import os
+
+try:
+ from setuptools import setup, Extension
+except ImportError, e:
+ from distutils.core import setup, Extension
+
+setup(name='zope.XXX',
+ version='1.0',
+ url='http://svn.zope.org/zope.XXX',
+ license='ZPL 2.1',
+ description='XXX',
+ author='Zope Corporation and Contributors',
+ author_email='zope3-dev at zope.org',
+ long_description='',
+
+ packages=['zope', 'zope.XXX'],
+ package_dir = {'': os.path.join(os.path.dirname(__file__), 'src')},
+
+## ext_modules=[Extension("zope.XXX._zope_XXX",
+## [os.path.join('src', 'zope', 'XXX',
+## "_zope_XXX.c")
+## ]),
+## ],
+
+ namespace_packages=['zope',],
+ tests_require = ['zope.testing'],
+ install_requires=['zope.deprecation'],
+ include_package_data = True,
+
+ zip_safe = False,
+ )
Property changes on: RestrictedPython/trunk/setup.py
___________________________________________________________________
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
Added: RestrictedPython/trunk/src/zope/__init__.py
===================================================================
--- RestrictedPython/trunk/src/zope/__init__.py 2006-04-05 15:34:54 UTC (rev 66550)
+++ RestrictedPython/trunk/src/zope/__init__.py 2006-04-05 15:41:48 UTC (rev 66551)
@@ -0,0 +1,7 @@
+# namespace package boilerplate
+try:
+ __import__('pkg_resources').declare_namespace(__name__)
+except ImportError, e:
+ from pkgutil import extend_path
+ __path__ = extend_path(__path__, __name__)
+
Property changes on: RestrictedPython/trunk/src/zope/__init__.py
___________________________________________________________________
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
Added: RestrictedPython/trunk/test.py
===================================================================
--- RestrictedPython/trunk/test.py 2006-04-05 15:34:54 UTC (rev 66550)
+++ RestrictedPython/trunk/test.py 2006-04-05 15:41:48 UTC (rev 66551)
@@ -0,0 +1,36 @@
+#!/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,
+ '--package', 'zope.i18nmessageid',
+ '--tests-pattern', '^tests$',
+ ]
+
+sys.exit(testrunner.run(defaults))
+
Property changes on: RestrictedPython/trunk/test.py
___________________________________________________________________
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
Added: RestrictedPython/trunk/workspace/__init__.py
===================================================================
Property changes on: RestrictedPython/trunk/workspace/__init__.py
___________________________________________________________________
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
Added: RestrictedPython/trunk/workspace/develop.py
===================================================================
--- RestrictedPython/trunk/workspace/develop.py 2006-04-05 15:34:54 UTC (rev 66550)
+++ RestrictedPython/trunk/workspace/develop.py 2006-04-05 15:41:48 UTC (rev 66551)
@@ -0,0 +1,177 @@
+##############################################################################
+#
+# 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.
+#
+##############################################################################
+"""Project checkout setup script
+
+$Id$
+"""
+
+import os
+import sys
+import shutil
+import optparse
+import ConfigParser
+import urllib2
+
+DEV_SECTION = 'development'
+DEV_DEPENDS = 'depends'
+
+def bootstrap(libdir, bindir):
+ """Bootstrap our setuptools installation in the target directory."""
+
+ # make sure ez_setup is available
+ try:
+ # check if we have ez_setup available
+ import ez_setup
+
+ except ImportError, e:
+ # retrieve ez_setup.py from the interweb
+ EZ_URL = "http://peak.telecommunity.com/dist/ez_setup.py"
+
+ ez_filename = os.path.join(os.path.dirname(__file__), 'ez_setup.py')
+ file(ez_filename, 'w').write(
+ urllib2.urlopen(EZ_URL).read()
+ )
+
+ import ez_setup
+
+ os.environ['PYTHONPATH'] = (os.environ.setdefault('PYTHONPATH', '')
+ + ":" + libdir)
+ ez_setup.main(['--install-dir', libdir,
+ '--script-dir', bindir,
+ '-U', 'setuptools'])
+
+def initSetupCfg(setup_file, template_file='setup.cfg.in'):
+ """Check if the setup_file (setup.cfg) exists; if it doesn't, and
+ setup.cfg.in does, copy setup.cfg.in to setup.cfg to serve as a
+ template."""
+
+ if not(os.path.exists(setup_file)) and os.path.exists(template_file):
+ shutil.copyfile(template_file, setup_file)
+
+def updateSetupCfg(setup_file, opts):
+ """Update or create a setup.cfg (setup_file) for working on this
+ project."""
+
+ # initialize the setup file if necessary
+ initSetupCfg(setup_file)
+
+ # load the existing version
+ setup_cfg = ConfigParser.ConfigParser()
+ setup_cfg.read(setup_file)
+
+ # make sure the sections we want exist
+ if not(setup_cfg.has_section('easy_install')):
+ setup_cfg.add_section('easy_install')
+
+ if not(setup_cfg.has_section('egg_info')):
+ setup_cfg.add_section('egg_info')
+
+ # update lib dir
+ if opts.libdir is None:
+ # no libdir specified; check for one in setup.cfg
+ if setup_cfg.has_option('easy_install', 'install-dir'):
+ opts.libdir = setup_cfg.get('easy_install', 'install-dir')
+ else:
+ opts.libdir = os.path.abspath('./lib')
+
+ setup_cfg.set('easy_install', 'install-dir', opts.libdir)
+
+ # update bin dir
+ if opts.bindir is None:
+ # no bindir specified; check for one in setup.cfg
+ if setup_cfg.has_option('easy_install', 'script-dir'):
+ opts.bindir = setup_cfg.get('easy_install', 'script-dir')
+ else:
+ opts.bindir = os.path.abspath('./bin')
+
+ setup_cfg.set('easy_install', 'script-dir', opts.bindir)
+
+ # update site-dirs
+ setup_cfg.set('easy_install', 'site-dirs', opts.libdir)
+
+ # update find-links
+ setup_cfg.set('easy_install', 'find-links', opts.finddirs)
+
+ # update egg_info for development version
+ if not setup_cfg.has_option('egg_info', 'tag_build'):
+ setup_cfg.set('egg_info', 'tag_build', '.dev')
+
+ if not setup_cfg.has_option('egg_info', 'tag_svn_revision'):
+ setup_cfg.set('egg_info', 'tag_svn_revision', '1')
+
+ # store the updated version
+ setup_cfg.write(file(setup_file, 'w'))
+
+def load_dev_deps(setup_file):
+ global DEV_SECTION
+ global DEV_DEPENDS
+
+ # load the existing version
+ setup_cfg = ConfigParser.ConfigParser()
+ setup_cfg.read(setup_file)
+
+ if not(setup_cfg.has_option(DEV_SECTION, DEV_DEPENDS)):
+ return []
+ else:
+ return [n.strip() for n in
+ setup_cfg.get(DEV_SECTION, DEV_DEPENDS).strip().split()]
+
+def check_dirs(*dirs):
+ """Check that our target directories all exist."""
+
+ for d in dirs:
+ if not(os.path.exists(os.path.abspath(d))):
+ os.makedirs(os.path.abspath(d))
+
+def cmdline_parser():
+ """Create an option parser and populate our available options."""
+
+ parser = optparse.OptionParser()
+ parser.add_option("-s", "--file", dest="setup_cfg",
+ help="File to read setup configuration from." )
+ parser.add_option("-l", "--libdir", dest="libdir",
+ help="Location of Python libraries.")
+ parser.add_option("-b", "--bindir", dest="bindir",
+ help="Location of Python scripts.")
+ parser.add_option("-f", "--find-dirs", dest="finddirs",
+ help="Location to examine for package links.")
+
+ parser.set_defaults(setup_cfg="setup.cfg",
+ libdir=None,
+ bindir=None,
+ finddirs="http://download.zope.org/distribution/")
+
+ return parser
+
+def main():
+ (options, args) = cmdline_parser().parse_args()
+
+ # update setup.cfg with the lib dir, bin dir, etc
+ updateSetupCfg(options.setup_cfg, options)
+
+ # make sure that the lib directory structure of our prefix exists
+ check_dirs(options.bindir, options.libdir)
+ sys.path.insert(0, options.libdir)
+
+ # bootstrap setuptools into our libdir
+ bootstrap(options.libdir, options.bindir)
+
+ # install the development dependencies
+ from setuptools.command.easy_install import main as einstall
+ deps = load_dev_deps(options.setup_cfg)
+ if deps and len(deps) > 0:
+ einstall(deps)
+
+if __name__ == '__main__':
+ main()
Property changes on: RestrictedPython/trunk/workspace/develop.py
___________________________________________________________________
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
More information about the Checkins
mailing list