Changeset 2366


Ignore:
Timestamp:
05/17/11 21:24:09 (3 years ago)
Author:
wehart
Message:

Update for a new version of virtualenv

Location:
pyutilib.virtualenv/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • pyutilib.virtualenv/trunk/pyutilib/virtualenv/header.py

    r2362 r2366  
    12951295default_install_setuptools = install_setuptools 
    12961296 
    1297 def install_setuptools(py_executable, unzip=False): 
     1297 
     1298def install_setuptools(py_executable, unzip=False, 
     1299                       search_dirs=None, never_download=False): 
    12981300    try: 
    12991301        if install_setuptools.use_default: 
    1300             default_install_setuptools(py_executable, unzip) 
     1302            default_install_setuptools(py_executable, unzip, search_dirs, never_download) 
    13011303    except OSError, err: 
    13021304        print "-----------------------------------------------------------------" 
  • pyutilib.virtualenv/trunk/pyutilib/virtualenv/vpy_install.py

    r2364 r2366  
    11#!/usr/bin/env python 
    22## WARNING: This file is generated 
     3#!/usr/bin/env python 
    34"""Create a "virtual" Python installation 
    45""" 
    56 
    6 # If you change the version here, change it in setup.py 
     7# If you change the version here, change it in setup.py  
    78# and docs/conf.py as well. 
    8 virtualenv_version = "1.6" 
     9virtualenv_version = "1.6.1" 
    910 
    1011import base64 
     
    460461    return filename 
    461462 
    462 def _install_req(py_executable, unzip=False, distribute=False): 
     463def _install_req(py_executable, unzip=False, distribute=False, 
     464                 search_dirs=None, never_download=False): 
     465 
     466    if search_dirs is None: 
     467        search_dirs = file_search_dirs() 
     468 
    463469    if not distribute: 
    464470        setup_fn = 'setuptools-0.6c11-py%s.egg' % sys.version[:3] 
     
    468474    else: 
    469475        setup_fn = None 
    470         source = 'distribute-0.6.15.tar.gz' 
     476        source = 'distribute-0.6.16.tar.gz' 
    471477        project_name = 'distribute' 
    472478        bootstrap_script = DISTRIBUTE_SETUP_PY 
     
    482488        except ImportError: 
    483489            pass 
    484  
    485     search_dirs = file_search_dirs() 
    486490 
    487491    if setup_fn is not None: 
     
    518522        # the source is found, let's chdir 
    519523        if source is not None and os.path.exists(source): 
     524            logger.info('Using existing %s egg: %s' % (project_name, source)) 
    520525            os.chdir(os.path.dirname(source)) 
    521526            # in this case, we want to be sure that PYTHONPATH is unset (not 
     
    524529            remove_from_env.append('PYTHONPATH') 
    525530        else: 
     531            if never_download: 
     532                logger.fatal("Can't find any local distributions of %s to install " 
     533                             "and --never-download is set.  Either re-run virtualenv " 
     534                             "without the --never-download option, or place a %s " 
     535                             "distribution (%s) in one of these " 
     536                             "locations: %r" % (project_name, project_name,  
     537                                                setup_fn or source, 
     538                                                search_dirs)) 
     539                sys.exit(1) 
     540 
    526541            logger.info('No %s egg found; downloading' % project_name) 
    527542        cmd.extend(['--always-copy', '-U', project_name]) 
     
    570585    return [d for d in dirs if os.path.isdir(d)] 
    571586 
    572 def install_setuptools(py_executable, unzip=False): 
    573     _install_req(py_executable, unzip) 
    574  
    575 def install_distribute(py_executable, unzip=False): 
    576     _install_req(py_executable, unzip, distribute=True) 
     587def install_setuptools(py_executable, unzip=False, 
     588                       search_dirs=None, never_download=False): 
     589    _install_req(py_executable, unzip,  
     590                 search_dirs=search_dirs, never_download=never_download) 
     591 
     592def install_distribute(py_executable, unzip=False,  
     593                       search_dirs=None, never_download=False): 
     594    _install_req(py_executable, unzip, distribute=True,  
     595                 search_dirs=search_dirs, never_download=never_download) 
    577596 
    578597_pip_re = re.compile(r'^pip-.*(zip|tar.gz|tar.bz2|tgz|tbz)$', re.I) 
    579 def install_pip(py_executable): 
     598def install_pip(py_executable, search_dirs=None, never_download=False):     
     599    if search_dirs is None: 
     600        search_dirs = file_search_dirs() 
     601 
    580602    filenames = [] 
    581     for dir in file_search_dirs(): 
     603    for dir in search_dirs: 
    582604        filenames.extend([join(dir, fn) for fn in os.listdir(dir) 
    583605                          if _pip_re.search(fn)]) 
     
    594616    cmd = [py_executable, join(os.path.dirname(py_executable), easy_install_script), filename] 
    595617    if filename == 'pip': 
     618        if never_download: 
     619            logger.fatal("Can't find any local distributions of pip to install " 
     620                         "and --never-download is set.  Either re-run virtualenv " 
     621                         "without the --never-download option, or place a pip " 
     622                         "source distribution (zip/tar.gz/tar.bz2) in one of these " 
     623                         "locations: %r" % search_dirs) 
     624            sys.exit(1) 
    596625        logger.info('Installing pip from network...') 
    597626    else: 
    598         logger.info('Installing %s' % os.path.basename(filename)) 
     627        logger.info('Installing existing %s distribution: %s' % ( 
     628                os.path.basename(filename), filename)) 
     629    logger.start_progress('Installing pip...') 
    599630    logger.indent += 2 
    600631    def _filter_setup(line): 
     
    605636    finally: 
    606637        logger.indent -= 2 
     638        logger.end_progress() 
    607639 
    608640def filter_ez_setup(line, project_name='setuptools'): 
     
    685717        'VIRTUALENV_USE_DISTRIBUTE to make it the default ') 
    686718 
     719    default_search_dirs = file_search_dirs() 
     720    parser.add_option( 
     721        '--extra-search-dir', 
     722        dest="search_dirs", 
     723        action="append", 
     724        default=default_search_dirs, 
     725        help="Directory to look for setuptools/distribute/pip distributions in. " 
     726        "You can add any number of additional --extra-search-dir paths.") 
     727 
     728    parser.add_option( 
     729        '--never-download', 
     730        dest="never_download", 
     731        action="store_true", 
     732        help="Never download anything from the network.  Instead, virtualenv will fail " 
     733        "if local distributions of setuptools/distribute/pip are not present.") 
     734 
    687735    parser.add_option( 
    688736        '--prompt=', 
     
    745793                       unzip_setuptools=options.unzip_setuptools, 
    746794                       use_distribute=options.use_distribute or majver > 2, 
    747                        prompt=options.prompt) 
     795                       prompt=options.prompt, 
     796                       search_dirs=options.search_dirs, 
     797                       never_download=options.never_download) 
    748798    if 'after_install' in globals(): 
    749799        after_install(options, home_dir) 
     
    822872def create_environment(home_dir, site_packages=True, clear=False, 
    823873                       unzip_setuptools=False, use_distribute=False, 
    824                        prompt=None): 
     874                       prompt=None, search_dirs=None, never_download=False): 
    825875    """ 
    826876    Creates a new environment in ``home_dir``. 
     
    841891 
    842892    if use_distribute or os.environ.get('VIRTUALENV_USE_DISTRIBUTE'): 
    843         install_distribute(py_executable, unzip=unzip_setuptools) 
     893        install_distribute(py_executable, unzip=unzip_setuptools,  
     894                           search_dirs=search_dirs, never_download=never_download) 
    844895    else: 
    845         install_setuptools(py_executable, unzip=unzip_setuptools) 
    846  
    847     install_pip(py_executable) 
     896        install_setuptools(py_executable, unzip=unzip_setuptools,  
     897                           search_dirs=search_dirs, never_download=never_download) 
     898 
     899    install_pip(py_executable, search_dirs=search_dirs, never_download=never_download) 
    848900 
    849901    install_activate(home_dir, bin_dir, prompt) 
     
    11381190            sys.exit(100) 
    11391191        else: 
    1140             raise e 
     1192          raise e 
    11411193 
    11421194    proc_stdout = proc_stdout.strip().decode(sys.getdefaultencoding()) 
     
    12311283    if not os.path.exists(exe): 
    12321284        logger.fatal('The executable %s (from --python=%s) does not exist' % (exe, exe)) 
    1233         sys.exit(3) 
     1285        raise SystemExit(3) 
     1286    if not is_executable(exe): 
     1287        logger.fatal('The executable %s (from --python=%s) is not executable' % (exe, exe)) 
     1288        raise SystemExit(3) 
    12341289    return exe 
     1290 
     1291def is_executable(exe): 
     1292    """Checks a file is executable""" 
     1293    return os.access(exe, os.X_OK) 
    12351294 
    12361295############################################################ 
     
    42074266default_install_setuptools = install_setuptools 
    42084267 
    4209 def install_setuptools(py_executable, unzip=False): 
     4268 
     4269def install_setuptools(py_executable, unzip=False, 
     4270                       search_dirs=None, never_download=False): 
    42104271    try: 
    42114272        if install_setuptools.use_default: 
    4212             default_install_setuptools(py_executable, unzip) 
     4273            default_install_setuptools(py_executable, unzip, search_dirs, never_download) 
    42134274    except OSError, err: 
    42144275        print "-----------------------------------------------------------------" 
     
    42834344    b = base64.b64decode(s.encode('ascii')) 
    42844345    return zlib.decompress(b).decode('utf-8') 
    4285  
     4346     
    42864347##file site.py 
    42874348SITE_PY = convert(""" 
     
    43944455R9fk+uoGrt9o73MAOHRdkFWQlh09HeHcUWXhM9PuuXABPxSiE263aVU3STbVNwRM0WGb2o11jac9 
    43954456f3XnyULrrYCTX4AHfKhLxcFxMFU2SE+s9DRHAU7EUqcoYvdIk3/6pyzQy3vBvhL4FEiZxdQcxDVJ 
    4396 pCvLrvaE4zO+gsBR8QjqK3Nq5iE2wZzd6B17cKcxoaKncNwt5ey1wg0WU5tvPe9uZPCoITuwfC9+ 
    4397 Xu7wKiGY1pNFTP9C382jaxxwR+zRg2fpjAYLhyqe7++rSxAxHNyAJC1TuTh8ohA7xvn3QtVQ2nnt 
    4398 5xuaMR6IPrA1UPoscHtCgg5CzcDH37bqxVE0xhu1g5hDxlor8HlMFGG2R/YMuSlD6ZQC2nu+sExQ 
    4399 o+erauTZ6dBWFX7DuzrgvSaoy+J7tzB1UbcFOxCh65N7vCHVNhwI0R7BQyHdK0KL9lVnk/aPXDyu 
    4400 E9+31dfD8puv78LTNauDRfIDBPWI6bT6A5lqL8s8dmEesHt+P/89nPfu4rtHU0n3GqYVBjZYVrxO 
    4401 +A0aqKY8toG/EUncmIncYjP81DeDxzBYHFE31TfhXdPn/nfNXbcI7MzNXmtv7v5xK5cGuu9+fhmi 
    4402 AQddmhAPquBuBXZYF7hiPNFb/MMJRP1B8rudcKZ7tMJ9YExBAaYjiU019kZrbpK5+x3rVQ75RlH3 
    4403 dN2gru5Mu3fcsMvxD1G0vDePz+2BWyq4WGgOZC+OroiacgnfVK5Waprg9WRTcv2p3KTn0xln8h3d 
    4404 LiUTtTM+IN7hASAMN+nCQLf2FxgDwgu+JpWrNZzLGgQNTTWNTpGkShecz9EOJ4CLOY9D/U2ekKsc 
    4405 R5nE9JtqqrICH32kL9PkMoKhyssWqEkrbBJ1Y1A3PSb6bkUcgmtXzIk8zh6x3+9RBwjBB3Wcm4K4 
    4406 bHg6te+AX561J4/TiWUImTcbWSV1e+uGv2mZiu+cEegcJi6wkzhoJbPDKS5iqeUPBykM3e33r7TL 
    4407 67n8dxw3Hlut93C2oh46IfWYk8yO7THcnH6xt265t70s6I5W18jbZi332ZtGYCnMFVKkK3Ukz2/1 
    4408 tTZ8WSLnGdFNcPgI5N49BeUXy1q1xk6KRcN55iqG/j0meJCWbPHQ9WQ9LuhfROYzQzu+rzcss/R2 
    4409 qPY0tlTUrtWg4mlHG7fxLda13RPf+rXLj4xvPfgPjG/1ZXJgcDQ+Wh8MVjPfEwizmnBvZmsZAfpM 
    4410 gUi4z9a518uYzMitDYYgNP0ysjejss50DhwZM4Ec2b+yh0DwDWzKLaT0bkgy4w7Fl7500ePvLz68 
    4411 Pr0gWkwvT9/8x+n3VDuCydyOzXpwAiAvDpnah16VqpsM0Pv9Q4O32A5cdchHLTSE3vveVukAhOFj 
    4412 NUML2lVk7ut9HXrHE/qdAPG7p92Buk9lD0Lu+We6FN7d5e+Ukwb6Kdf+mV/OBqp5ZPYRWBzafQLz 
    4413 vk3tahntZb72LZxThddXJ9pv1Zfj7cnKjW0tKK0AZnSRv2xC1xT227QhOyrd++qpgBUPRZmLJUAK 
    4414 59K54IzuNmNQtX8xfgXKLsFdKXYYJ/aSWWrHyWtlb0/Gnam5jA1BvFNJo/78XGFfyGwPFYKAFZ6+ 
    4415 vosRMfpPb/fYzdEnSlwd0vnHQ1Q21/YXrpl2cv+W4hZoba/BUVxHwZtA0HjZZO62pu3T60DOH+XK 
    4416 i6VTcA+a7wjo3IqnAvZGn4kV4mwnQggk9fYd1vARHfUdVg7yaDcd7A2tnonDfafj3NNhQjzf33DR 
    4417 OYCme7zgHuqeHqoxZ5AcC4zFZPuOvYnvCDJvtgi698ZzPnCHT1+3Cl9vr54f29Qn8ju+dhQJFb2M 
    4418 HMN+5RSN3XnXmtOdmKWaUFURxmzOoUnd4tqByj7BvhinVzm/Jw4yu7AMaeS9Hy65MT28O6RHXUwt 
    4419 6x3DlET0RI1pWs5ZA427fTLuT7dVW30gfG7iAUB6KhBgIZiebnTq2HZcjBo901HhrKFbKt38d+hI 
    4420 BdW0+BzBPYzv1+LX7U7nHR/UnVE0/blBlwP1koNws+/ArcZeSmS/SehOveWDPS4AHx0d7v/8Af37 
    4421 1Va2+4u7/Grb6uXgcSX2ZbFAD+sWOiQyj2MwMqA3I9LWWNVtBB2vhGjp6DJUOzfkC3T8qOgP76Cl 
    4422 AIOc2an2AKxRCP4P1A2QJQ== 
     4457pCvLrvaE4zO+gsBR8QjqK3Nq5iE2wZzd6B17cKcxoaKncNwt5ey1wg0WU5tvPe9uZPCoITuwfC/e 
     4458TLB7cYP47kREzyfiz51AbF7u8OohIMOTRfxkEfo+IXW9On7R2rl+4NuBsBfIy+tHTzdLZzS9cKjG 
     4459+v6+uugRA9ANyO4ylYvDJwqxY5x/L1QNpZ3Xfk6lGeMR7ANbdaVPH7dnMujo1Qyiim2r0BzVZvxf 
     4460O4g51qz1EJ8ARaXBFtCeWjeFL53iQ3uzGBYmavT8lUUpmQ5tjuE3vB0E3muCukK1d9NUl5FbsAM5 
     4461AX1WkLfA2oYDQeEjeCikm0xo0b7qbAv/kYvHlen7Nhd7WH7z9V14ugI+WJY/QFCPmE6rP5Cp9rLM 
     4462YxfmAfv19/Pfw3nvLr57NJV0r2FaYSiFhczrhN+gSWzKY5tqMCKJW0GRW96Gn/pm8OAHiyPqpvom 
     4463vGv63P+uuesWgZ252d3tzd0/4OXSQPfdzy9DNOAwTxPiQTXjrcAO6wJXjCe6qGA4Zak/SH63E850 
     4464j1a4D4wpYcAEKLGpxt5ozU0yd79jhcwh32Hqnucb1NWdafcOOHY5/iGKlqsB8Lk94kslHgvNgew3 
     44650qVUUy4anMrVSk0TvBBtSsEGFbj0vEjjvr6j+6xkonbG68RbQwCE4SZdiuhWGwNjQEDDF7NyfYhz 
     4466PYSgoamK0inLVOmCM0jaxQVwMWeOqL/JTHJd5SiTmPBTTVVWEBWM9PWdXLgwVOvZAjWJjE2ibgzq 
     4467psdE3+aIQ3C1jDkDyPkqjjQ86gAh+GiQczcRFypPp/Yd8Muz9qxzOrEMIfNmI6ukbu/58LdJU/Gd 
     4468MwKd/MQFdlIVrWR2OMVFLLX84SCFyQL7/SvtZHtBxh0HnMdW6z2craiHToE95uy0Y3sMN6df7D1f 
     44697v0yC7oV1jXytlnLffZuE1gKc2kV6UqdO+C3+iIdvp6RM5voJjh8BHLvnrvyy3OtWmMnxaLhPHMV 
     4470Q//mFDy6S7Z46EK0Hhf0rz7rOPp2fF9vWGbphQZ7GlsqatdqUPG0o43biBor6e6JqP1q6UdG1B78 
     4471B0bU+vo6MDgaH60PBuun7wm9WU24d8G1jAB9pkAk3Nnr3CRmTGbkViND2Jt+Gdm7WFlnOkecjJlA 
     4472juxfEkQg+M435ZZuencymXGHIlpfuujx9xcfXp9eEC2ml6dv/uP0e6pWwfRxx2Y9OOWQF4dM7UOv 
     4473LtZNP+gKg6HBW2wHLlfkwx0aQu99b3N2AMLwQZ6hBe0qMvf1vg69AxH9ToD43dPuQN2nsgch9/wz 
     4474XXzv1hV0ClgD/ZSrDc0vZ8vWPDI7FywO7c6Eed8mk7WM9nJt+xbOqfvrqxPtt+rr+PbkAce2+pRW 
     4475AHPIyF82hWyOEthEJTsq3RvyqWQWj2GZqyxACufSuVKNblNjULV/FX8Fyi7BfTB2GCf2Wltqx+ly 
     4476Ze9rxr2wuYwNQbxzUKP+/FxhX8hsDxWCgBWevjCMETH6T28w2e3YJ0pcHdKJy0NUNtf2F66ZdnL/ 
     4477luKma20v3lFcucHbTtB42WTuRqrt0+tAzh9l54ulU+IPmu8I6NyKpwL2Rp+JFeJsJ0IIJPWGIVYN 
     4478Eh31rVkO8mg3HewNrZ6Jw33n8dzzaEI8399w0Tnypnu84B7qnh6qMaeeHAuM5Wv7DtqJ7wgyb+8I 
     4479umnHcz5wT1Ff8Apfb6+eH9tkK/I7vnYUCZXZjBzDfuWUqd15u5vTnZilmlAdE8ZszjFN3eLagco+ 
     4480wb4Yp1ervycOMvu+DGnkvR8u8jE9vFurR11MLesdw5RE9ESNaVrO6QaNu30y7k+3VVt9IHxS4wFA 
     4481eioQYCGYnm50Kud2XP4aPdNR4ayhezHdjHvoSAVV0fgcwT2M79fi1+1OJywf1J1RNP25QZcD9ZKD 
     4482cLPvwK3GXkpkv0noTr3lgz0uAB9WHe7//AH9+/VdtvuLu/xq2+rl4AEp9mWxJBArJTokMo9jMDKg 
     4483NyPS1lhHbgQdL6Fo6egyVDs35At0/KjMEG+9pQCDnNmp9gCsUQj+D1/Qrqc= 
    44234484""") 
     4485 
     4486 
    44244487 
    44254488 
     
    44954558BDaonX65d/fwEjNqlDjLVIvM9X+XVxF7 
    44964559""") 
     4560 
     4561 
    44974562 
    44984563 
     
    45834648 
    45844649 
     4650 
     4651 
    45854652##file activate.sh 
    45864653ACTIVATE_SH = convert(""" 
     
    46004667LLK0j1y0Uwbmn438VZkVpqlfNKa/YET/53j+99G8H8tUhr9ZSXs2 
    46014668""") 
     4669 
     4670 
    46024671 
    46034672 
     
    46284697 
    46294698 
     4699 
     4700 
    46304701##file activate.csh 
    46314702ACTIVATE_CSH = convert(""" 
     
    46434714 
    46444715 
     4716 
     4717 
    46454718##file activate.bat 
    46464719ACTIVATE_BAT = convert(""" 
     
    46534726 
    46544727 
     4728 
     4729 
    46554730##file deactivate.bat 
    46564731DEACTIVATE_BAT = convert(""" 
     
    46594734i2dASrm4rFz9XLgAwJNbyQ== 
    46604735""") 
     4736 
     4737 
    46614738 
    46624739 
     
    46904767 
    46914768 
     4769 
     4770 
    46924771##file distutils.cfg 
    46934772DISTUTILS_CFG = convert(""" 
     
    469647759FDOlL0FPGluf4QjcInLlxd6f6rqkgPu/5nHLg0cXCscXoozRrP51DRT3j9QNl99AP53T2Q= 
    46974776""") 
     4777 
     4778 
    46984779 
    46994780 
     
    47144795 
    47154796 
     4797 
     4798 
    47164799if __name__ == '__main__': 
    47174800    main() 
  • pyutilib.virtualenv/trunk/scripts/vpy_install

    r2362 r2366  
    11#!/usr/bin/env python 
    22## WARNING: This file is generated 
     3#!/usr/bin/env python 
    34"""Create a "virtual" Python installation 
    45""" 
     
    67# If you change the version here, change it in setup.py  
    78# and docs/conf.py as well. 
    8 virtualenv_version = "1.6" 
     9virtualenv_version = "1.6.1" 
    910 
    1011import base64 
     
    460461    return filename 
    461462 
    462 def _install_req(py_executable, unzip=False, distribute=False): 
     463def _install_req(py_executable, unzip=False, distribute=False, 
     464                 search_dirs=None, never_download=False): 
     465 
     466    if search_dirs is None: 
     467        search_dirs = file_search_dirs() 
     468 
    463469    if not distribute: 
    464470        setup_fn = 'setuptools-0.6c11-py%s.egg' % sys.version[:3] 
     
    468474    else: 
    469475        setup_fn = None 
    470         source = 'distribute-0.6.15.tar.gz' 
     476        source = 'distribute-0.6.16.tar.gz' 
    471477        project_name = 'distribute' 
    472478        bootstrap_script = DISTRIBUTE_SETUP_PY 
     
    482488        except ImportError: 
    483489            pass 
    484  
    485     search_dirs = file_search_dirs() 
    486490 
    487491    if setup_fn is not None: 
     
    518522        # the source is found, let's chdir 
    519523        if source is not None and os.path.exists(source): 
     524            logger.info('Using existing %s egg: %s' % (project_name, source)) 
    520525            os.chdir(os.path.dirname(source)) 
    521526            # in this case, we want to be sure that PYTHONPATH is unset (not 
     
    524529            remove_from_env.append('PYTHONPATH') 
    525530        else: 
     531            if never_download: 
     532                logger.fatal("Can't find any local distributions of %s to install " 
     533                             "and --never-download is set.  Either re-run virtualenv " 
     534                             "without the --never-download option, or place a %s " 
     535                             "distribution (%s) in one of these " 
     536                             "locations: %r" % (project_name, project_name,  
     537                                                setup_fn or source, 
     538                                                search_dirs)) 
     539                sys.exit(1) 
     540 
    526541            logger.info('No %s egg found; downloading' % project_name) 
    527542        cmd.extend(['--always-copy', '-U', project_name]) 
     
    570585    return [d for d in dirs if os.path.isdir(d)] 
    571586 
    572 def install_setuptools(py_executable, unzip=False): 
    573     _install_req(py_executable, unzip) 
    574  
    575 def install_distribute(py_executable, unzip=False): 
    576     _install_req(py_executable, unzip, distribute=True) 
     587def install_setuptools(py_executable, unzip=False, 
     588                       search_dirs=None, never_download=False): 
     589    _install_req(py_executable, unzip,  
     590                 search_dirs=search_dirs, never_download=never_download) 
     591 
     592def install_distribute(py_executable, unzip=False,  
     593                       search_dirs=None, never_download=False): 
     594    _install_req(py_executable, unzip, distribute=True,  
     595                 search_dirs=search_dirs, never_download=never_download) 
    577596 
    578597_pip_re = re.compile(r'^pip-.*(zip|tar.gz|tar.bz2|tgz|tbz)$', re.I) 
    579 def install_pip(py_executable): 
     598def install_pip(py_executable, search_dirs=None, never_download=False):     
     599    if search_dirs is None: 
     600        search_dirs = file_search_dirs() 
     601 
    580602    filenames = [] 
    581     for dir in file_search_dirs(): 
     603    for dir in search_dirs: 
    582604        filenames.extend([join(dir, fn) for fn in os.listdir(dir) 
    583605                          if _pip_re.search(fn)]) 
     
    594616    cmd = [py_executable, join(os.path.dirname(py_executable), easy_install_script), filename] 
    595617    if filename == 'pip': 
     618        if never_download: 
     619            logger.fatal("Can't find any local distributions of pip to install " 
     620                         "and --never-download is set.  Either re-run virtualenv " 
     621                         "without the --never-download option, or place a pip " 
     622                         "source distribution (zip/tar.gz/tar.bz2) in one of these " 
     623                         "locations: %r" % search_dirs) 
     624            sys.exit(1) 
    596625        logger.info('Installing pip from network...') 
    597626    else: 
    598         logger.info('Installing %s' % os.path.basename(filename)) 
     627        logger.info('Installing existing %s distribution: %s' % ( 
     628                os.path.basename(filename), filename)) 
     629    logger.start_progress('Installing pip...') 
    599630    logger.indent += 2 
    600631    def _filter_setup(line): 
     
    605636    finally: 
    606637        logger.indent -= 2 
     638        logger.end_progress() 
    607639 
    608640def filter_ez_setup(line, project_name='setuptools'): 
     
    685717        'VIRTUALENV_USE_DISTRIBUTE to make it the default ') 
    686718 
     719    default_search_dirs = file_search_dirs() 
     720    parser.add_option( 
     721        '--extra-search-dir', 
     722        dest="search_dirs", 
     723        action="append", 
     724        default=default_search_dirs, 
     725        help="Directory to look for setuptools/distribute/pip distributions in. " 
     726        "You can add any number of additional --extra-search-dir paths.") 
     727 
     728    parser.add_option( 
     729        '--never-download', 
     730        dest="never_download", 
     731        action="store_true", 
     732        help="Never download anything from the network.  Instead, virtualenv will fail " 
     733        "if local distributions of setuptools/distribute/pip are not present.") 
     734 
    687735    parser.add_option( 
    688736        '--prompt=', 
     
    745793                       unzip_setuptools=options.unzip_setuptools, 
    746794                       use_distribute=options.use_distribute or majver > 2, 
    747                        prompt=options.prompt) 
     795                       prompt=options.prompt, 
     796                       search_dirs=options.search_dirs, 
     797                       never_download=options.never_download) 
    748798    if 'after_install' in globals(): 
    749799        after_install(options, home_dir) 
     
    822872def create_environment(home_dir, site_packages=True, clear=False, 
    823873                       unzip_setuptools=False, use_distribute=False, 
    824                        prompt=None): 
     874                       prompt=None, search_dirs=None, never_download=False): 
    825875    """ 
    826876    Creates a new environment in ``home_dir``. 
     
    841891 
    842892    if use_distribute or os.environ.get('VIRTUALENV_USE_DISTRIBUTE'): 
    843         install_distribute(py_executable, unzip=unzip_setuptools) 
     893        install_distribute(py_executable, unzip=unzip_setuptools,  
     894                           search_dirs=search_dirs, never_download=never_download) 
    844895    else: 
    845         install_setuptools(py_executable, unzip=unzip_setuptools) 
    846  
    847     install_pip(py_executable) 
     896        install_setuptools(py_executable, unzip=unzip_setuptools,  
     897                           search_dirs=search_dirs, never_download=never_download) 
     898 
     899    install_pip(py_executable, search_dirs=search_dirs, never_download=never_download) 
    848900 
    849901    install_activate(home_dir, bin_dir, prompt) 
     
    12311283    if not os.path.exists(exe): 
    12321284        logger.fatal('The executable %s (from --python=%s) does not exist' % (exe, exe)) 
    1233         sys.exit(3) 
     1285        raise SystemExit(3) 
     1286    if not is_executable(exe): 
     1287        logger.fatal('The executable %s (from --python=%s) is not executable' % (exe, exe)) 
     1288        raise SystemExit(3) 
    12341289    return exe 
     1290 
     1291def is_executable(exe): 
     1292    """Checks a file is executable""" 
     1293    return os.access(exe, os.X_OK) 
    12351294 
    12361295############################################################ 
     
    42074266default_install_setuptools = install_setuptools 
    42084267 
    4209 def install_setuptools(py_executable, unzip=False): 
     4268 
     4269def install_setuptools(py_executable, unzip=False, 
     4270                       search_dirs=None, never_download=False): 
    42104271    try: 
    42114272        if install_setuptools.use_default: 
    4212             default_install_setuptools(py_executable, unzip) 
     4273            default_install_setuptools(py_executable, unzip, search_dirs, never_download) 
    42134274    except OSError, err: 
    42144275        print "-----------------------------------------------------------------" 
     
    43944455R9fk+uoGrt9o73MAOHRdkFWQlh09HeHcUWXhM9PuuXABPxSiE263aVU3STbVNwRM0WGb2o11jac9 
    43954456f3XnyULrrYCTX4AHfKhLxcFxMFU2SE+s9DRHAU7EUqcoYvdIk3/6pyzQy3vBvhL4FEiZxdQcxDVJ 
    4396 pCvLrvaE4zO+gsBR8QjqK3Nq5iE2wZzd6B17cKcxoaKncNwt5ey1wg0WU5tvPe9uZPCoITuwfC9+ 
    4397 Xu7wKiGY1pNFTP9C382jaxxwR+zRg2fpjAYLhyqe7++rSxAxHNyAJC1TuTh8ohA7xvn3QtVQ2nnt 
    4398 5xuaMR6IPrA1UPoscHtCgg5CzcDH37bqxVE0xhu1g5hDxlor8HlMFGG2R/YMuSlD6ZQC2nu+sExQ 
    4399 o+erauTZ6dBWFX7DuzrgvSaoy+J7tzB1UbcFOxCh65N7vCHVNhwI0R7BQyHdK0KL9lVnk/aPXDyu 
    4400 E9+31dfD8puv78LTNauDRfIDBPWI6bT6A5lqL8s8dmEesHt+P/89nPfu4rtHU0n3GqYVBjZYVrxO 
    4401 +A0aqKY8toG/EUncmIncYjP81DeDxzBYHFE31TfhXdPn/nfNXbcI7MzNXmtv7v5xK5cGuu9+fhmi 
    4402 AQddmhAPquBuBXZYF7hiPNFb/MMJRP1B8rudcKZ7tMJ9YExBAaYjiU019kZrbpK5+x3rVQ75RlH3 
    4403 dN2gru5Mu3fcsMvxD1G0vDePz+2BWyq4WGgOZC+OroiacgnfVK5Waprg9WRTcv2p3KTn0xln8h3d 
    4404 LiUTtTM+IN7hASAMN+nCQLf2FxgDwgu+JpWrNZzLGgQNTTWNTpGkShecz9EOJ4CLOY9D/U2ekKsc 
    4405 R5nE9JtqqrICH32kL9PkMoKhyssWqEkrbBJ1Y1A3PSb6bkUcgmtXzIk8zh6x3+9RBwjBB3Wcm4K4 
    4406 bHg6te+AX561J4/TiWUImTcbWSV1e+uGv2mZiu+cEegcJi6wkzhoJbPDKS5iqeUPBykM3e33r7TL 
    4407 67n8dxw3Hlut93C2oh46IfWYk8yO7THcnH6xt265t70s6I5W18jbZi332ZtGYCnMFVKkK3Ukz2/1 
    4408 tTZ8WSLnGdFNcPgI5N49BeUXy1q1xk6KRcN55iqG/j0meJCWbPHQ9WQ9LuhfROYzQzu+rzcss/R2 
    4409 qPY0tlTUrtWg4mlHG7fxLda13RPf+rXLj4xvPfgPjG/1ZXJgcDQ+Wh8MVjPfEwizmnBvZmsZAfpM 
    4410 gUi4z9a518uYzMitDYYgNP0ysjejss50DhwZM4Ec2b+yh0DwDWzKLaT0bkgy4w7Fl7500ePvLz68 
    4411 Pr0gWkwvT9/8x+n3VDuCydyOzXpwAiAvDpnah16VqpsM0Pv9Q4O32A5cdchHLTSE3vveVukAhOFj 
    4412 NUML2lVk7ut9HXrHE/qdAPG7p92Buk9lD0Lu+We6FN7d5e+Ukwb6Kdf+mV/OBqp5ZPYRWBzafQLz 
    4413 vk3tahntZb72LZxThddXJ9pv1Zfj7cnKjW0tKK0AZnSRv2xC1xT227QhOyrd++qpgBUPRZmLJUAK 
    4414 59K54IzuNmNQtX8xfgXKLsFdKXYYJ/aSWWrHyWtlb0/Gnam5jA1BvFNJo/78XGFfyGwPFYKAFZ6+ 
    4415 vosRMfpPb/fYzdEnSlwd0vnHQ1Q21/YXrpl2cv+W4hZoba/BUVxHwZtA0HjZZO62pu3T60DOH+XK 
    4416 i6VTcA+a7wjo3IqnAvZGn4kV4mwnQggk9fYd1vARHfUdVg7yaDcd7A2tnonDfafj3NNhQjzf33DR 
    4417 OYCme7zgHuqeHqoxZ5AcC4zFZPuOvYnvCDJvtgi698ZzPnCHT1+3Cl9vr54f29Qn8ju+dhQJFb2M 
    4418 HMN+5RSN3XnXmtOdmKWaUFURxmzOoUnd4tqByj7BvhinVzm/Jw4yu7AMaeS9Hy65MT28O6RHXUwt 
    4419 6x3DlET0RI1pWs5ZA427fTLuT7dVW30gfG7iAUB6KhBgIZiebnTq2HZcjBo901HhrKFbKt38d+hI 
    4420 BdW0+BzBPYzv1+LX7U7nHR/UnVE0/blBlwP1koNws+/ArcZeSmS/SehOveWDPS4AHx0d7v/8Af37 
    4421 1Va2+4u7/Grb6uXgcSX2ZbFAD+sWOiQyj2MwMqA3I9LWWNVtBB2vhGjp6DJUOzfkC3T8qOgP76Cl 
    4422 AIOc2an2AKxRCP4P1A2QJQ== 
     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 
    44234484""") 
     4485 
     4486 
    44244487 
    44254488 
     
    44954558BDaonX65d/fwEjNqlDjLVIvM9X+XVxF7 
    44964559""") 
     4560 
     4561 
    44974562 
    44984563 
     
    45834648 
    45844649 
     4650 
     4651 
    45854652##file activate.sh 
    45864653ACTIVATE_SH = convert(""" 
     
    46004667LLK0j1y0Uwbmn438VZkVpqlfNKa/YET/53j+99G8H8tUhr9ZSXs2 
    46014668""") 
     4669 
     4670 
    46024671 
    46034672 
     
    46284697 
    46294698 
     4699 
     4700 
    46304701##file activate.csh 
    46314702ACTIVATE_CSH = convert(""" 
     
    46434714 
    46444715 
     4716 
     4717 
    46454718##file activate.bat 
    46464719ACTIVATE_BAT = convert(""" 
     
    46534726 
    46544727 
     4728 
     4729 
    46554730##file deactivate.bat 
    46564731DEACTIVATE_BAT = convert(""" 
     
    46594734i2dASrm4rFz9XLgAwJNbyQ== 
    46604735""") 
     4736 
     4737 
    46614738 
    46624739 
     
    46904767 
    46914768 
     4769 
     4770 
    46924771##file distutils.cfg 
    46934772DISTUTILS_CFG = convert(""" 
     
    469647759FDOlL0FPGluf4QjcInLlxd6f6rqkgPu/5nHLg0cXCscXoozRrP51DRT3j9QNl99AP53T2Q= 
    46974776""") 
     4777 
     4778 
    46984779 
    46994780 
     
    47144795 
    47154796 
     4797 
     4798 
    47164799if __name__ == '__main__': 
    47174800    main() 
Note: See TracChangeset for help on using the changeset viewer.