Changeset 3306

Show
Ignore:
Timestamp:
07/18/07 17:41:59 (1 year ago)
Author:
faide
Message:

Updated tgsetup.py to have newer setuptools and to grab TG 1.0.3.
Also switched the default python to python 2.5 by removing the warnings.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • website/newdocs/download/tgsetup.py

    r2996 r3306  
    44from distutils import log 
    55 
    6 TGVERSION = "1.0.2.2
     6TGVERSION = "1.0.3
    77TGDOWNLOAD = "http://www.turbogears.org/download/" 
    88 
     
    2323""" 
    2424import sys 
    25 DEFAULT_VERSION = "0.6c5
     25DEFAULT_VERSION = "0.6c6
    2626DEFAULT_URL     = "http://cheeseshop.python.org/packages/%s/s/setuptools/" % sys.version[:3] 
    2727 
     
    4848    'setuptools-0.6c5-py2.4.egg': 'afe2adf1c01701ee841761f5bcd8aa64', 
    4949    'setuptools-0.6c5-py2.5.egg': 'a8d3f61494ccaa8714dfed37bccd3d5d', 
     50    'setuptools-0.6c6-py2.3.egg': '35686b78116a668847237b69d549ec20', 
     51    'setuptools-0.6c6-py2.4.egg': '3c56af57be3225019260a644430065ab', 
     52    'setuptools-0.6c6-py2.5.egg': 'b2f8a7520709a5b34f80946de5f02f53', 
    5053} 
    5154 
     
    5356 
    5457# TGBEGIN 
     58win32 = """ 
     59The recommended Python for TurboGears is Python 2.5.1. You can download 
     60it here: 
     61 
     62http://www.python.org/ftp/python/2.5.1/python-2.5.1.msi 
     63""" 
     64 
     65darwin = """ 
     66The recommended Python for TurboGears is Python 2.5.1. You can download 
     67a Universal build here: 
     68 
     69http://www.python.org/ftp/python/2.5.1/python-2.5.1-macosx.dmg  
     70""" 
     71 
     72other = """ 
     73The recommended Python for TurboGears is Python 2.5.1. This version of 
     74Python is often available in your operating system's native package 
     75format (via apt-get or yum, for instance). You can also easily build 
     76Python from source on Unix-like systems. Here is the source download 
     77link for Python: 
     78 
     79http://www.python.org/ftp/python/2.5.1/Python-2.5.1.tar.bz2 
     80""" 
    5581 
    5682def get_python(): 
     
    5985    it may actually download Python if you want it to (in which case, it 
    6086    would return True).""" 
     87 
    6188    if sys.platform == "darwin": 
    62         print """ 
    63 The recommended Python for TurboGears is Python 2.4.4. You can download 
    64 a Universal build here: 
    65  
    66 http://www.python.org/download/releases/2.4.4/  
    67 """ 
     89        print darwin 
     90 
    6891    elif sys.platform == "win32": 
    69         print """ 
    70 The recommended Python for TurboGears is Python 2.4.4. You can download 
    71 it here: 
    72  
    73 http://www.python.org/ftp/python/2.4.4/python-2.4.4.msi 
    74 """ 
     92        print win32 
     93 
    7594    else: 
    76         print """ 
    77 The recommended Python for TurboGears is Python 2.4.4. This version of 
    78 Python is often available in your operating system's native package 
    79 format (via apt-get or yum, for instance). You can also easily build 
    80 Python from source on Unix-like systems. Here is the source download 
    81 link for Python: 
    82  
    83 http://www.python.org/ftp/python/2.4.4/Python-2.4.4.tgz 
    84 """ 
     95        print other 
     96 
    8597    return False 
    8698 
     
    100112def check_python(): 
    101113    if sys.version_info < (2,3): 
    102         print """ 
    103 Python 2.3 or higher is required to run TurboGears. 
    104 """ 
     114        print "Python 2.3 or higher is required to run TurboGears." 
     115 
    105116        if not get_python(): 
    106117            sys.exit(1) 
    107     elif sys.version_info > (2,5): 
     118 
     119    elif sys.version_info < (2,4): 
     120        print "TurboGears supports Python 2.3, but 2.4 is strongly recommended." 
     121 
    108122        if not get_python(): 
    109             print """Would you like to continue with a Python 2.5 install?yes/no[y]""" 
    110             c = get_yesno(default="y") 
    111             if c == "n": 
    112                 print """You can rerun the installer later.""" 
    113                 sys.exit(1) 
    114     elif sys.version_info < (2,4): 
    115         print """ 
    116 TurboGears supports Python 2.3, but 2.4 is strongly recommended. 
    117 """ 
    118         if not get_python(): 
    119             print """Would you like to continue with a Python 2.3 install?yes/no[n]""" 
     123            print "Would you like to continue with a Python 2.3 install?yes/no[n]" 
    120124            c = get_yesno(default="n") 
    121125            if c == "n": 
    122                 print """You can rerun the installer once you have an updated Python.""
     126                print "You can rerun the installer once you have an updated Python.
    123127                sys.exit(1) 
    124128 
     
    126130    """Ensures that the current directory does not contain a TurboGears 
    127131    directory that setuptools will attempt to install from.""" 
     132 
    128133    if os.path.exists("turbogears") or os.path.exists("TurboGears"): 
    129134        print """There is a 'turbogears' directory in the current directory. 
    130135        EasyInstall will normally try to install from this directory rather 
    131136        than picking up the installation package from the net.""" 
     137 
    132138        if os.access("..", os.W_OK) and not \ 
    133139            os.path.exists(os.path.join("..", "turbogears")) and not \ 
     
    137143package to do its work. The parent directory of this one is writeable. 
    138144Should the installation proceed from there ('n' to exit)?""" 
     145 
    139146            upone = get_yesno() 
    140147            if upone == "n": 
    141148                sys.exit(1) 
    142149            os.chdir("..") 
     150 
    143151        else: 
    144152            print """ 
     
    156164    print "Beginning setuptools/EasyInstall installation and TurboGears " \ 
    157165          "download\n" 
     166 
    158167    if len(sys.argv) > 1: 
    159168        args = sys.argv[1:] 
     169 
    160170    else: 
    161171        args = [] 
     172 
    162173    main(args) 
     174 
    163175    if post_install_msgs: 
    164176        print """ 
     
    173185    try: 
    174186        from setuptools.command import easy_install as eimodule 
     187 
    175188    except ImportError: 
    176189        import easy_install as eimodule 
     
    210223    you install. To do that on Windows: 
    211224 
    212     Go to System Properties -> Advanced -> Environment Variables and add or edit the PATH variable to have ;C:\Python24;C:\Python24\Scripts, assuming you installed Python to the default location.""") 
     225    Go to System Properties -> Advanced -> Environment Variables and add or edit the PATH variable to have ;C:\Python25;C:\Python25\Scripts, assuming you installed Python to the default location.""") 
    213226             
    214227            if self.find_links is None: 
     
    327340    try: 
    328341        import setuptools 
     342 
    329343    except ImportError: 
    330344        egg = None 
     
    345359            use_setuptools(version) 
    346360 
    347     req = "setuptools>="+version 
     361    req = "setuptools>=" + version 
    348362    import pkg_resources 
    349363    try: 
    350364        pkg_resources.require(req) 
     365 
    351366    except pkg_resources.VersionConflict: 
    352367        try: 
     
    399414 
    400415if __name__=='__main__': 
    401     if len(sys.argv)>2 and sys.argv[1]=='--md5update': 
     416    if len(sys.argv) > 2 and sys.argv[1] == '--md5update': 
    402417        update_md5(sys.argv[2:]) 
     418 
    403419    else: 
    404420        tg_main()