File: virtualenv.html

package info (click to toggle)
python-paver 1.2.1-1~bpo70%2B1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy-backports
  • size: 1,220 kB
  • sloc: python: 4,678; makefile: 20
file content (200 lines) | stat: -rw-r--r-- 8,989 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    
    <title>Virtualenv Support (paver.virtual) &mdash; Paver 1.2.1 documentation</title>
    
    <link rel="stylesheet" href="_static/default.css" type="text/css" />
    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
    
    <script type="text/javascript">
      var DOCUMENTATION_OPTIONS = {
        URL_ROOT:    './',
        VERSION:     '1.2.1',
        COLLAPSE_INDEX: false,
        FILE_SUFFIX: '.html',
        HAS_SOURCE:  true
      };
    </script>
    <script type="text/javascript" src="_static/jquery.js"></script>
    <script type="text/javascript" src="_static/underscore.js"></script>
    <script type="text/javascript" src="_static/doctools.js"></script>
    <link rel="top" title="Paver 1.2.1 documentation" href="index.html" />
    <link rel="up" title="The Paver Standard Library" href="paverstdlib.html" />
    <link rel="next" title="Using with Subversion (paver.svn)" href="svn.html" />
    <link rel="prev" title="Miscellaneous Tasks (paver.misctasks)" href="misctasks.html" /> 
  </head>
  <body>
    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="genindex.html" title="General Index"
             accesskey="I">index</a></li>
        <li class="right" >
          <a href="py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="svn.html" title="Using with Subversion (paver.svn)"
             accesskey="N">next</a> |</li>
        <li class="right" >
          <a href="misctasks.html" title="Miscellaneous Tasks (paver.misctasks)"
             accesskey="P">previous</a> |</li>
        <li><a href="index.html">Paver 1.2.1 documentation</a> &raquo;</li>
          <li><a href="paverstdlib.html" accesskey="U">The Paver Standard Library</a> &raquo;</li> 
      </ul>
    </div>  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body">
            
  <div class="section" id="virtualenv-support-paver-virtual">
<span id="virtualenv"></span><h1>Virtualenv Support (paver.virtual)<a class="headerlink" href="#virtualenv-support-paver-virtual" title="Permalink to this headline">¶</a></h1>
<p>Paver makes it easy to set up virtualenv environments for development and deployment.
Virtualenv gives you a place to install Python packages and keep them separate from
your main system&#8217;s Python installation.</p>
</div>
<div class="section" id="using-virtualenv-with-tasks">
<h1>Using virtualenv with tasks<a class="headerlink" href="#using-virtualenv-with-tasks" title="Permalink to this headline">¶</a></h1>
<p>You may specify which virtual environment should particular task use. Do this
with <tt class="docutils literal"><span class="pre">&#64;virtualenv</span></tt> decorator:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="kn">from</span> <span class="nn">paver.easy</span> <span class="kn">import</span> <span class="n">task</span>
<span class="kn">from</span> <span class="nn">paver.virtual</span> <span class="kn">import</span> <span class="n">virtualenv</span>

<span class="nd">@task</span>
<span class="nd">@virtualenv</span><span class="p">(</span><span class="nb">dir</span><span class="o">=</span><span class="s">&quot;virtualenv&quot;</span><span class="p">)</span>
<span class="k">def</span> <span class="nf">t1</span><span class="p">():</span>
    <span class="kn">import</span> <span class="nn">some_module_existing_only_in_virtualenv</span>
</pre></div>
</div>
</div>
<div class="section" id="module-paver.virtual">
<span id="paver-virtual-tasks"></span><h1>paver.virtual Tasks<a class="headerlink" href="#module-paver.virtual" title="Permalink to this headline">¶</a></h1>
<p>Tasks for managing virtualenv environments.</p>
<dl class="function">
<dt id="paver.virtual.bootstrap">
<tt class="descclassname">paver.virtual.</tt><tt class="descname">bootstrap</tt><big>(</big><big>)</big><a class="headerlink" href="#paver.virtual.bootstrap" title="Permalink to this definition">¶</a></dt>
<dd><p>Creates a virtualenv bootstrap script.
The script will create a bootstrap script that populates a
virtualenv in the current directory. The environment will
have paver, the packages of your choosing and will run
the paver command of your choice.</p>
<p>This task looks in the virtualenv options for:</p>
<dl class="docutils">
<dt>script_name</dt>
<dd>name of the generated script</dd>
<dt>packages_to_install</dt>
<dd>packages to install with pip/easy_install. The version of paver that
you are using is included automatically. This should be a list of
strings.</dd>
<dt>paver_command_line</dt>
<dd>run this paver command line after installation (just the command
line arguments, not the paver command itself).</dd>
<dt>dest_dir</dt>
<dd>the destination directory for the virtual environment (defaults to
&#8216;.&#8217;)</dd>
<dt>no_site_packages</dt>
<dd>don&#8217;t give access to the global site-packages dir to the virtual
environment (default; deprecated)</dd>
<dt>system_site_packages</dt>
<dd>give access to the global site-packages dir to the virtual
environment</dd>
<dt>unzip_setuptools</dt>
<dd>unzip Setuptools when installing it (defaults to False)</dd>
<dt>distribute</dt>
<dd>use Distribute instead of Setuptools. Set environment variable
VIRTUALENV_DISTRIBUTE to make it the default.</dd>
<dt>index_url</dt>
<dd>base URL of Python Package Index</dd>
<dt>no_index</dt>
<dd>ignore package index (only looking at find_links URL(s) instead)</dd>
<dt>find_links</dt>
<dd>additional URL(s) to search for packages. This should be a list of
strings.</dd>
<dt>prefer_easy_install</dt>
<dd>prefer easy_install to pip for package installation if both are
installed (defaults to False)</dd>
</dl>
</dd></dl>

<dl class="function">
<dt id="paver.virtual.virtualenv">
<tt class="descclassname">paver.virtual.</tt><tt class="descname">virtualenv</tt><big>(</big><em>dir</em><big>)</big><a class="headerlink" href="#paver.virtual.virtualenv" title="Permalink to this definition">¶</a></dt>
<dd><p>Run decorated task in specified virtual environment.</p>
</dd></dl>

</div>


          </div>
        </div>
      </div>
      <div class="sphinxsidebar">
        <div class="sphinxsidebarwrapper">
  <h3><a href="index.html">Table Of Contents</a></h3>
  <ul>
<li><a class="reference internal" href="#">Virtualenv Support (paver.virtual)</a></li>
<li><a class="reference internal" href="#using-virtualenv-with-tasks">Using virtualenv with tasks</a></li>
<li><a class="reference internal" href="#module-paver.virtual">paver.virtual Tasks</a></li>
</ul>

  <h4>Previous topic</h4>
  <p class="topless"><a href="misctasks.html"
                        title="previous chapter">Miscellaneous Tasks (paver.misctasks)</a></p>
  <h4>Next topic</h4>
  <p class="topless"><a href="svn.html"
                        title="next chapter">Using with Subversion (paver.svn)</a></p>
  <h3>This Page</h3>
  <ul class="this-page-menu">
    <li><a href="_sources/virtualenv.txt"
           rel="nofollow">Show Source</a></li>
  </ul>
<div id="searchbox" style="display: none">
  <h3>Quick search</h3>
    <form class="search" action="search.html" method="get">
      <input type="text" name="q" />
      <input type="submit" value="Go" />
      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>
    <p class="searchtip" style="font-size: 90%">
    Enter search terms or a module, class or function name.
    </p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="genindex.html" title="General Index"
             >index</a></li>
        <li class="right" >
          <a href="py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="svn.html" title="Using with Subversion (paver.svn)"
             >next</a> |</li>
        <li class="right" >
          <a href="misctasks.html" title="Miscellaneous Tasks (paver.misctasks)"
             >previous</a> |</li>
        <li><a href="index.html">Paver 1.2.1 documentation</a> &raquo;</li>
          <li><a href="paverstdlib.html" >The Paver Standard Library</a> &raquo;</li> 
      </ul>
    </div>
    <div class="footer">
        &copy; Copyright 2008, SitePen, Inc..
      Last updated on Jun 02, 2013.
      Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2b1.
    </div>
  </body>
</html>