changeset 2211:69db40714019

quickinstall: docstring and docs update
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Tue, 15 Oct 2013 22:01:53 -0700
parents c5562f2a893c
children 2f06843253d1
files docs/admin/install.rst quickinstall.py
diffstat 2 files changed, 33 insertions(+), 21 deletions(-) [+]
line wrap: on
line diff
--- a/docs/admin/install.rst	Wed Oct 16 06:54:22 2013 +0200
+++ b/docs/admin/install.rst	Tue Oct 15 22:01:53 2013 -0700
@@ -37,40 +37,38 @@
 from your mercurial moin2 working directory. You should not run this as an
 administrator or root user; use your standard user account::
 
- ./quickinstall  # for Linux or other POSIX OSes
- # or
- quickinstall.bat  # for Windows
+ python quickinstall.py
 
-This will use virtualenv to create a directory `env/` within the current directory,
-create a virtual environment for MoinMoin and then install moin2 including all dependencies into that directory.
-`pip` will automatically fetch all dependencies from PyPI and install them, so this may take a while.
+This will use virtualenv to create a directory `../venv-PROJECT-PYTHON/`
+(PROJECT is same as your current project directory, e.g. moin-2.0, PYTHON is
+the name of your python interpreter, e.g. python), create a virtual environment
+for MoinMoin and then install moin2 including all dependencies into that
+directory.
+
+`pip` will automatically fetch all dependencies from PyPI and install them, so
+this may take a while.
 It will also compile the translations (`*.po` files) to binary `*.mo` files.
 
 Please review the output of the quickinstall script, and check whether there were fatal errors.
 
-If you have a bad network connection that makes the downloads fail, you can try to do the steps in quickinstall manually.
-
 Further, the quickinstall script will create a `moin` script for your
 platform which you can use for starting the built-in server or invoke moin script commands.
 
 After you activated the virtual environment, the built-in server script, which is named 
 `moin`, will be in the standard PATH, so you can just run the command `moin` on the command line.
 
-**Note:** in this special mode, it won't copy the MoinMoin code to the env/ directory,
+**Note:** in this special mode, it won't copy the MoinMoin code to the virtualenv directory,
 it will run everything from your work dir, so you can modify code and directly try it out.
 You only need to do this installation procedure once.
 
-Using a different Python or a different virtualenv directory
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+Using a different Python
+~~~~~~~~~~~~~~~~~~~~~~~~
 
-For example, if you want to use `PyPy` and want to name the virtualenv directory `env-pypy`,
-use::
+If you rather like a different Python, just use it to invoke the quickinstall.py
+script - the same python will then be used for the virtual env also::
 
- # for linux
- DIR=env-pypy
- PYTHON=/opt/pypy/bin/pypy
+ /opt/pypy/bin/pypy quickinstall.py  # for linux
 
-That way, you can test with different versions of Python in different virtualenv directories within your moin2 workdir.
 
 Activating the virtual env
 --------------------------
@@ -80,13 +78,16 @@
 nor the moin code nor the libraries it needs. Also, if you want to install
 additional software into the virtual environment, activate it before running pip!::
 
- source env/bin/activate  # for linux (or other posix OSes)
+ source ../venv-moin-2.0-python/bin/activate  # for linux (or other posix OSes)
  # or
- env\Scripts\activate.bat  # for windows
+ ..\venv-moin-2.0-python\Scripts\activate.bat  # for windows
 
 As you have activated the virtual env now, the moin command should be in your
 path now, so you can invoke it using "moin".
 
+Note: the quickinstall script outputs the correct commands for activating
+the virtual env and for the moin executable file.
+
 Letting moin find the wiki configuration
 ----------------------------------------
 
@@ -189,6 +190,9 @@
 
 If this is the case, try it manually::
 
+ # create a virtual environment:
+ virtualenv env
+
  # enter your virtual environment:
  source env/bin/activate
 
--- a/quickinstall.py	Wed Oct 16 06:54:22 2013 +0200
+++ b/quickinstall.py	Tue Oct 15 22:01:53 2013 -0700
@@ -1,4 +1,12 @@
 #!/usr/bin/python
+# Copyright: 2013 MoinMoin:BastianBlank
+# License: GNU GPL v2 (or any later version), see LICENSE.txt for details.
+"""
+create a virtual environment and install moin2 (in development mode) and
+its requirements.
+
+needs: virtualenv, pip
+"""
 
 import argparse
 import logging
@@ -21,12 +29,12 @@
         self.do_install()
         self.do_catalog()
 
-        sys.stdout.write('''
+        sys.stdout.write("""
 Succesfully created or updated venv
   {0}
 You can run MoinMoin as
   {0}/bin/moin
-'''.format(self.dir_venv))
+""".format(self.dir_venv))
 
     def do_venv(self):
         virtualenv.create_environment(self.dir_venv)