Changeset 1342


Ignore:
Timestamp:
10/20/09 21:56:35 (5 years ago)
Author:
wehart
Message:

Documentation update.

Location:
pyutilib.virtualenv/trunk
Files:
3 edited
1 moved

Legend:

Unmodified
Added
Removed
  • pyutilib.virtualenv/trunk/README.txt

    r1332 r1342  
    33========================== 
    44 
    5 This Python package includes the virtualenv_installer script, which is 
    6 used to create virtualenv installers that automate the installation of 
    7 other Python packages. 
     5This Python package includes the **virtualenv_installer** script, which is 
     6used to create **virtualenv** bootstrap scripts that automate the installation of 
     7**virtualenv** along with other Python packages. 
    88 
     9--------------- 
     10Getting Started 
     11--------------- 
     12 
     13Overview 
     14~~~~~~~~ 
     15 
     16The **virtualenv_installer** script integrates a Python module into a **virtualenv** 
     17bootstrap script.  A user defines a **configure()** function in this module to 
     18control the configuration of the **virtualenv** installation.  For example, the 
     19following function declares the default installation directory, and that the 
     20virtual Python repository contains the **virtualenv** and **nose** Python packages: 
     21 
     22  def configure(installer): 
     23        installer.default_dirname = 'venv' 
     24        installer.add_repository('virtualenv', pypi='virtualenv') 
     25        installer.add_repository('nose', pypi='nose') 
     26        installer.add_repository( 
     27                        'coopr',  
     28                        pyname='Coopr',  
     29                        root='https://software.sandia.gov/svn/public/coopr',  
     30                        dev=True) 
     31        return installer 
     32 
     33The **add_repository** method can specify a PyPI package with the *pypi* 
     34option.  Alternatively, the root of a subversion repository can be specified 
     35with the *root* option.  If the *dev* option is specified, then this 
     36repository is checked out and installed in the **<root>/src** directory. 
     37Further, this package is installed in *develop* mode. 
     38 
     39 
     40A virtual Python bootstrap script is created by calling 
     41**venv_install** and specifying the Python module and script 
     42name.: 
     43 
     44  venv_install venv.py venv_install 
     45 
     46The bootstrap script can also setup a virtual Python 
     47installation in a specified directory: 
     48 
     49  venv_install venvdir 
     50 
     51 
     52By default, the bootstrap script installs the latest software release. 
     53In PyPI, this is the latest revision.  In subversion, this is the latest 
     54revision in either the *tags* or *releases* directory.  The trunk branch of 
     55the subversion repository can also be installed using the **--trunk** option: 
     56 
     57  venv_install --trunk venv 
     58 
     59Similarly, the bootstrap script recognizes stable branches, which can 
     60be installed with the **--stable** option.  Note that if stable branches are 
     61not available, then the latest release is installed. 
     62 
     63 
     64Internet Connectivity 
     65~~~~~~~~~~~~~~~~~~~~~ 
     66 
     67By default, the bootstrap script uses an internet connection to download the  
     68Python packages that are installed.  Note that a proxy server may be needed 
     69for the bootstrap script to work correctly.  The user can define the 
     70HTTP_PROXY environmental variable to specify the name of a proxy server. 
     71Alternatively, the **--proxy** option can be specified. 
     72 
     73The bootstrap script also provides a mechanism for enabling offline virtualenv 
     74installations.  This requires a two-stage process.  First, the 
     75**--preinstall** option is used to create a ZIP file that contains the Python 
     76packages.  For example, the command 
     77 
     78  venv_install --preinstall 
     79 
     80creates a **venv** directory, which includes the file **venv/venv.zip**. 
     81The preinstall step must be executed on a machine with internet 
     82connectivity.  However, this ZIP file can be used to perform an off-line 
     83installation with the **--offline** option.  For example, the following 
     84command will uses the **venv.zip** file to perform off-line installation 
     85in the **temp** directory: 
     86 
     87  venv_install --offline --zip=venv.zip test 
     88 
     89Note that this technique also installs the **setuptools** packages offline. 
     90Thus, the bootstrap script generated by **virtualenv_installer**  
     91supports a purely offline setup of virtualenv environments, which is not supported 
     92by the **virtualenv** bootstrap process. 
    993 
    1094------- 
  • pyutilib.virtualenv/trunk/example/venv.py

    r1329 r1342  
    88    installer.add_repository('nose', pypi='nose') 
    99    # 
    10     # Define the contents of the README.txt file 
    11     # 
    12     installer.README=""" 
    13 # 
    14 # Installation generated by the venv_install script. 
    15 # 
    16 # This directory is managed with virtualenv, which creates a 
    17 # virtual Python installation.  If the 'bin' directory is put in 
    18 # user's PATH environment, then the bin/python command can be used  
    19 # without further installation. 
    20 # 
    21 # Directories: 
    22 #   admin      Administrative data for maintaining this distribution 
    23 #   bin        Scripts and executables 
    24 #   dist       Python packages that are not intended for development 
    25 #   include    Python header files 
    26 #   lib        Python libraries and installed packages 
    27 #   src        Python packages whose source files can be 
    28 #              modified and used directly within this virtual Python 
    29 #              installation. 
    30 #   Scripts    Python bin directory (used on MS Windows) 
    31 # 
    32 """  
    33     # 
    3410    # Return the modified installer 
    3511    # 
  • pyutilib.virtualenv/trunk/example/venv_install

    r1341 r1342  
    14141414        self.cmd_files = [] 
    14151415        self.auxdir = [] 
     1416        self.README=""" 
     1417# 
     1418# Virtual Python installation generated by the %s script. 
     1419# 
     1420# This directory is managed with virtualenv, which creates a 
     1421# virtual Python installation.  If the 'bin' directory is put in 
     1422# user's PATH environment, then the bin/python command can be used 
     1423# without further installation. 
     1424# 
     1425# Directories: 
     1426#   admin      Administrative data for maintaining this distribution 
     1427#   bin        Scripts and executables 
     1428#   dist       Python packages that are not intended for development 
     1429#   include    Python header files 
     1430#   lib        Python libraries and installed packages 
     1431#   src        Python packages whose source files can be 
     1432#              modified and used directly within this virtual Python 
     1433#              installation. 
     1434#   Scripts    Python bin directory (used on MS Windows) 
     1435# 
     1436""" % sys.argv[0] 
    14161437 
    14171438    def add_repository(self, *args, **kwds): 
     
    16911712        # Create a README.txt file 
    16921713        # 
    1693         print "HERE",self.abshome_dir 
    16941714        OUTPUT=open(join(self.abshome_dir,"README.txt"),"w") 
    16951715        print >>OUTPUT, self.README.strip() 
     
    17031723            print "-----------------------------------------------------------------" 
    17041724            os.chdir(self.abshome_dir) 
    1705             zip(self.destdir+'.zip', ['.']) 
     1725            zip(self.default_dirname+'.zip', ['.']) 
    17061726            sys.exit(0) 
    17071727 
     
    18481868    installer.add_repository('virtualenv', pypi='virtualenv') 
    18491869    installer.add_repository('nose', pypi='nose') 
    1850     # 
    1851     # Define the contents of the README.txt file 
    1852     # 
    1853     installer.README=""" 
    1854 # 
    1855 # Installation generated by the venv_install script. 
    1856 # 
    1857 # This directory is managed with virtualenv, which creates a 
    1858 # virtual Python installation.  If the 'bin' directory is put in 
    1859 # user's PATH environment, then the bin/python command can be used  
    1860 # without further installation. 
    1861 # 
    1862 # Directories: 
    1863 #   admin      Administrative data for maintaining this distribution 
    1864 #   bin        Scripts and executables 
    1865 #   dist       Python packages that are not intended for development 
    1866 #   include    Python header files 
    1867 #   lib        Python libraries and installed packages 
    1868 #   src        Python packages whose source files can be 
    1869 #              modified and used directly within this virtual Python 
    1870 #              installation. 
    1871 #   Scripts    Python bin directory (used on MS Windows) 
    1872 # 
    1873 """  
    18741870    # 
    18751871    # Return the modified installer 
  • pyutilib.virtualenv/trunk/pyutilib/virtualenv/header.py

    r1341 r1342  
    448448        self.cmd_files = [] 
    449449        self.auxdir = [] 
     450        self.README=""" 
     451# 
     452# Virtual Python installation generated by the %s script. 
     453# 
     454# This directory is managed with virtualenv, which creates a 
     455# virtual Python installation.  If the 'bin' directory is put in 
     456# user's PATH environment, then the bin/python command can be used 
     457# without further installation. 
     458# 
     459# Directories: 
     460#   admin      Administrative data for maintaining this distribution 
     461#   bin        Scripts and executables 
     462#   dist       Python packages that are not intended for development 
     463#   include    Python header files 
     464#   lib        Python libraries and installed packages 
     465#   src        Python packages whose source files can be 
     466#              modified and used directly within this virtual Python 
     467#              installation. 
     468#   Scripts    Python bin directory (used on MS Windows) 
     469# 
     470""" % sys.argv[0] 
    450471 
    451472    def add_repository(self, *args, **kwds): 
     
    736757            print "-----------------------------------------------------------------" 
    737758            os.chdir(self.abshome_dir) 
    738             zip(self.destdir+'.zip', ['.']) 
     759            zip(self.default_dirname+'.zip', ['.']) 
    739760            sys.exit(0) 
    740761 
Note: See TracChangeset for help on using the changeset viewer.