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 201 202 203 204 205 206 207 208 209 210 211 212
|
<!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>For Developers — virtualenvwrapper v3.3 documentation</title>
<link rel="stylesheet" href="_static/nature.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '',
VERSION: '3.3',
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="virtualenvwrapper v3.3 documentation" href="index.html" />
<link rel="next" title="Existing Extensions" href="extensions.html" />
<link rel="prev" title="Tips and Tricks" href="tips.html" />
</head>
<body>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="extensions.html" title="Existing Extensions"
accesskey="N">next</a></li>
<li class="right" >
<a href="tips.html" title="Tips and Tricks"
accesskey="P">previous</a> |</li>
<li><a href="index.html">virtualenvwrapper v3.3 documentation</a> »</li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body">
<div class="section" id="for-developers">
<h1>For Developers<a class="headerlink" href="#for-developers" title="Permalink to this headline">¶</a></h1>
<p>If you would like to contribute to virtualenvwrapper directly, these
instructions should help you get started. Patches, bug reports, and
feature requests are all welcome through the <a class="reference external" href="http://bitbucket.org/dhellmann/virtualenvwrapper/">BitBucket site</a>. Contributions
in the form of patches or pull requests are easier to integrate and
will receive priority attention.</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">Before contributing new features to virtualenvwrapper core, please
consider whether they should be implemented as an extension instead.</p>
</div>
<div class="section" id="building-documentation">
<h2>Building Documentation<a class="headerlink" href="#building-documentation" title="Permalink to this headline">¶</a></h2>
<p>The documentation for virtualenvwrapper is written in reStructuredText
and converted to HTML using Sphinx. The build itself is driven by
make. You will need the following packages in order to build the
docs:</p>
<ul class="simple">
<li>Sphinx</li>
<li>docutils</li>
</ul>
<p>Once all of the tools are installed into a virtualenv using
pip, run <tt class="docutils literal"><span class="pre">make</span> <span class="pre">html</span></tt> to generate the HTML version of the
documentation:</p>
<div class="highlight-python"><pre>$ make html
rm -rf virtualenvwrapper/docs
(cd docs && make html SPHINXOPTS="-c sphinx/pkg")
sphinx-build -b html -d build/doctrees -c sphinx/pkg source build/html
Running Sphinx v0.6.4
loading pickled environment... done
building [html]: targets for 2 source files that are out of date
updating environment: 0 added, 2 changed, 0 removed
reading sources... [ 50%] command_ref
reading sources... [100%] developers
looking for now-outdated files... none found
pickling environment... done
checking consistency... done
preparing documents... done
writing output... [ 33%] command_ref
writing output... [ 66%] developers
writing output... [100%] index
writing additional files... search
copying static files... WARNING: static directory '/Users/dhellmann/Devel/virtualenvwrapper/plugins/docs/sphinx/pkg/static' does not exist
done
dumping search index... done
dumping object inventory... done
build succeeded, 1 warning.
Build finished. The HTML pages are in build/html.
cp -r docs/build/html virtualenvwrapper/docs</pre>
</div>
<p>The output version of the documentation ends up in
<tt class="docutils literal"><span class="pre">./virtualenvwrapper/docs</span></tt> inside your sandbox.</p>
</div>
<div class="section" id="running-tests">
<h2>Running Tests<a class="headerlink" href="#running-tests" title="Permalink to this headline">¶</a></h2>
<p>The test suite for virtualenvwrapper uses <a class="reference external" href="http://shunit2.googlecode.com/">shunit2</a> and <a class="reference external" href="http://codespeak.net/tox">tox</a>. The
shunit2 source is included in the <tt class="docutils literal"><span class="pre">tests</span></tt> directory, but tox must be
installed separately (<tt class="docutils literal"><span class="pre">pip</span> <span class="pre">install</span> <span class="pre">tox</span></tt>).</p>
<p>To run the tests under bash, zsh, and ksh for Python 2.4 through 2.7,
run <tt class="docutils literal"><span class="pre">tox</span></tt> from the top level directory of the hg repository.</p>
<p>To run individual test scripts, use a command like:</p>
<div class="highlight-python"><pre>$ tox tests/test_cd.sh</pre>
</div>
<p>To run tests under a single version of Python, specify the appropriate
environment when running tox:</p>
<div class="highlight-python"><pre>$ tox -e py27</pre>
</div>
<p>Combine the two modes to run specific tests with a single version of
Python:</p>
<div class="highlight-python"><pre>$ tox -e py27 tests/test_cd.sh</pre>
</div>
<p>Add new tests by modifying an existing file or creating new script in
the <tt class="docutils literal"><span class="pre">tests</span></tt> directory.</p>
</div>
<div class="section" id="creating-a-new-template">
<span id="developer-templates"></span><h2>Creating a New Template<a class="headerlink" href="#creating-a-new-template" title="Permalink to this headline">¶</a></h2>
<p>virtualenvwrapper.project templates work like <a class="reference external" href="http://www.doughellmann.com/docs/virtualenvwrapper/plugins.html">virtualenvwrapper
plugins</a>.
The <em>entry point</em> group name is
<tt class="docutils literal"><span class="pre">virtualenvwrapper.project.template</span></tt>. Configure your entry point to
refer to a function that will <strong>run</strong> (source hooks are not supported
for templates).</p>
<p>The argument to the template function is the name of the project being
created. The current working directory is the directory created to
hold the project files (<tt class="docutils literal"><span class="pre">$PROJECT_HOME/$envname</span></tt>).</p>
<div class="section" id="help-text">
<h3>Help Text<a class="headerlink" href="#help-text" title="Permalink to this headline">¶</a></h3>
<p>One difference between project templates and other virtualenvwrapper
extensions is that only the templates specified by the user are run.
The <tt class="docutils literal"><span class="pre">mkproject</span></tt> command has a help option to give the user a list of
the available templates. The names are taken from the registered
entry point names, and the descriptions are taken from the docstrings
for the template functions.</p>
</div>
</div>
</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="#">For Developers</a><ul>
<li><a class="reference internal" href="#building-documentation">Building Documentation</a></li>
<li><a class="reference internal" href="#running-tests">Running Tests</a></li>
<li><a class="reference internal" href="#creating-a-new-template">Creating a New Template</a><ul>
<li><a class="reference internal" href="#help-text">Help Text</a></li>
</ul>
</li>
</ul>
</li>
</ul>
<h4>Previous topic</h4>
<p class="topless"><a href="tips.html"
title="previous chapter">Tips and Tricks</a></p>
<h4>Next topic</h4>
<p class="topless"><a href="extensions.html"
title="next chapter">Existing Extensions</a></p>
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="_sources/developers.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" size="18" />
<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="extensions.html" title="Existing Extensions"
>next</a></li>
<li class="right" >
<a href="tips.html" title="Tips and Tricks"
>previous</a> |</li>
<li><a href="index.html">virtualenvwrapper v3.3 documentation</a> »</li>
</ul>
</div>
<div class="footer">
© Copyright 2009-2011, Doug Hellmann.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.5.
</div>
</body>
</html>
|