~ubuntu-branches/ubuntu/quantal/enigmail/quantal-security

« back to all changes in this revision

Viewing changes to python/virtualenv/PKG-INFO

  • Committer: Package Import Robot
  • Author(s): Chris Coulson
  • Date: 2013-09-13 16:02:15 UTC
  • mfrom: (0.12.16)
  • Revision ID: package-import@ubuntu.com-20130913160215-u3g8nmwa0pdwagwc
Tags: 2:1.5.2-0ubuntu0.12.10.1
* New upstream release v1.5.2 for Thunderbird 24

* Build enigmail using a stripped down Thunderbird 17 build system, as it's
  now quite difficult to build the way we were doing previously, with the
  latest Firefox build system
* Add debian/patches/no_libxpcom.patch - Don't link against libxpcom, as it
  doesn't exist anymore (but exists in the build system)
* Add debian/patches/use_sdk.patch - Use the SDK version of xpt.py and
  friends
* Drop debian/patches/ipc-pipe_rename.diff (not needed anymore)
* Drop debian/patches/makefile_depth.diff (not needed anymore)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
Metadata-Version: 1.0
2
 
Name: virtualenv
3
 
Version: 1.7.1.2
4
 
Summary: Virtual Python Environment builder
5
 
Home-page: http://www.virtualenv.org
6
 
Author: Jannis Leidel, Carl Meyer and Brian Rosner
7
 
Author-email: python-virtualenv@groups.google.com
8
 
License: MIT
9
 
Description: 
10
 
        
11
 
        Installation
12
 
        ------------
13
 
        
14
 
        You can install virtualenv with ``pip install virtualenv``, or the `latest
15
 
        development version <https://github.com/pypa/virtualenv/tarball/develop#egg=virtualenv-dev>`_
16
 
        with ``pip install virtualenv==dev``.
17
 
        
18
 
        You can also use ``easy_install``, or if you have no Python package manager
19
 
        available at all, you can just grab the single file `virtualenv.py`_ and run
20
 
        it with ``python virtualenv.py``.
21
 
        
22
 
        .. _virtualenv.py: https://raw.github.com/pypa/virtualenv/master/virtualenv.py
23
 
        
24
 
        What It Does
25
 
        ------------
26
 
        
27
 
        ``virtualenv`` is a tool to create isolated Python environments.
28
 
        
29
 
        The basic problem being addressed is one of dependencies and versions,
30
 
        and indirectly permissions.  Imagine you have an application that
31
 
        needs version 1 of LibFoo, but another application requires version
32
 
        2.  How can you use both these applications?  If you install
33
 
        everything into ``/usr/lib/python2.7/site-packages`` (or whatever your
34
 
        platform's standard location is), it's easy to end up in a situation
35
 
        where you unintentionally upgrade an application that shouldn't be
36
 
        upgraded.
37
 
        
38
 
        Or more generally, what if you want to install an application *and
39
 
        leave it be*?  If an application works, any change in its libraries or
40
 
        the versions of those libraries can break the application.
41
 
        
42
 
        Also, what if you can't install packages into the global
43
 
        ``site-packages`` directory?  For instance, on a shared host.
44
 
        
45
 
        In all these cases, ``virtualenv`` can help you.  It creates an
46
 
        environment that has its own installation directories, that doesn't
47
 
        share libraries with other virtualenv environments (and optionally
48
 
        doesn't access the globally installed libraries either).
49
 
        
50
 
        The basic usage is::
51
 
        
52
 
            $ python virtualenv.py ENV
53
 
        
54
 
        If you install it you can also just do ``virtualenv ENV``.
55
 
        
56
 
        This creates ``ENV/lib/pythonX.X/site-packages``, where any libraries you
57
 
        install will go.  It also creates ``ENV/bin/python``, which is a Python
58
 
        interpreter that uses this environment.  Anytime you use that interpreter
59
 
        (including when a script has ``#!/path/to/ENV/bin/python`` in it) the libraries
60
 
        in that environment will be used.
61
 
        
62
 
        It also installs either `Setuptools
63
 
        <http://peak.telecommunity.com/DevCenter/setuptools>`_ or `distribute
64
 
        <http://pypi.python.org/pypi/distribute>`_ into the environment. To use
65
 
        Distribute instead of setuptools, just call virtualenv like this::
66
 
        
67
 
            $ python virtualenv.py --distribute ENV
68
 
        
69
 
        You can also set the environment variable VIRTUALENV_USE_DISTRIBUTE.
70
 
        
71
 
        A new virtualenv also includes the `pip <http://pypy.python.org/pypi/pip>`_
72
 
        installer, so you can use ``ENV/bin/pip`` to install additional packages into
73
 
        the environment.
74
 
        
75
 
        Environment variables and configuration files
76
 
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
77
 
        
78
 
        virtualenv can not only be configured by passing command line options such as
79
 
        ``--distribute`` but also by two other means:
80
 
        
81
 
        - Environment variables
82
 
        
83
 
          Each command line option is automatically used to look for environment
84
 
          variables with the name format ``VIRTUALENV_<UPPER_NAME>``. That means
85
 
          the name of the command line options are capitalized and have dashes
86
 
          (``'-'``) replaced with underscores (``'_'``).
87
 
        
88
 
          For example, to automatically install Distribute instead of setuptools
89
 
          you can also set an environment variable::
90
 
        
91
 
              $ export VIRTUALENV_USE_DISTRIBUTE=true
92
 
              $ python virtualenv.py ENV
93
 
        
94
 
          It's the same as passing the option to virtualenv directly::
95
 
        
96
 
              $ python virtualenv.py --distribute ENV
97
 
        
98
 
          This also works for appending command line options, like ``--find-links``.
99
 
          Just leave an empty space between the passsed values, e.g.::
100
 
        
101
 
              $ export VIRTUALENV_EXTRA_SEARCH_DIR="/path/to/dists /path/to/other/dists"
102
 
              $ virtualenv ENV
103
 
        
104
 
          is the same as calling::
105
 
        
106
 
              $ python virtualenv.py --extra-search-dir=/path/to/dists --extra-search-dir=/path/to/other/dists ENV
107
 
        
108
 
        - Config files
109
 
        
110
 
          virtualenv also looks for a standard ini config file. On Unix and Mac OS X
111
 
          that's ``$HOME/.virtualenv/virtualenv.ini`` and on Windows, it's
112
 
          ``%HOME%\\virtualenv\\virtualenv.ini``.
113
 
        
114
 
          The names of the settings are derived from the long command line option,
115
 
          e.g. the option ``--distribute`` would look like this::
116
 
        
117
 
              [virtualenv]
118
 
              distribute = true
119
 
        
120
 
          Appending options like ``--extra-search-dir`` can be written on multiple
121
 
          lines::
122
 
        
123
 
              [virtualenv]
124
 
              extra-search-dir =
125
 
                  /path/to/dists
126
 
                  /path/to/other/dists
127
 
        
128
 
        Please have a look at the output of ``virtualenv --help`` for a full list
129
 
        of supported options.
130
 
        
131
 
        Windows Notes
132
 
        ~~~~~~~~~~~~~
133
 
        
134
 
        Some paths within the virtualenv are slightly different on Windows: scripts and
135
 
        executables on Windows go in ``ENV\Scripts\`` instead of ``ENV/bin/`` and
136
 
        libraries go in ``ENV\Lib\`` rather than ``ENV/lib/``.
137
 
        
138
 
        To create a virtualenv under a path with spaces in it on Windows, you'll need
139
 
        the `win32api <http://sourceforge.net/projects/pywin32/>`_ library installed.
140
 
        
141
 
        PyPy Support
142
 
        ~~~~~~~~~~~~
143
 
        
144
 
        Beginning with virtualenv version 1.5 `PyPy <http://pypy.org>`_ is
145
 
        supported. To use PyPy 1.4 or 1.4.1, you need a version of virtualenv >= 1.5.
146
 
        To use PyPy 1.5, you need a version of virtualenv >= 1.6.1.
147
 
        
148
 
        Creating Your Own Bootstrap Scripts
149
 
        -----------------------------------
150
 
        
151
 
        While this creates an environment, it doesn't put anything into the
152
 
        environment.  Developers may find it useful to distribute a script
153
 
        that sets up a particular environment, for example a script that
154
 
        installs a particular web application.
155
 
        
156
 
        To create a script like this, call
157
 
        ``virtualenv.create_bootstrap_script(extra_text)``, and write the
158
 
        result to your new bootstrapping script.  Here's the documentation
159
 
        from the docstring:
160
 
        
161
 
        Creates a bootstrap script, which is like this script but with
162
 
        extend_parser, adjust_options, and after_install hooks.
163
 
        
164
 
        This returns a string that (written to disk of course) can be used
165
 
        as a bootstrap script with your own customizations.  The script
166
 
        will be the standard virtualenv.py script, with your extra text
167
 
        added (your extra text should be Python code).
168
 
        
169
 
        If you include these functions, they will be called:
170
 
        
171
 
        ``extend_parser(optparse_parser)``:
172
 
            You can add or remove options from the parser here.
173
 
        
174
 
        ``adjust_options(options, args)``:
175
 
            You can change options here, or change the args (if you accept
176
 
            different kinds of arguments, be sure you modify ``args`` so it is
177
 
            only ``[DEST_DIR]``).
178
 
        
179
 
        ``after_install(options, home_dir)``:
180
 
        
181
 
            After everything is installed, this function is called.  This
182
 
            is probably the function you are most likely to use.  An
183
 
            example would be::
184
 
        
185
 
                def after_install(options, home_dir):
186
 
                    if sys.platform == 'win32':
187
 
                        bin = 'Scripts'
188
 
                    else:
189
 
                        bin = 'bin'
190
 
                    subprocess.call([join(home_dir, bin, 'easy_install'),
191
 
                                     'MyPackage'])
192
 
                    subprocess.call([join(home_dir, bin, 'my-package-script'),
193
 
                                     'setup', home_dir])
194
 
        
195
 
            This example immediately installs a package, and runs a setup
196
 
            script from that package.
197
 
        
198
 
        Bootstrap Example
199
 
        ~~~~~~~~~~~~~~~~~
200
 
        
201
 
        Here's a more concrete example of how you could use this::
202
 
        
203
 
            import virtualenv, textwrap
204
 
            output = virtualenv.create_bootstrap_script(textwrap.dedent("""
205
 
            import os, subprocess
206
 
            def after_install(options, home_dir):
207
 
                etc = join(home_dir, 'etc')
208
 
                if not os.path.exists(etc):
209
 
                    os.makedirs(etc)
210
 
                subprocess.call([join(home_dir, 'bin', 'easy_install'),
211
 
                                 'BlogApplication'])
212
 
                subprocess.call([join(home_dir, 'bin', 'paster'),
213
 
                                 'make-config', 'BlogApplication',
214
 
                                 join(etc, 'blog.ini')])
215
 
                subprocess.call([join(home_dir, 'bin', 'paster'),
216
 
                                 'setup-app', join(etc, 'blog.ini')])
217
 
            """))
218
 
            f = open('blog-bootstrap.py', 'w').write(output)
219
 
        
220
 
        Another example is available `here
221
 
        <https://github.com/socialplanning/fassembler/blob/master/fassembler/create-venv-script.py>`_.
222
 
        
223
 
        activate script
224
 
        ~~~~~~~~~~~~~~~
225
 
        
226
 
        In a newly created virtualenv there will be a ``bin/activate`` shell
227
 
        script. For Windows systems, activation scripts are provided for CMD.exe
228
 
        and Powershell.
229
 
        
230
 
        On Posix systems you can do::
231
 
        
232
 
            $ source bin/activate
233
 
        
234
 
        This will change your ``$PATH`` to point to the virtualenv's ``bin/``
235
 
        directory.  (You have to use ``source`` because it changes your shell
236
 
        environment in-place.) This is all it does; it's purely a convenience.  If
237
 
        you directly run a script or the python interpreter from the virtualenv's
238
 
        ``bin/`` directory (e.g.  ``path/to/env/bin/pip`` or
239
 
        ``/path/to/env/bin/python script.py``) there's no need for activation.
240
 
        
241
 
        After activating an environment you can use the function ``deactivate`` to
242
 
        undo the changes to your ``$PATH``.
243
 
        
244
 
        The ``activate`` script will also modify your shell prompt to indicate
245
 
        which environment is currently active.  You can disable this behavior,
246
 
        which can be useful if you have your own custom prompt that already
247
 
        displays the active environment name.  To do so, set the
248
 
        ``VIRTUAL_ENV_DISABLE_PROMPT`` environment variable to any non-empty
249
 
        value before running the ``activate`` script.
250
 
        
251
 
        On Windows you just do::
252
 
        
253
 
            > \path\to\env\Scripts\activate
254
 
        
255
 
        And type `deactivate` to undo the changes.
256
 
        
257
 
        Based on your active shell (CMD.exe or Powershell.exe), Windows will use
258
 
        either activate.bat or activate.ps1 (as appropriate) to activate the
259
 
        virtual environment. If using Powershell, see the notes about code signing
260
 
        below.
261
 
        
262
 
        .. note::
263
 
        
264
 
            If using Powershell, the ``activate`` script is subject to the
265
 
            `execution policies`_ on the system. By default on Windows 7, the system's
266
 
            excution policy is set to ``Restricted``, meaning no scripts like the
267
 
            ``activate`` script are allowed to be executed. But that can't stop us
268
 
            from changing that slightly to allow it to be executed.
269
 
        
270
 
            In order to use the script, you have to relax your system's execution
271
 
            policy to ``AllSigned``, meaning all scripts on the system must be
272
 
            digitally signed to be executed. Since the virtualenv activation
273
 
            script is signed by one of the authors (Jannis Leidel) this level of
274
 
            the execution policy suffices. As an adminstrator run::
275
 
        
276
 
                PS C:\> Set-ExecutionPolicy AllSigned
277
 
        
278
 
            Then you'll be asked to trust the signer, when executing the script.
279
 
            You will be prompted with the following::
280
 
        
281
 
                PS C:\> virtualenv .\foo
282
 
                New python executable in C:\foo\Scripts\python.exe
283
 
                Installing setuptools................done.
284
 
                Installing pip...................done.
285
 
                PS C:\> .\foo\scripts\activate
286
 
        
287
 
                Do you want to run software from this untrusted publisher?
288
 
                File C:\foo\scripts\activate.ps1 is published by E=jannis@leidel.info,
289
 
                CN=Jannis Leidel, L=Berlin, S=Berlin, C=DE, Description=581796-Gh7xfJxkxQSIO4E0
290
 
                and is not trusted on your system. Only run scripts from trusted publishers.
291
 
                [V] Never run  [D] Do not run  [R] Run once  [A] Always run  [?] Help
292
 
                (default is "D"):A
293
 
                (foo) PS C:\>
294
 
        
295
 
            If you select ``[A] Always Run``, the certificate will be added to the
296
 
            Trusted Publishers of your user account, and will be trusted in this
297
 
            user's context henceforth. If you select ``[R] Run Once``, the script will
298
 
            be run, but you will be prometed on a subsequent invocation. Advanced users
299
 
            can add the signer's certificate to the Trusted Publishers of the Computer
300
 
            account to apply to all users (though this technique is out of scope of this
301
 
            document).
302
 
        
303
 
            Alternatively, you may relax the system execution policy to allow running
304
 
            of local scripts without verifying the code signature using the following::
305
 
        
306
 
                PS C:\> Set-ExecutionPolicy RemoteSigned
307
 
        
308
 
            Since the ``activate.ps1`` script is generated locally for each virtualenv,
309
 
            it is not considered a remote script and can then be executed.
310
 
        
311
 
        .. _`execution policies`: http://technet.microsoft.com/en-us/library/dd347641.aspx
312
 
        
313
 
        The ``--system-site-packages`` Option
314
 
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
315
 
        
316
 
        If you build with ``virtualenv --system-site-packages ENV``, your virtual
317
 
        environment will inherit packages from ``/usr/lib/python2.7/site-packages``
318
 
        (or wherever your global site-packages directory is).
319
 
        
320
 
        This can be used if you have control over the global site-packages directory,
321
 
        and you want to depend on the packages there.  If you want isolation from the
322
 
        global system, do not use this flag.
323
 
        
324
 
        Using Virtualenv without ``bin/python``
325
 
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
326
 
        
327
 
        Sometimes you can't or don't want to use the Python interpreter
328
 
        created by the virtualenv.  For instance, in a `mod_python
329
 
        <http://www.modpython.org/>`_ or `mod_wsgi <http://www.modwsgi.org/>`_
330
 
        environment, there is only one interpreter.
331
 
        
332
 
        Luckily, it's easy.  You must use the custom Python interpreter to
333
 
        *install* libraries.  But to *use* libraries, you just have to be sure
334
 
        the path is correct.  A script is available to correct the path.  You
335
 
        can setup the environment like::
336
 
        
337
 
            activate_this = '/path/to/env/bin/activate_this.py'
338
 
            execfile(activate_this, dict(__file__=activate_this))
339
 
        
340
 
        This will change ``sys.path`` and even change ``sys.prefix``, but also allow
341
 
        you to use an existing interpreter.  Items in your environment will show up
342
 
        first on ``sys.path``, before global items.  However, global items will
343
 
        always be accessible (as if the ``--system-site-packages`` flag had been used
344
 
        in creating the environment, whether it was or not).  Also, this cannot undo
345
 
        the activation of other environments, or modules that have been imported.
346
 
        You shouldn't try to, for instance, activate an environment before a web
347
 
        request; you should activate *one* environment as early as possible, and not
348
 
        do it again in that process.
349
 
        
350
 
        Making Environments Relocatable
351
 
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
352
 
        
353
 
        Note: this option is somewhat experimental, and there are probably
354
 
        caveats that have not yet been identified.  Also this does not
355
 
        currently work on Windows.
356
 
        
357
 
        Normally environments are tied to a specific path.  That means that
358
 
        you cannot move an environment around or copy it to another computer.
359
 
        You can fix up an environment to make it relocatable with the
360
 
        command::
361
 
        
362
 
            $ virtualenv --relocatable ENV
363
 
        
364
 
        This will make some of the files created by setuptools or distribute
365
 
        use relative paths, and will change all the scripts to use ``activate_this.py``
366
 
        instead of using the location of the Python interpreter to select the
367
 
        environment.
368
 
        
369
 
        **Note:** you must run this after you've installed *any* packages into
370
 
        the environment.  If you make an environment relocatable, then
371
 
        install a new package, you must run ``virtualenv --relocatable``
372
 
        again.
373
 
        
374
 
        Also, this **does not make your packages cross-platform**.  You can
375
 
        move the directory around, but it can only be used on other similar
376
 
        computers.  Some known environmental differences that can cause
377
 
        incompatibilities: a different version of Python, when one platform
378
 
        uses UCS2 for its internal unicode representation and another uses
379
 
        UCS4 (a compile-time option), obvious platform changes like Windows
380
 
        vs. Linux, or Intel vs. ARM, and if you have libraries that bind to C
381
 
        libraries on the system, if those C libraries are located somewhere
382
 
        different (either different versions, or a different filesystem
383
 
        layout).
384
 
        
385
 
        If you use this flag to create an environment, currently, the
386
 
        ``--system-site-packages`` option will be implied.
387
 
        
388
 
        The ``--extra-search-dir`` Option
389
 
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
390
 
        
391
 
        When it creates a new environment, virtualenv installs either
392
 
        setuptools or distribute, and pip.  In normal operation, the latest
393
 
        releases of these packages are fetched from the `Python Package Index
394
 
        <http://pypi.python.org>`_ (PyPI). In some circumstances, this
395
 
        behavior may not be wanted, for example if you are using virtualenv
396
 
        during a deployment and do not want to depend on Internet access and
397
 
        PyPI availability.
398
 
        
399
 
        As an alternative, you can provide your own versions of setuptools,
400
 
        distribute and/or pip on the filesystem, and tell virtualenv to use
401
 
        those distributions instead of downloading them from the Internet.  To
402
 
        use this feature, pass one or more ``--extra-search-dir`` options to
403
 
        virtualenv like this::
404
 
        
405
 
            $ virtualenv --extra-search-dir=/path/to/distributions ENV
406
 
        
407
 
        The ``/path/to/distributions`` path should point to a directory that
408
 
        contains setuptools, distribute and/or pip distributions.  Setuptools
409
 
        distributions must be ``.egg`` files; distribute and pip distributions
410
 
        should be `.tar.gz` source distributions.
411
 
        
412
 
        Virtualenv will still download these packages if no satisfactory local
413
 
        distributions are found.
414
 
        
415
 
        If you are really concerned about virtualenv fetching these packages
416
 
        from the Internet and want to ensure that it never will, you can also
417
 
        provide an option ``--never-download`` like so::
418
 
        
419
 
            $ virtualenv --extra-search-dir=/path/to/distributions --never-download ENV
420
 
        
421
 
        If this option is provided, virtualenv will never try to download
422
 
        setuptools/distribute or pip. Instead, it will exit with status code 1
423
 
        if it fails to find local distributions for any of these required
424
 
        packages. The local distribution lookup is done in this order and the
425
 
        following locations:
426
 
        
427
 
            #. The current directory.
428
 
            #. The directory where virtualenv.py is located.
429
 
            #. A ``virtualenv_support`` directory relative to the directory where
430
 
               virtualenv.py is located.
431
 
            #. If the file being executed is not named virtualenv.py (i.e. is a boot
432
 
               script), a ``virtualenv_support`` directory relative to wherever
433
 
               virtualenv.py is actually installed.
434
 
        
435
 
        Compare & Contrast with Alternatives
436
 
        ------------------------------------
437
 
        
438
 
        There are several alternatives that create isolated environments:
439
 
        
440
 
        * ``workingenv`` (which I do not suggest you use anymore) is the
441
 
          predecessor to this library.  It used the main Python interpreter,
442
 
          but relied on setting ``$PYTHONPATH`` to activate the environment.
443
 
          This causes problems when running Python scripts that aren't part of
444
 
          the environment (e.g., a globally installed ``hg`` or ``bzr``).  It
445
 
          also conflicted a lot with Setuptools.
446
 
        
447
 
        * `virtual-python
448
 
          <http://peak.telecommunity.com/DevCenter/EasyInstall#creating-a-virtual-python>`_
449
 
          is also a predecessor to this library.  It uses only symlinks, so it
450
 
          couldn't work on Windows.  It also symlinks over the *entire*
451
 
          standard library and global ``site-packages``.  As a result, it
452
 
          won't see new additions to the global ``site-packages``.
453
 
        
454
 
          This script only symlinks a small portion of the standard library
455
 
          into the environment, and so on Windows it is feasible to simply
456
 
          copy these files over.  Also, it creates a new/empty
457
 
          ``site-packages`` and also adds the global ``site-packages`` to the
458
 
          path, so updates are tracked separately.  This script also installs
459
 
          Setuptools automatically, saving a step and avoiding the need for
460
 
          network access.
461
 
        
462
 
        * `zc.buildout <http://pypi.python.org/pypi/zc.buildout>`_ doesn't
463
 
          create an isolated Python environment in the same style, but
464
 
          achieves similar results through a declarative config file that sets
465
 
          up scripts with very particular packages.  As a declarative system,
466
 
          it is somewhat easier to repeat and manage, but more difficult to
467
 
          experiment with.  ``zc.buildout`` includes the ability to setup
468
 
          non-Python systems (e.g., a database server or an Apache instance).
469
 
        
470
 
        I *strongly* recommend anyone doing application development or
471
 
        deployment use one of these tools.
472
 
        
473
 
        Contributing
474
 
        ------------
475
 
        
476
 
        Refer to the `contributing to pip`_ documentation - it applies equally to
477
 
        virtualenv.
478
 
        
479
 
        Virtualenv's release schedule is tied to pip's -- each time there's a new pip
480
 
        release, there will be a new virtualenv release that bundles the new version of
481
 
        pip.
482
 
        
483
 
        .. _contributing to pip: http://www.pip-installer.org/en/latest/contributing.html
484
 
        
485
 
        Running the tests
486
 
        ~~~~~~~~~~~~~~~~~
487
 
        
488
 
        Virtualenv's test suite is small and not yet at all comprehensive, but we aim
489
 
        to grow it.
490
 
        
491
 
        The easy way to run tests (handles test dependencies automatically)::
492
 
        
493
 
            $ python setup.py test
494
 
        
495
 
        If you want to run only a selection of the tests, you'll need to run them
496
 
        directly with nose instead. Create a virtualenv, and install required
497
 
        packages::
498
 
        
499
 
            $ pip install nose mock
500
 
        
501
 
        Run nosetests::
502
 
        
503
 
            $ nosetests
504
 
        
505
 
        Or select just a single test file to run::
506
 
        
507
 
            $ nosetests tests.test_virtualenv
508
 
        
509
 
        
510
 
        Other Documentation and Links
511
 
        -----------------------------
512
 
        
513
 
        * James Gardner has written a tutorial on using `virtualenv with
514
 
          Pylons
515
 
          <http://wiki.pylonshq.com/display/pylonscookbook/Using+a+Virtualenv+Sandbox>`_.
516
 
        
517
 
        * `Blog announcement
518
 
          <http://blog.ianbicking.org/2007/10/10/workingenv-is-dead-long-live-virtualenv/>`_.
519
 
        
520
 
        * Doug Hellmann wrote a description of his `command-line work flow
521
 
          using virtualenv (virtualenvwrapper)
522
 
          <http://www.doughellmann.com/articles/CompletelyDifferent-2008-05-virtualenvwrapper/index.html>`_
523
 
          including some handy scripts to make working with multiple
524
 
          environments easier.  He also wrote `an example of using virtualenv
525
 
          to try IPython
526
 
          <http://www.doughellmann.com/articles/CompletelyDifferent-2008-02-ipython-and-virtualenv/index.html>`_.
527
 
        
528
 
        * Chris Perkins created a `showmedo video including virtualenv
529
 
          <http://showmedo.com/videos/video?name=2910000&fromSeriesID=291>`_.
530
 
        
531
 
        * `Using virtualenv with mod_wsgi
532
 
          <http://code.google.com/p/modwsgi/wiki/VirtualEnvironments>`_.
533
 
        
534
 
        * `virtualenv commands
535
 
          <http://thisismedium.com/tech/extending-virtualenv/>`_ for some more
536
 
          workflow-related tools around virtualenv.
537
 
        
538
 
        Status and License
539
 
        ------------------
540
 
        
541
 
        ``virtualenv`` is a successor to `workingenv
542
 
        <http://cheeseshop.python.org/pypi/workingenv.py>`_, and an extension
543
 
        of `virtual-python
544
 
        <http://peak.telecommunity.com/DevCenter/EasyInstall#creating-a-virtual-python>`_.
545
 
        
546
 
        It was written by Ian Bicking, sponsored by the `Open Planning
547
 
        Project <http://openplans.org>`_ and is now maintained by a
548
 
        `group of developers <https://github.com/pypa/virtualenv/raw/master/AUTHORS.txt>`_.
549
 
        It is licensed under an
550
 
        `MIT-style permissive license <https://github.com/pypa/virtualenv/raw/master/LICENSE.txt>`_.
551
 
        
552
 
        Changes & News
553
 
        --------------
554
 
        
555
 
        1.7.1.2 (2012-02-17)
556
 
        ~~~~~~~~~~~~~~~~~~~~
557
 
        
558
 
        * Fixed minor issue in `--relocatable`. Thanks, Cap Petschulat.
559
 
        
560
 
        1.7.1.1 (2012-02-16)
561
 
        ~~~~~~~~~~~~~~~~~~~~
562
 
        
563
 
        * Bumped the version string in ``virtualenv.py`` up, too.
564
 
        
565
 
        * Fixed rST rendering bug of long description.
566
 
        
567
 
        1.7.1 (2012-02-16)
568
 
        ~~~~~~~~~~~~~~~~~~
569
 
        
570
 
        * Update embedded pip to version 1.1.
571
 
        
572
 
        * Fix `--relocatable` under Python 3. Thanks Doug Hellmann.
573
 
        
574
 
        * Added environ PATH modification to activate_this.py. Thanks Doug
575
 
          Napoleone. Fixes #14.
576
 
        
577
 
        * Support creating virtualenvs directly from a Python build directory on
578
 
          Windows. Thanks CBWhiz. Fixes #139.
579
 
        
580
 
        * Use non-recursive symlinks to fix things up for posix_local install
581
 
          scheme. Thanks michr.
582
 
        
583
 
        * Made activate script available for use with msys and cygwin on Windows.
584
 
          Thanks Greg Haskins, Cliff Xuan, Jonathan Griffin and Doug Napoleone.
585
 
          Fixes #176.
586
 
        
587
 
        * Fixed creation of virtualenvs on Windows when Python is not installed for
588
 
          all users. Thanks Anatoly Techtonik for report and patch and Doug
589
 
          Napoleone for testing and confirmation. Fixes #87.
590
 
        
591
 
        * Fixed creation of virtualenvs using -p in installs where some modules
592
 
          that ought to be in the standard library (e.g. `readline`) are actually
593
 
          installed in `site-packages` next to `virtualenv.py`. Thanks Greg Haskins
594
 
          for report and fix. Fixes #167.
595
 
        
596
 
        * Added activation script for Powershell (signed by Jannis Leidel). Many
597
 
          thanks to Jason R. Coombs.
598
 
        
599
 
        1.7 (2011-11-30)
600
 
        ~~~~~~~~~~~~~~~~
601
 
        
602
 
        * Gave user-provided ``--extra-search-dir`` priority over default dirs for
603
 
          finding setuptools/distribute (it already had priority for finding pip).
604
 
          Thanks Ethan Jucovy.
605
 
        
606
 
        * Updated embedded Distribute release to 0.6.24. Thanks Alex Gronholm.
607
 
        
608
 
        * Made ``--no-site-packages`` behavior the default behavior.  The
609
 
          ``--no-site-packages`` flag is still permitted, but displays a warning when
610
 
          used. Thanks Chris McDonough.
611
 
        
612
 
        * New flag: ``--system-site-packages``; this flag should be passed to get the
613
 
          previous default global-site-package-including behavior back.
614
 
        
615
 
        * Added ability to set command options as environment variables and options
616
 
          in a ``virtualenv.ini`` file.
617
 
        
618
 
        * Fixed various encoding related issues with paths. Thanks Gunnlaugur Thor Briem.
619
 
        
620
 
        * Made ``virtualenv.py`` script executable.
621
 
        
622
 
        1.6.4 (2011-07-21)
623
 
        ~~~~~~~~~~~~~~~~~~
624
 
        
625
 
        * Restored ability to run on Python 2.4, too.
626
 
        
627
 
        1.6.3 (2011-07-16)
628
 
        ~~~~~~~~~~~~~~~~~~
629
 
        
630
 
        * Restored ability to run on Python < 2.7.
631
 
        
632
 
        1.6.2 (2011-07-16)
633
 
        ~~~~~~~~~~~~~~~~~~
634
 
        
635
 
        * Updated embedded distribute release to 0.6.19.
636
 
        
637
 
        * Updated embedded pip release to 1.0.2.
638
 
        
639
 
        * Fixed #141 - Be smarter about finding pkg_resources when using the
640
 
          non-default Python intepreter (by using the ``-p`` option).
641
 
        
642
 
        * Fixed #112 - Fixed path in docs.
643
 
        
644
 
        * Fixed #109 - Corrected doctests of a Logger method.
645
 
        
646
 
        * Fixed #118 - Fixed creating virtualenvs on platforms that use the
647
 
          "posix_local" install scheme, such as Ubuntu with Python 2.7.
648
 
        
649
 
        * Add missing library to Python 3 virtualenvs (``_dummy_thread``).
650
 
        
651
 
        
652
 
        1.6.1 (2011-04-30)
653
 
        ~~~~~~~~~~~~~~~~~~
654
 
        
655
 
        * Start to use git-flow.
656
 
        
657
 
        * Added support for PyPy 1.5
658
 
        
659
 
        * Fixed #121 -- added sanity-checking of the -p argument. Thanks Paul Nasrat.
660
 
        
661
 
        * Added progress meter for pip installation as well as setuptools. Thanks Ethan
662
 
          Jucovy.
663
 
        
664
 
        * Added --never-download and --search-dir options. Thanks Ethan Jucovy.
665
 
        
666
 
        1.6
667
 
        ~~~
668
 
        
669
 
        * Added Python 3 support! Huge thanks to Vinay Sajip and Vitaly Babiy.
670
 
        
671
 
        * Fixed creation of virtualenvs on Mac OS X when standard library modules
672
 
          (readline) are installed outside the standard library.
673
 
        
674
 
        * Updated bundled pip to 1.0.
675
 
        
676
 
        1.5.2
677
 
        ~~~~~
678
 
        
679
 
        * Moved main repository to Github: https://github.com/pypa/virtualenv
680
 
        
681
 
        * Transferred primary maintenance from Ian to Jannis Leidel, Carl Meyer and Brian Rosner
682
 
        
683
 
        * Fixed a few more pypy related bugs.
684
 
        
685
 
        * Updated bundled pip to 0.8.2.
686
 
        
687
 
        * Handed project over to new team of maintainers.
688
 
        
689
 
        * Moved virtualenv to Github at https://github.com/pypa/virtualenv
690
 
        
691
 
        1.5.1
692
 
        ~~~~~
693
 
        
694
 
        * Added ``_weakrefset`` requirement for Python 2.7.1.
695
 
        
696
 
        * Fixed Windows regression in 1.5
697
 
        
698
 
        1.5
699
 
        ~~~
700
 
        
701
 
        * Include pip 0.8.1.
702
 
        
703
 
        * Add support for PyPy.
704
 
        
705
 
        * Uses a proper temporary dir when installing environment requirements.
706
 
        
707
 
        * Add ``--prompt`` option to be able to override the default prompt prefix.
708
 
        
709
 
        * Fix an issue with ``--relocatable`` on Windows.
710
 
        
711
 
        * Fix issue with installing the wrong version of distribute.
712
 
        
713
 
        * Add fish and csh activate scripts.
714
 
        
715
 
        1.4.9
716
 
        ~~~~~
717
 
        
718
 
        * Include pip 0.7.2
719
 
        
720
 
        1.4.8
721
 
        ~~~~~
722
 
        
723
 
        * Fix for Mac OS X Framework builds that use
724
 
          ``--universal-archs=intel``
725
 
        
726
 
        * Fix ``activate_this.py`` on Windows.
727
 
        
728
 
        * Allow ``$PYTHONHOME`` to be set, so long as you use ``source
729
 
          bin/activate`` it will get unset; if you leave it set and do not
730
 
          activate the environment it will still break the environment.
731
 
        
732
 
        * Include pip 0.7.1
733
 
        
734
 
        1.4.7
735
 
        ~~~~~
736
 
        
737
 
        * Include pip 0.7
738
 
        
739
 
        1.4.6
740
 
        ~~~~~
741
 
        
742
 
        * Allow ``activate.sh`` to skip updating the prompt (by setting
743
 
          ``$VIRTUAL_ENV_DISABLE_PROMPT``).
744
 
        
745
 
        1.4.5
746
 
        ~~~~~
747
 
        
748
 
        * Include pip 0.6.3
749
 
        
750
 
        * Fix ``activate.bat`` and ``deactivate.bat`` under Windows when
751
 
          ``PATH`` contained a parenthesis
752
 
        
753
 
        1.4.4
754
 
        ~~~~~
755
 
        
756
 
        * Include pip 0.6.2 and Distribute 0.6.10
757
 
        
758
 
        * Create the ``virtualenv`` script even when Setuptools isn't
759
 
          installed
760
 
        
761
 
        * Fix problem with ``virtualenv --relocate`` when ``bin/`` has
762
 
          subdirectories (e.g., ``bin/.svn/``); from Alan Franzoni.
763
 
        
764
 
        * If you set ``$VIRTUALENV_USE_DISTRIBUTE`` then virtualenv will use
765
 
          Distribute by default (so you don't have to remember to use
766
 
          ``--distribute``).
767
 
        
768
 
        1.4.3
769
 
        ~~~~~
770
 
        
771
 
        * Include pip 0.6.1
772
 
        
773
 
        1.4.2
774
 
        ~~~~~
775
 
        
776
 
        * Fix pip installation on Windows
777
 
        
778
 
        * Fix use of stand-alone ``virtualenv.py`` (and boot scripts)
779
 
        
780
 
        * Exclude ~/.local (user site-packages) from environments when using
781
 
          ``--no-site-packages``
782
 
        
783
 
        1.4.1
784
 
        ~~~~~
785
 
        
786
 
        * Include pip 0.6
787
 
        
788
 
        1.4
789
 
        ~~~
790
 
        
791
 
        * Updated setuptools to 0.6c11
792
 
        
793
 
        * Added the --distribute option
794
 
        
795
 
        * Fixed packaging problem of support-files
796
 
        
797
 
        1.3.4
798
 
        ~~~~~
799
 
        
800
 
        * Virtualenv now copies the actual embedded Python binary on
801
 
          Mac OS X to fix a hang on Snow Leopard (10.6).
802
 
        
803
 
        * Fail more gracefully on Windows when ``win32api`` is not installed.
804
 
        
805
 
        * Fix site-packages taking precedent over Jython's ``__classpath__``
806
 
          and also specially handle the new ``__pyclasspath__`` entry in
807
 
          ``sys.path``.
808
 
        
809
 
        * Now copies Jython's ``registry`` file to the virtualenv if it exists.
810
 
        
811
 
        * Better find libraries when compiling extensions on Windows.
812
 
        
813
 
        * Create ``Scripts\pythonw.exe`` on Windows.
814
 
        
815
 
        * Added support for the Debian/Ubuntu
816
 
          ``/usr/lib/pythonX.Y/dist-packages`` directory.
817
 
        
818
 
        * Set ``distutils.sysconfig.get_config_vars()['LIBDIR']`` (based on
819
 
          ``sys.real_prefix``) which is reported to help building on Windows.
820
 
        
821
 
        * Make ``deactivate`` work on ksh
822
 
        
823
 
        * Fixes for ``--python``: make it work with ``--relocatable`` and the
824
 
          symlink created to the exact Python version.
825
 
        
826
 
        1.3.3
827
 
        ~~~~~
828
 
        
829
 
        * Use Windows newlines in ``activate.bat``, which has been reported to help
830
 
          when using non-ASCII directory names.
831
 
        
832
 
        * Fixed compatibility with Jython 2.5b1.
833
 
        
834
 
        * Added a function ``virtualenv.install_python`` for more fine-grained
835
 
          access to what ``virtualenv.create_environment`` does.
836
 
        
837
 
        * Fix `a problem <https://bugs.launchpad.net/virtualenv/+bug/241581>`_
838
 
          with Windows and paths that contain spaces.
839
 
        
840
 
        * If ``/path/to/env/.pydistutils.cfg`` exists (or
841
 
          ``/path/to/env/pydistutils.cfg`` on Windows systems) then ignore
842
 
          ``~/.pydistutils.cfg`` and use that other file instead.
843
 
        
844
 
        * Fix ` a problem
845
 
          <https://bugs.launchpad.net/virtualenv/+bug/340050>`_ picking up
846
 
          some ``.so`` libraries in ``/usr/local``.
847
 
        
848
 
        1.3.2
849
 
        ~~~~~
850
 
        
851
 
        * Remove the ``[install] prefix = ...`` setting from the virtualenv
852
 
          ``distutils.cfg`` -- this has been causing problems for a lot of
853
 
          people, in rather obscure ways.
854
 
        
855
 
        * If you use a `boot script <./index.html#boot-script>`_ it will attempt to import ``virtualenv``
856
 
          and find a pre-downloaded Setuptools egg using that.
857
 
        
858
 
        * Added platform-specific paths, like ``/usr/lib/pythonX.Y/plat-linux2``
859
 
        
860
 
        1.3.1
861
 
        ~~~~~
862
 
        
863
 
        * Real Python 2.6 compatibility.  Backported the Python 2.6 updates to
864
 
          ``site.py``, including `user directories
865
 
          <http://docs.python.org/dev/whatsnew/2.6.html#pep-370-per-user-site-packages-directory>`_
866
 
          (this means older versions of Python will support user directories,
867
 
          whether intended or not).
868
 
        
869
 
        * Always set ``[install] prefix`` in ``distutils.cfg`` -- previously
870
 
          on some platforms where a system-wide ``distutils.cfg`` was present
871
 
          with a ``prefix`` setting, packages would be installed globally
872
 
          (usually in ``/usr/local/lib/pythonX.Y/site-packages``).
873
 
        
874
 
        * Sometimes Cygwin seems to leave ``.exe`` off ``sys.executable``; a
875
 
          workaround is added.
876
 
        
877
 
        * Fix ``--python`` option.
878
 
        
879
 
        * Fixed handling of Jython environments that use a
880
 
          jython-complete.jar.
881
 
        
882
 
        1.3
883
 
        ~~~
884
 
        
885
 
        * Update to Setuptools 0.6c9
886
 
        * Added an option ``virtualenv --relocatable EXISTING_ENV``, which
887
 
          will make an existing environment "relocatable" -- the paths will
888
 
          not be absolute in scripts, ``.egg-info`` and ``.pth`` files.  This
889
 
          may assist in building environments that can be moved and copied.
890
 
          You have to run this *after* any new packages installed.
891
 
        * Added ``bin/activate_this.py``, a file you can use like
892
 
          ``execfile("path_to/activate_this.py",
893
 
          dict(__file__="path_to/activate_this.py"))`` -- this will activate
894
 
          the environment in place, similar to what `the mod_wsgi example
895
 
          does <http://code.google.com/p/modwsgi/wiki/VirtualEnvironments>`_.
896
 
        * For Mac framework builds of Python, the site-packages directory
897
 
          ``/Library/Python/X.Y/site-packages`` is added to ``sys.path``, from
898
 
          Andrea Rech.
899
 
        * Some platform-specific modules in Macs are added to the path now
900
 
          (``plat-darwin/``, ``plat-mac/``, ``plat-mac/lib-scriptpackages``),
901
 
          from Andrea Rech.
902
 
        * Fixed a small Bashism in the ``bin/activate`` shell script.
903
 
        * Added ``__future__`` to the list of required modules, for Python
904
 
          2.3.  You'll still need to backport your own ``subprocess`` module.
905
 
        * Fixed the ``__classpath__`` entry in Jython's ``sys.path`` taking
906
 
          precedent over virtualenv's libs.
907
 
        
908
 
        1.2
909
 
        ~~~
910
 
        
911
 
        * Added a ``--python`` option to select the Python interpreter.
912
 
        * Add ``warnings`` to the modules copied over, for Python 2.6 support.
913
 
        * Add ``sets`` to the module copied over for Python 2.3 (though Python
914
 
          2.3 still probably doesn't work).
915
 
        
916
 
        1.1.1
917
 
        ~~~~~
918
 
        
919
 
        * Added support for Jython 2.5.
920
 
        
921
 
        1.1
922
 
        ~~~
923
 
        
924
 
        * Added support for Python 2.6.
925
 
        * Fix a problem with missing ``DLLs/zlib.pyd`` on Windows.  Create
926
 
        * ``bin/python`` (or ``bin/python.exe``) even when you run virtualenv
927
 
          with an interpreter named, e.g., ``python2.4``
928
 
        * Fix MacPorts Python
929
 
        * Added --unzip-setuptools option
930
 
        * Update to Setuptools 0.6c8
931
 
        * If the current directory is not writable, run ez_setup.py in ``/tmp``
932
 
        * Copy or symlink over the ``include`` directory so that packages will
933
 
          more consistently compile.
934
 
        
935
 
        1.0
936
 
        ~~~
937
 
        
938
 
        * Fix build on systems that use ``/usr/lib64``, distinct from
939
 
          ``/usr/lib`` (specifically CentOS x64).
940
 
        * Fixed bug in ``--clear``.
941
 
        * Fixed typos in ``deactivate.bat``.
942
 
        * Preserve ``$PYTHONPATH`` when calling subprocesses.
943
 
        
944
 
        0.9.2
945
 
        ~~~~~
946
 
        
947
 
        * Fix include dir copying on Windows (makes compiling possible).
948
 
        * Include the main ``lib-tk`` in the path.
949
 
        * Patch ``distutils.sysconfig``: ``get_python_inc`` and
950
 
          ``get_python_lib`` to point to the global locations.
951
 
        * Install ``distutils.cfg`` before Setuptools, so that system
952
 
          customizations of ``distutils.cfg`` won't effect the installation.
953
 
        * Add ``bin/pythonX.Y`` to the virtualenv (in addition to
954
 
          ``bin/python``).
955
 
        * Fixed an issue with Mac Framework Python builds, and absolute paths
956
 
          (from Ronald Oussoren).
957
 
        
958
 
        0.9.1
959
 
        ~~~~~
960
 
        
961
 
        * Improve ability to create a virtualenv from inside a virtualenv.
962
 
        * Fix a little bug in ``bin/activate``.
963
 
        * Actually get ``distutils.cfg`` to work reliably.
964
 
        
965
 
        0.9
966
 
        ~~~
967
 
        
968
 
        * Added ``lib-dynload`` and ``config`` to things that need to be
969
 
          copied over in an environment.
970
 
        * Copy over or symlink the ``include`` directory, so that you can
971
 
          build packages that need the C headers.
972
 
        * Include a ``distutils`` package, so you can locally update
973
 
          ``distutils.cfg`` (in ``lib/pythonX.Y/distutils/distutils.cfg``).
974
 
        * Better avoid downloading Setuptools, and hitting PyPI on environment
975
 
          creation.
976
 
        * Fix a problem creating a ``lib64/`` directory.
977
 
        * Should work on MacOSX Framework builds (the default Python
978
 
          installations on Mac).  Thanks to Ronald Oussoren.
979
 
        
980
 
        0.8.4
981
 
        ~~~~~
982
 
        
983
 
        * Windows installs would sometimes give errors about ``sys.prefix`` that
984
 
          were inaccurate.
985
 
        * Slightly prettier output.
986
 
        
987
 
        0.8.3
988
 
        ~~~~~
989
 
        
990
 
        * Added support for Windows.
991
 
        
992
 
        0.8.2
993
 
        ~~~~~
994
 
        
995
 
        * Give a better warning if you are on an unsupported platform (Mac
996
 
          Framework Pythons, and Windows).
997
 
        * Give error about running while inside a workingenv.
998
 
        * Give better error message about Python 2.3.
999
 
        
1000
 
        0.8.1
1001
 
        ~~~~~
1002
 
        
1003
 
        Fixed packaging of the library.
1004
 
        
1005
 
        0.8
1006
 
        ~~~
1007
 
        
1008
 
        Initial release.  Everything is changed and new!
1009
 
        
1010
 
Keywords: setuptools deployment installation distutils
1011
 
Platform: UNKNOWN
1012
 
Classifier: Development Status :: 4 - Beta
1013
 
Classifier: Intended Audience :: Developers
1014
 
Classifier: License :: OSI Approved :: MIT License
1015
 
Classifier: Programming Language :: Python :: 2
1016
 
Classifier: Programming Language :: Python :: 2.4
1017
 
Classifier: Programming Language :: Python :: 2.5
1018
 
Classifier: Programming Language :: Python :: 2.6
1019
 
Classifier: Programming Language :: Python :: 2.7
1020
 
Classifier: Programming Language :: Python :: 3
1021
 
Classifier: Programming Language :: Python :: 3.1
1022
 
Classifier: Programming Language :: Python :: 3.2