Source

dictionary_switches / html / DeveloperGuide.html

<!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>Developer Guide &mdash; Python 3 Patterns & Idioms</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.0',
          COLLAPSE_MODINDEX: false,
          FILE_SUFFIX: '.html'
      };
    </script>
    <script type="text/javascript" src="_static/jquery.js"></script>
    <script type="text/javascript" src="_static/doctools.js"></script>
    <link rel="shortcut icon" href="_static/favicon.ico"/>
    <link rel="index" title="Index" href="genindex.html" />
    <link rel="search" title="Search" href="search.html" />
    <link rel="top" title="Python 3 Patterns & Idioms" href="index.html" />
    <link rel="next" title="Part I: Foundations" href="Part1.html" />
    <link rel="prev" title="Book Development Rules" href="Rules.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="Part1.html" title="Part I: Foundations"
             accesskey="N">next</a> |</li>
        <li class="right" >
          <a href="Rules.html" title="Book Development Rules"
             accesskey="P">previous</a> |</li>
        <li><a href="index.html">Python 3 Patterns & Idioms</a> &raquo;</li>
      </ul>
    </div>
    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body">
            
  
  <div class="section" id="developer-guide">
<h1>Developer Guide<a class="headerlink" href="#developer-guide" title="Permalink to this headline"></a></h1>
<p>Details for people participating in the book development process.</p>
<div class="section" id="getting-started-the-easiest-approach">
<h2>Getting Started: The Easiest Approach<a class="headerlink" href="#getting-started-the-easiest-approach" title="Permalink to this headline"></a></h2>
<p>If all of the details are a little overwhelming at first, there&#8217;s an easy way
for you to make contributions without learning about distributed version control
and Sphinx:</p>
<ol class="arabic simple">
<li>Create an account at <a class="reference external" href="http://www.BitBucket.org">http://www.BitBucket.org</a>.</li>
<li>In your account, you get a wiki. In your wiki, create a page for your
contribution. Just add your code and descriptions using plain text.</li>
<li>Point us to your wiki via the <a class="reference external" href="http://groups.google.com/group/python3patterns/">newsgroup</a>.</li>
<li>We&#8217;ll take your contribution and do the necessary formatting.</li>
</ol>
<p>If you want to take another step, you can learn how to format your wiki page
using Sphinx by looking at the source for pages in the book. You can try it
right now &#8211; on the left side of this page (in the HTML book) you&#8217;ll see a
header that says <strong>This Page</strong> and underneath it <strong>Show Source</strong>. Click on
<strong>Show Source</strong> and you&#8217;ll see the Sphinx source for this page. Just look at
the page sources and imitate that.</p>
<p>When you&#8217;re ready, you can learn more about Sphinx and Mercurial and begin
making contributions that way.</p>
<p>The following sections are for those who are ready to build the book on their
own machines.</p>
</div>
<div class="section" id="for-windows-users">
<h2>For Windows Users<a class="headerlink" href="#for-windows-users" title="Permalink to this headline"></a></h2>
<p>You need to install Cygwin; go to:</p>
<blockquote>
<a class="reference external" href="http://www.cygwin.com">http://www.cygwin.com</a></blockquote>
<p>You need to install at least the <tt class="docutils literal"><span class="pre">make</span></tt> utility, but I find that <tt class="docutils literal"><span class="pre">chere</span></tt>
(command prompt here) is also very useful.</p>
<p>Also install <tt class="docutils literal"><span class="pre">openssh</span></tt> (under <strong>Net</strong>), so you can create your RSA key
for Mercurial.</p>
<p>I&#8217;ve discovered that it&#8217;s best if you <em>don&#8217;t</em> install Python as part of
Cygwin; instead use a single Python installation under windows. Cygwin will
find the installation if it is on your Windows PATH.</p>
<p>Because of this, you shouldn&#8217;t select &#8220;mercurial&#8221; when you&#8217;re
installing Cygwin because that will cause Python to be installed. Instead,
install them as standalone Windows applications (see below).</p>
</div>
<div class="section" id="installing-sphinx">
<h2>Installing Sphinx<a class="headerlink" href="#installing-sphinx" title="Permalink to this headline"></a></h2>
<p>Because we are sometimes pushing the boundaries of Sphinx, you&#8217;ll need to get
the very latest development version (a.k.a. the &#8220;tip&#8221;).</p>
<ol class="arabic">
<li><p class="first">Get mercurial:</p>
<blockquote>
<p><a class="reference external" href="http://www.selenic.com/mercurial">http://www.selenic.com/mercurial</a></p>
<p>Avoid installing the tortoiseHG part - it has caused trouble w/ Python
debuggers.</p>
</blockquote>
</li>
<li><p class="first">To get the Sphinx trunk, start with:</p>
<blockquote>
<p><tt class="docutils literal"><span class="pre">$</span> <span class="pre">hg</span> <span class="pre">clone</span> <span class="pre">http://www.bitbucket.org/birkenfeld/sphinx/</span></tt></p>
<p>and to update, use:</p>
<p><tt class="docutils literal"><span class="pre">$</span> <span class="pre">hg</span> <span class="pre">pull</span></tt></p>
<p>Once you update, run</p>
<p><tt class="docutils literal"><span class="pre">$</span> <span class="pre">python</span> <span class="pre">setup.py</span> <span class="pre">install</span></tt></p>
<p>(You can repeat this step whenever you need to update).</p>
<p>We may talk about minimum version numbers to process the book. Check your
version with:</p>
<p><tt class="docutils literal"><span class="pre">$</span> <span class="pre">hg</span> <span class="pre">identify</span> <span class="pre">-n</span></tt></p>
</blockquote>
</li>
</ol>
<p>The full anouncement from Georg (Sphinx creator) is here:</p>
<blockquote>
<a class="reference external" href="http://groups.google.com/group/sphinx-dev/browse_thread/thread/6dd415847e5cbf7c">http://groups.google.com/group/sphinx-dev/browse_thread/thread/6dd415847e5cbf7c</a></blockquote>
<p>Mercurial Cheat sheets &amp; quick starts should be enough to answer your questions:</p>
<blockquote>
<ul class="simple">
<li><a class="reference external" href="http://edong.net/2008v1/docs/dongwoo-Hg-120dpi.png">http://edong.net/2008v1/docs/dongwoo-Hg-120dpi.png</a></li>
<li><a class="reference external" href="http://www.ivy.fr/mercurial/ref/v1.0/">http://www.ivy.fr/mercurial/ref/v1.0/</a></li>
</ul>
</blockquote>
</div>
<div class="section" id="getting-the-development-branch-of-the-book">
<h2>Getting the Development Branch of the Book<a class="headerlink" href="#getting-the-development-branch-of-the-book" title="Permalink to this headline"></a></h2>
<p>This book uses BitBucket.org tools, and additional tools if necessary.</p>
<ol class="arabic simple">
<li>Sign up for an account at <a class="reference external" href="http://BitBucket.org">http://BitBucket.org</a>.</li>
<li>You must create an rsa key. Under OSX and Linux, and if you installed
<tt class="docutils literal"><span class="pre">openssh</span> <span class="pre">with</span></tt> Cygwin under windows, you run <tt class="docutils literal"><span class="pre">ssh-keygen</span></tt> to generate
the key, and then add it to your BitBucket account.</li>
<li>Go to <a class="reference external" href="http://www.bitbucket.org/BruceEckel/python-3-patterns-idioms/">http://www.bitbucket.org/BruceEckel/python-3-patterns-idioms/</a>, and
you&#8217;ll see instructions for getting a branch for development.</li>
<li>Work on your branch and make local commits and commits to your BitBucket
account.</li>
</ol>
</div>
<div class="section" id="building-the-book">
<h2>Building the Book<a class="headerlink" href="#building-the-book" title="Permalink to this headline"></a></h2>
<p>To ensure you have Cygwin installed correctly (if you&#8217;re using windows) and
to see what the options are, type:</p>
<blockquote>
<tt class="docutils literal"><span class="pre">make</span></tt></blockquote>
<p>at a shell prompt. Then you can use <tt class="docutils literal"><span class="pre">make</span> <span class="pre">html</span></tt> to build the HTML version of
the book, or <tt class="docutils literal"><span class="pre">make</span> <span class="pre">htmlhelp</span></tt> to make the windows help version, etc.</p>
<p>You can also use the <tt class="docutils literal"><span class="pre">build</span></tt> system I&#8217;ve created (as a book example; it is
part of the distribution). This will call <tt class="docutils literal"><span class="pre">make</span></tt> and it simplifies many of the
tasks involved. Type:</p>
<blockquote>
<tt class="docutils literal"><span class="pre">build</span> <span class="pre">help</span></tt></blockquote>
<p>to see the options.</p>
<div class="admonition-todo admonition " id="todo-4">
<p class="first admonition-title">Todo</p>
<p class="last">The remainder of this document needs rewriting. Rewrite this section for BitBucket &amp; Mercurial; make some project specific diagrams;</p>
</div>
<p>Working with BitBucket and Mercurial</p>
<hr class="docutils" />
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">Adapted from a posting by Yarko Tymciurak</p>
</div>
<p>This assumes that you have created a local branch on your private machine where
you do work, and keep it merged with the trunk.</p>
<p>That is, you&#8217;ve done:</p>
<blockquote>
<ul class="simple">
<li>Forked a branch of <a class="reference external" href="http://www.bitbucket.org/BruceEckel/python-3-patterns-idioms/">http://www.bitbucket.org/BruceEckel/python-3-patterns-idioms/</a> (the main trunk; this fork will provide a place for review and comment)</li>
<li>cloned the trunk to your local machine:
- hg clone <a class="reference external" href="https://my_login&#64;bitbucket.org/BruceEckel/python-3-patterns-idioms/">https://my_login&#64;bitbucket.org/BruceEckel/python-3-patterns-idioms/</a></li>
<li>cloned your local copy of trunk to create a working directory:
- hg clone python-3-patterns-idioms devel</li>
</ul>
</blockquote>
<div class="admonition-todo admonition " id="todo-5">
<p class="first admonition-title">Todo</p>
<p>This section still work in progress:</p>
<ul class="last simple">
<li><tt class="docutils literal"><span class="pre">hg</span> <span class="pre">branch</span> <span class="pre">lp:python3patterns</span></tt></li>
<li><tt class="docutils literal"><span class="pre">hg</span> <span class="pre">commit</span> <span class="pre">-m</span> <span class="pre">'initial</span> <span class="pre">checkout'</span></tt></li>
<li>(hack, hack, hack....)</li>
<li><tt class="docutils literal"><span class="pre">hg</span> <span class="pre">merge</span></tt>   (pull new updates)</li>
<li><tt class="docutils literal"><span class="pre">hg</span> <span class="pre">commit</span> <span class="pre">-m</span> <span class="pre">'checkin</span> <span class="pre">after</span> <span class="pre">merge...'</span></tt></li>
<li>... and so on...</li>
</ul>
</div>
<p>When you have a new function idea, or think you&#8217;ve found a bug, ask Bruce
on the group.</p>
<blockquote>
<ul class="simple">
<li>If you have a new feature, register a blueprint on BitBucket and
describe what you&#8217;re going to do.</li>
<li>If you have found a bug, make a bug report on BitBucket (later assign
it to yourself, and link your branch to it);</li>
<li>If you want to work on a project, look for an unassigned bug and try to
work it out - then proceed as below...</li>
</ul>
</blockquote>
<p>When you are ready to share your work have others review, register a branch.</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">You can re-use one branch for multiple bug fixes.</p>
</div>
<ol class="arabic simple">
<li>Sign up for an account on BitBucket.org</li>
<li>Go to the project and select &#8220;register branch&#8221;
(<tt class="docutils literal"><span class="pre">https://code.BitBucket.org/python3patterns/+addbranch</span></tt>). Suggest you
create a hosted branch, then you can work locally, and pull/push as you make
progress (see
<a class="reference external" href="http://doc.Mercurial-vcs.org/latest/en/user-guide/index.html#organizing">http://doc.Mercurial-vcs.org/latest/en/user-guide/index.html#organizing</a>).</li>
<li>Once you have registered your branch, BitBucket will provide you with
instructions on how to pull and push to your personal development copy.</li>
<li>Link your bug report or blueprint to your branch.</li>
<li>Merge from your &#8220;parent&#8221; (the trunk, or others you are working with) as needed.</li>
<li>Push your working copy to BitBucket as your work is ready for others to
review or test.</li>
<li>Once you are done making your changes, have completed testing, and are
ready for the project team to inspect &amp; test, please select &#8220;propose for
merging&#8221;</li>
<li>Somebody on the core team will make a test merge (it may include
merging with other patches). Once tests pass, and your branch is accepted,
it will be merged into the trunk.</li>
</ol>
</div>
</div>


          </div>
        </div>
      </div>
      <div class="sphinxsidebar">
        <div class="sphinxsidebarwrapper">
            <p class="logo"><a href="index.html">
              <img class="logo" src="_static/Logo.png" alt="Logo"/>
            </a></p>
    <font color="Red">This book is in early development; you will find parts that are incorrect &amp; incomplete.</font>
    
            <h3><a href="index.html">Table Of Contents</a></h3>
            <ul>
<li><a class="reference external" href="">Developer Guide</a><ul>
<li><a class="reference external" href="#getting-started-the-easiest-approach">Getting Started: The Easiest Approach</a></li>
<li><a class="reference external" href="#for-windows-users">For Windows Users</a></li>
<li><a class="reference external" href="#installing-sphinx">Installing Sphinx</a></li>
<li><a class="reference external" href="#getting-the-development-branch-of-the-book">Getting the Development Branch of the Book</a></li>
<li><a class="reference external" href="#building-the-book">Building the Book</a></li>
</ul>
</li>
</ul>


            <h4>Previous topic</h4>
            <p class="topless"><a href="Rules.html" title="previous chapter">Book Development Rules</a></p>
            <h4>Next topic</h4>
            <p class="topless"><a href="Part1.html" title="next chapter">Part I: Foundations</a></p>
            <h3>This Page</h3>
            <ul class="this-page-menu">
              <li><a href="_sources/DeveloperGuide.txt">Show Source</a></li>
            </ul>
    
          <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>
    <h4><a href="http://www.mindviewinc.com/Books/Python3Patterns/Index.php">Project Homepage</a></h4>
    <h4><a href="http://www.bitbucket.org/BruceEckel/python-3-patterns-idioms/issues/">Corrections/Suggestions</a></h4>
    <h4><a href="http://www.mindviewinc.com/Consulting/Index.php">Consulting &amp; Training</a></h4><br><br>

        </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"
             accesskey="I">index</a></li>
        <li class="right" >
          <a href="Part1.html" title="Part I: Foundations"
             accesskey="N">next</a> |</li>
        <li class="right" >
          <a href="Rules.html" title="Book Development Rules"
             accesskey="P">previous</a> |</li>
        <li><a href="index.html">Python 3 Patterns & Idioms</a> &raquo;</li>
      </ul>
    </div>
    <div class="footer">
      &copy; Copyright 2008, Creative Commons Attribution-Share Alike 3.0.
      Last updated on Nov 11, 2008.
      Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 0.5.
    </div>
  </body>
</html>