virtualenv/web/res/res_create_env.py
author ymh <ymh.work@gmail.com>
Fri, 08 Apr 2011 17:18:44 +0200
changeset 68 b40657713336
child 70 8e3281bcebc9
permissions -rw-r--r--
use platform and clean install files
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
68
b40657713336 use platform and clean install files
ymh <ymh.work@gmail.com>
parents:
diff changeset
     1
import platform
b40657713336 use platform and clean install files
ymh <ymh.work@gmail.com>
parents:
diff changeset
     2
b40657713336 use platform and clean install files
ymh <ymh.work@gmail.com>
parents:
diff changeset
     3
from lib_create_env import lib_generate_install_methods, install_pylucene, install_psycopg2
b40657713336 use platform and clean install files
ymh <ymh.work@gmail.com>
parents:
diff changeset
     4
b40657713336 use platform and clean install files
ymh <ymh.work@gmail.com>
parents:
diff changeset
     5
system_str = platform.system()
b40657713336 use platform and clean install files
ymh <ymh.work@gmail.com>
parents:
diff changeset
     6
b40657713336 use platform and clean install files
ymh <ymh.work@gmail.com>
parents:
diff changeset
     7
b40657713336 use platform and clean install files
ymh <ymh.work@gmail.com>
parents:
diff changeset
     8
if system_str == 'Linux':
b40657713336 use platform and clean install files
ymh <ymh.work@gmail.com>
parents:
diff changeset
     9
    INSTALLS = [
b40657713336 use platform and clean install files
ymh <ymh.work@gmail.com>
parents:
diff changeset
    10
    ('DISTRIBUTE', 'pip', None, None),
b40657713336 use platform and clean install files
ymh <ymh.work@gmail.com>
parents:
diff changeset
    11
    ]
b40657713336 use platform and clean install files
ymh <ymh.work@gmail.com>
parents:
diff changeset
    12
else:
b40657713336 use platform and clean install files
ymh <ymh.work@gmail.com>
parents:
diff changeset
    13
    INSTALLS = []
b40657713336 use platform and clean install files
ymh <ymh.work@gmail.com>
parents:
diff changeset
    14
    
b40657713336 use platform and clean install files
ymh <ymh.work@gmail.com>
parents:
diff changeset
    15
b40657713336 use platform and clean install files
ymh <ymh.work@gmail.com>
parents:
diff changeset
    16
INSTALLS.extend([ #(key,method, option_str, dict_extra_env)
b40657713336 use platform and clean install files
ymh <ymh.work@gmail.com>
parents:
diff changeset
    17
    ('SETUPTOOLS-HG', 'pip', None, None), 
b40657713336 use platform and clean install files
ymh <ymh.work@gmail.com>
parents:
diff changeset
    18
    ('MYSQL', 'pip', None, None),
b40657713336 use platform and clean install files
ymh <ymh.work@gmail.com>
parents:
diff changeset
    19
    ('PIL', 'easy_install', None, None), 
b40657713336 use platform and clean install files
ymh <ymh.work@gmail.com>
parents:
diff changeset
    20
    ('DJANGO','pip', None, None),
b40657713336 use platform and clean install files
ymh <ymh.work@gmail.com>
parents:
diff changeset
    21
    ('JOGGING','pip', None, None),
b40657713336 use platform and clean install files
ymh <ymh.work@gmail.com>
parents:
diff changeset
    22
    ('DJANGO-EXTENSIONS', 'pip', None, None),
b40657713336 use platform and clean install files
ymh <ymh.work@gmail.com>
parents:
diff changeset
    23
    ('DJANGO-REGISTRATION', 'easy_install', '-Z', None),
b40657713336 use platform and clean install files
ymh <ymh.work@gmail.com>
parents:
diff changeset
    24
    ('DJANGO-TAGGING', 'pip', None, None),
b40657713336 use platform and clean install files
ymh <ymh.work@gmail.com>
parents:
diff changeset
    25
    ('DJANGO-PISTON', 'pip', None, None),
b40657713336 use platform and clean install files
ymh <ymh.work@gmail.com>
parents:
diff changeset
    26
    ('HTTPLIB2', 'pip', None, None),
b40657713336 use platform and clean install files
ymh <ymh.work@gmail.com>
parents:
diff changeset
    27
    ('OAUTH2', 'easy_install', None, None),
b40657713336 use platform and clean install files
ymh <ymh.work@gmail.com>
parents:
diff changeset
    28
    ('DJANGO-OAUTH-PLUS', 'pip', None, None),
b40657713336 use platform and clean install files
ymh <ymh.work@gmail.com>
parents:
diff changeset
    29
    ('PHOTOLOGUE', 'pip', None, None),
b40657713336 use platform and clean install files
ymh <ymh.work@gmail.com>
parents:
diff changeset
    30
    ('MODELTRANSLATION', 'pip', None, None),
b40657713336 use platform and clean install files
ymh <ymh.work@gmail.com>
parents:
diff changeset
    31
])
b40657713336 use platform and clean install files
ymh <ymh.work@gmail.com>
parents:
diff changeset
    32
b40657713336 use platform and clean install files
ymh <ymh.work@gmail.com>
parents:
diff changeset
    33
if system_str == 'Windows':
b40657713336 use platform and clean install files
ymh <ymh.work@gmail.com>
parents:
diff changeset
    34
    INSTALLS.extend([
b40657713336 use platform and clean install files
ymh <ymh.work@gmail.com>
parents:
diff changeset
    35
    ('JCC','easy_install',None,None),
b40657713336 use platform and clean install files
ymh <ymh.work@gmail.com>
parents:
diff changeset
    36
    ('PYLUCENE','easy_install',None,None),
b40657713336 use platform and clean install files
ymh <ymh.work@gmail.com>
parents:
diff changeset
    37
    ('PSYCOPG2',install_psycopg2,None,None),
b40657713336 use platform and clean install files
ymh <ymh.work@gmail.com>
parents:
diff changeset
    38
    ])
b40657713336 use platform and clean install files
ymh <ymh.work@gmail.com>
parents:
diff changeset
    39
else:
b40657713336 use platform and clean install files
ymh <ymh.work@gmail.com>
parents:
diff changeset
    40
    INSTALLS.extend([
b40657713336 use platform and clean install files
ymh <ymh.work@gmail.com>
parents:
diff changeset
    41
    ('PYLUCENE',install_pylucene,None,None),
b40657713336 use platform and clean install files
ymh <ymh.work@gmail.com>
parents:
diff changeset
    42
    ('PSYCOPG2', 'pip', None, None),
b40657713336 use platform and clean install files
ymh <ymh.work@gmail.com>
parents:
diff changeset
    43
    ])
b40657713336 use platform and clean install files
ymh <ymh.work@gmail.com>
parents:
diff changeset
    44
b40657713336 use platform and clean install files
ymh <ymh.work@gmail.com>
parents:
diff changeset
    45
if system_str == "Darwin":
b40657713336 use platform and clean install files
ymh <ymh.work@gmail.com>
parents:
diff changeset
    46
    INSTALLS.extend([
b40657713336 use platform and clean install files
ymh <ymh.work@gmail.com>
parents:
diff changeset
    47
    ('LXML', 'pip', None, {'STATIC_DEPS': 'true', 'LIBXML2_VERSION': '2.7.8', 'LIBXSLT_VERSION': '1.1.26'}),
b40657713336 use platform and clean install files
ymh <ymh.work@gmail.com>
parents:
diff changeset
    48
    ])
b40657713336 use platform and clean install files
ymh <ymh.work@gmail.com>
parents:
diff changeset
    49
else:
b40657713336 use platform and clean install files
ymh <ymh.work@gmail.com>
parents:
diff changeset
    50
    INSTALLS.extend([
b40657713336 use platform and clean install files
ymh <ymh.work@gmail.com>
parents:
diff changeset
    51
    ('LXML', 'pip', None, None),
b40657713336 use platform and clean install files
ymh <ymh.work@gmail.com>
parents:
diff changeset
    52
    ])
b40657713336 use platform and clean install files
ymh <ymh.work@gmail.com>
parents:
diff changeset
    53
b40657713336 use platform and clean install files
ymh <ymh.work@gmail.com>
parents:
diff changeset
    54
b40657713336 use platform and clean install files
ymh <ymh.work@gmail.com>
parents:
diff changeset
    55
def generate_install_methods(path_locations, src_base, Logger, call_subprocess):    
b40657713336 use platform and clean install files
ymh <ymh.work@gmail.com>
parents:
diff changeset
    56
    return lib_generate_install_methods(path_locations, src_base, Logger, call_subprocess, INSTALLS)