[Repoze-checkins] r672 - in repoze.zope2/trunk: . repoze/zope2
Chris McDonough
chrism at agendaless.com
Wed Feb 6 00:59:26 UTC 2008
Author: Chris McDonough <chrism at agendaless.com>
Date: Tue Feb 5 19:59:26 2008
New Revision: 672
Log:
- Install a mkzope2instance script as a console script to support
non-repozeproject based installs.
- Change documentation to prefer non-repozeproject installations.
Modified:
repoze.zope2/trunk/CHANGES.txt
repoze.zope2/trunk/README.txt
repoze.zope2/trunk/repoze/zope2/instance.py
repoze.zope2/trunk/setup.py
Modified: repoze.zope2/trunk/CHANGES.txt
==============================================================================
--- repoze.zope2/trunk/CHANGES.txt (original)
+++ repoze.zope2/trunk/CHANGES.txt Tue Feb 5 19:59:26 2008
@@ -1,3 +1,10 @@
+0.3.0
+
+ - Install a mkzope2instance script as a console script to support
+ non-repozeproject based installs.
+
+ - Change documentation to prefer non-repozeproject installations.
+
0.2.9
- Fix up noncompliant WSGI environment server keys (
Modified: repoze.zope2/trunk/README.txt
==============================================================================
--- repoze.zope2/trunk/README.txt (original)
+++ repoze.zope2/trunk/README.txt Tue Feb 5 19:59:26 2008
@@ -8,42 +8,53 @@
Installing repoze.zope2
With a Python 2.4 interpreter >= 2.4.3 (**Python 2.5+ is
- unsupported**), install the 'repoze.project' package::
+ unsupported**) with setuptools installed, install the 'virtualenv'
+ package::
- $PYTHONHOME/bin/easy_install -i http://dist.repoze.org/simple repoze.project
+ $PYTHONHOME/bin/easy_install virtualenv
- When this is done, invoke the 'repozeproject' script installed into
- the Python's bin directory via::
+ When this is done, create a virtualenv "sandbox" to hold the
+ repoze.zope2 packages and instance data:
- $PYTHONHOME/bin/repozeproject --path=/path/to/sandbox repoze.zope2
+ $PYTHONHOME/bin/virtualenv --no-site-packages /path/to/sandbox
- If you omit '--path /path/to/sandbox', the sandbox will be created
- within your current working directory. A sandbox is roughly
- equivalent to a classic Zope 2 instance home. NOTE: Some "Syntax
- Error" messages may be printed to the console during this process;
- these can be ignored. This is distutils attempting to byte-compile
- Zope "Python Scripts" in skin directories that aren't valid Python
- syntax. Creating a sandbox will cause the following actions to be
- performed.
-
- - a "virtual Python" will be installed within the "/path/to/sandbox"
- directory. Packages installed to this virtual Python's
- 'site-packages' directory will not conflict with packages
+ A directory named 'sandbox' will be created in the /path/to.
+ directory. You can use any path you like.
+
+ After creating a virtualenv sandbox, install the 'repoze.zope2' egg
+ into the virtualenv.
+
+ /path/to/sandbox/bin/easy_install -i http://dist.repoze.org/simple repoze.zope2
+
+ NOTE: Some "Syntax Error" messages may be printed to the console
+ during this process; these can be ignored. This is distutils
+ attempting to byte-compile Zope "Python Scripts" in skin directories
+ that aren't valid Python syntax.
+
+ After the repoze.zope2 packages are installed into the virtualenv,
+ you can finally create "instance" files (config files) within the
+ sandbox by running "mk2zope2instance"::
+
+ /path/to/sandbox/bin/mkzope2instance .
+
+ After these steps have been performed, here's what has happened::
+
+ - a "virtual Python" has been installed within the
+ "/path/to/sandbox" directory. Packages installed to this virtual
+ Python's 'site-packages' directory will not conflict with packages
installed into your "normal" Python's 'site-packages' directory.
- - All packages required by repoze.zope2 will be downloaded,
+ - All packages required by repoze.zope2 have beeen downloaded,
compiled, and installed as Python eggs in the *virtual* Python's
- 'site-packages' directory. The "repoze.zope2" package will be
- installed into the virtual Python's site-packages directory as a
- "development egg".
+ 'site-packages' directory.
- - 'Products', 'logs', 'var', and 'etc' directories will be created
+ - 'Products', 'logs', 'var', and 'etc' directories have been created
inside the sandbox directory. 'Products' is where 3rd party Zope
products should be installed. 'logs' is where Zope logs will go,
'var' is where ZODB data files will go, 'etc' is where config
files are placed.
- - A sample set of configuration files will be installed into the
+ - A sample set of configuration files have been installed into the
sandbox directory's 'etc' subdirectory. These include::
- 'zope.ini', a Paste configuration file used to establish the
@@ -102,6 +113,8 @@
debugzope2 -- runs the Python interactive interpreter with the Zope
root object bound to the "app" name in the global dictionary/
+ mkzope2instance -- create zope2 instance files in a directory.
+
Testing repoze.zope2
To all run repoze.zope2 tests, after running setup.py sandbox, cd to
Modified: repoze.zope2/trunk/repoze/zope2/instance.py
==============================================================================
--- repoze.zope2/trunk/repoze/zope2/instance.py (original)
+++ repoze.zope2/trunk/repoze/zope2/instance.py Tue Feb 5 19:59:26 2008
@@ -1,4 +1,6 @@
+import optparse
import os
+import os.path
import sys
import re
@@ -40,3 +42,18 @@
open(targetfile, 'w').write(result)
os.chmod(targetfile, 0755)
+def main(argv=sys.argv):
+ """ Console script target """
+ parser = optparse.OptionParser(
+ usage='%prog [PATH]'
+ )
+ options, args = parser.parse_args(sys.argv)
+ if len(args) != 2:
+ parser.print_help(sys.stderr)
+ sys.exit(1)
+ path = os.path.realpath(args[1])
+ mkinstance(path)
+
+
+
+
Modified: repoze.zope2/trunk/setup.py
==============================================================================
--- repoze.zope2/trunk/setup.py (original)
+++ repoze.zope2/trunk/setup.py Tue Feb 5 19:59:26 2008
@@ -12,7 +12,7 @@
#
##############################################################################
-__version__ = '0.2.9'
+__version__ = '0.3.0'
from ez_setup import use_setuptools
use_setuptools()
@@ -74,6 +74,7 @@
runzope2script = repoze.zope2.scripts.runscript:main
debugzope2 = repoze.zope2.scripts.debug:main
installproduct = repoze.zope2.scripts.installproduct:main
+ mkzope2instance = repoze.zope2.instance:main
[paste.server_runner]
zserver = repoze.zope2.server:run_zserver
More information about the Repoze-checkins
mailing list