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
|
<!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>Paver’s Features — 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="next" title="Getting Started with Paver" href="getting_started.html" />
<link rel="prev" title="Foreword: Why Paver?" href="foreword.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="getting_started.html" title="Getting Started with Paver"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="foreword.html" title="Foreword: Why Paver?"
accesskey="P">previous</a> |</li>
<li><a href="index.html">Paver 1.2.1 documentation</a> »</li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body">
<div class="section" id="paver-s-features">
<h1>Paver’s Features<a class="headerlink" href="#paver-s-features" title="Permalink to this headline">¶</a></h1>
<div class="section" id="files-are-just-python">
<span id="justpython"></span><h2>Files Are Just Python<a class="headerlink" href="#files-are-just-python" title="Permalink to this headline">¶</a></h2>
<p>Python has a very concise, readable syntax. There’s no need to create some
mini-language for describing your builds. Quite often it seems like these
mini-languages are missing features that you need. By using Python as its
syntax, you can always be sure that you can express whatever it is you
need to do easily. A for loop is just a for loop:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="k">for</span> <span class="n">fn</span> <span class="ow">in</span> <span class="p">[</span><span class="s">"f1.txt"</span><span class="p">,</span> <span class="s">"f2.txt"</span><span class="p">,</span> <span class="s">"f3.txt"</span><span class="p">]:</span>
<span class="n">p</span> <span class="o">=</span> <span class="n">path</span><span class="p">(</span><span class="n">fn</span><span class="p">)</span>
<span class="n">p</span><span class="o">.</span><span class="n">remove</span><span class="p">()</span>
</pre></div>
</div>
</div>
<div class="section" id="one-file-with-one-syntax">
<span id="onefile"></span><h2>One File with One Syntax<a class="headerlink" href="#one-file-with-one-syntax" title="Permalink to this headline">¶</a></h2>
<p>When putting together a Python project today, you get into a collection of
tools to get the job done. distutils and setuptools are the standards for
getting packages put together. zc.buildout and virtualenv are used for
installation into isolated deployment environments. Sphinx provides
a great way to document Python projects.</p>
<p>To put together a total system, you need each of these parts. But they
each have their own way of working. The goal with the
<a class="reference internal" href="paverstdlib.html#stdlib"><em>Paver Standard Library</em></a>
is to make the common tools have a more integrated feel, so you don’t
have to guess as much about how to get something done.</p>
<p>As of today, Paver is tightly integrated with distutils and setuptools,
and can easily work as a drop-in, more easily scriptable replacement for
setup.py.</p>
</div>
<div class="section" id="easy-file-operations">
<span id="pathmodule"></span><h2>Easy file operations<a class="headerlink" href="#easy-file-operations" title="Permalink to this headline">¶</a></h2>
<p>Paver includes a customized version of Jason Orendorff’s awesome path.py
module. Operations on files and directories could hardly be easier,
and the methods have been modified to support “dry run” behavior.</p>
</div>
<div class="section" id="small-bits-of-behavior-take-small-amounts-of-work">
<span id="fivelines"></span><h2>Small bits of behavior take small amounts of work<a class="headerlink" href="#small-bits-of-behavior-take-small-amounts-of-work" title="Permalink to this headline">¶</a></h2>
<p>Imagine you need to do something that will take you 5 lines of Python code.
With some of the tools that Paver augments, it’ll take you a lot more
effort than those 5 lines of code. You have to read about the API for
making new commands or recipes or otherwise extending the package.
The goal when using Paver is to have a five line change take about five
lines to make.</p>
<p>For example, let’s say you need to perform some extra work when and ‘sdist’
is run. Good luck figuring out the best way to do that with distutils. With
Paver, it’s just:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="nd">@task</span>
<span class="k">def</span> <span class="nf">sdist</span><span class="p">():</span>
<span class="c"># perform fancy file manipulations</span>
<span class="n">blah</span><span class="o">.</span><span class="n">blah</span><span class="o">.</span><span class="n">blah</span><span class="p">()</span>
<span class="c"># *now* run the sdist</span>
<span class="n">call_task</span><span class="p">(</span><span class="s">"setuptools.command.sdist"</span><span class="p">)</span>
</pre></div>
</div>
</div>
<div class="section" id="can-take-advantage-of-libraries-but-doesn-t-require-them">
<span id="nodeps"></span><h2>Can Take Advantage of Libraries But Doesn’t Require Them<a class="headerlink" href="#can-take-advantage-of-libraries-but-doesn-t-require-them" title="Permalink to this headline">¶</a></h2>
<p>The Paver Standard Library includes support for a lot of the common tools,
but you don’t necessarily need all of those tools, and certainly not on
every project. Paver is designed to have no other requirements but to
automatically take advantage of other tools when they’re available.</p>
</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="#">Paver’s Features</a><ul>
<li><a class="reference internal" href="#files-are-just-python">Files Are Just Python</a></li>
<li><a class="reference internal" href="#one-file-with-one-syntax">One File with One Syntax</a></li>
<li><a class="reference internal" href="#easy-file-operations">Easy file operations</a></li>
<li><a class="reference internal" href="#small-bits-of-behavior-take-small-amounts-of-work">Small bits of behavior take small amounts of work</a></li>
<li><a class="reference internal" href="#can-take-advantage-of-libraries-but-doesn-t-require-them">Can Take Advantage of Libraries But Doesn’t Require Them</a></li>
</ul>
</li>
</ul>
<h4>Previous topic</h4>
<p class="topless"><a href="foreword.html"
title="previous chapter">Foreword: Why Paver?</a></p>
<h4>Next topic</h4>
<p class="topless"><a href="getting_started.html"
title="next chapter">Getting Started with Paver</a></p>
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="_sources/features.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="getting_started.html" title="Getting Started with Paver"
>next</a> |</li>
<li class="right" >
<a href="foreword.html" title="Foreword: Why Paver?"
>previous</a> |</li>
<li><a href="index.html">Paver 1.2.1 documentation</a> »</li>
</ul>
</div>
<div class="footer">
© 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>
|