Files
conductofcode/docs/_build/html/shipping/packaging.html
T
Kenneth Reitz bb36a62c50 massive dump
2012-09-02 04:33:29 -04:00

227 lines
9.7 KiB
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>Packaging Your Code &mdash; pythonguide 0.0.1 documentation</title>
<link rel="stylesheet" href="../_static/flasky.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../',
VERSION: '0.0.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="pythonguide 0.0.1 documentation" href="../index.html" />
<link rel="next" title="Freezing Your Code" href="freezing.html" />
<link rel="prev" title="Scientific Applications" href="../scenarios/scientific.html" />
<meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9">
</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="freezing.html" title="Freezing Your Code"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="../scenarios/scientific.html" title="Scientific Applications"
accesskey="P">previous</a> |</li>
<li><a href="../index.html">pythonguide 0.0.1 documentation</a> &raquo;</li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body">
<div class="section" id="packaging-your-code">
<h1>Packaging Your Code<a class="headerlink" href="#packaging-your-code" title="Permalink to this headline"></a></h1>
<p>Packaging your code is important.</p>
<div class="admonition-todo admonition" id="index-0">
<p class="first admonition-title">Todo</p>
<p class="last">Write introduction for &#8220;Packaging Your Code&#8221;</p>
</div>
<div class="section" id="for-python-developers">
<h2>For Python Developers<a class="headerlink" href="#for-python-developers" title="Permalink to this headline"></a></h2>
<p>If you&#8217;re writing an open source Python module, <a class="reference external" href="http://pypi.python.org">PyPI</a>, more properly known as <em>The Cheeseshop</em>, is the place to host it.</p>
<div class="section" id="pip-vs-easy-install">
<h3>Pip vs. easy_install<a class="headerlink" href="#pip-vs-easy-install" title="Permalink to this headline"></a></h3>
<p>Use <a class="reference external" href="http://pypi.python.org/pypi/pip">pip</a>. More details <a class="reference external" href="http://stackoverflow.com/questions/3220404/why-use-pip-over-easy-install">here</a></p>
</div>
<div class="section" id="personal-pypi">
<h3>Personal PyPI<a class="headerlink" href="#personal-pypi" title="Permalink to this headline"></a></h3>
<p>If you want to install packages from a source different from PyPI, (say, if
your packages are <em>proprietary</em>), you can do it by hosting a simple http server,
running from the directory which holds those packages which need to be installed.</p>
<p><strong>Showing an example is always beneficial</strong></p>
<p>Say if you are after installing a package called MyPackage.tar.gz, and assuming this is your directory structure</p>
<ul>
<li><dl class="first docutils">
<dt>archive</dt>
<dd><ul class="first last">
<li><dl class="first docutils">
<dt>MyPackage</dt>
<dd><ul class="first last simple">
<li>MyPackage.tar.gz</li>
</ul>
</dd>
</dl>
</li>
</ul>
</dd>
</dl>
</li>
</ul>
<p>Go to your command prompt and type:</p>
<div class="highlight-python"><pre>$ cd archive
$ python -m SimpleHTTPServer 9000</pre>
</div>
<p>This runs a simple http server running on port 9000 and will list all packages (like <strong>MyPackage</strong>). Now you can install <strong>MyPackage</strong> using any python package installer. Using Pip, you would do it like:</p>
<div class="highlight-python"><pre>$ pip install --extra-index-url=http://127.0.0.1:9000/ MyPackage</pre>
</div>
<p>Having a folder with the same name as the package name is <strong>crucial</strong> here.
I got fooled by that, one time. But if you feel that creating a folder called
<strong>MyPackage</strong> and keeping <strong>MyPackage.tar.gz</strong> inside that, is <em>redundant</em>, you can still install MyPackage using:</p>
<div class="highlight-python"><pre>$ pip install http://127.0.0.1:9000/MyPackage.tar.gz</pre>
</div>
<div class="section" id="chishop">
<h4>Chishop<a class="headerlink" href="#chishop" title="Permalink to this headline"></a></h4>
<p><a class="reference external" href="https://github.com/benliles/djangopypi">Chishop</a> is a simple PyPI server written in django which allows you to register/upload with distutils and install with easy_install/pip.</p>
</div>
</div>
</div>
<div class="section" id="for-linux-distributions">
<h2>For Linux Distributions<a class="headerlink" href="#for-linux-distributions" title="Permalink to this headline"></a></h2>
<div class="admonition-todo admonition" id="index-1">
<p class="first admonition-title">Todo</p>
<p class="last">Fill in &#8220;For Linux Distributions&#8221; packaging stub</p>
</div>
<div class="section" id="useful-tools">
<h3>Useful Tools<a class="headerlink" href="#useful-tools" title="Permalink to this headline"></a></h3>
<ul class="simple">
<li>epm</li>
<li>alien</li>
</ul>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="sphinxsidebar">
<div class="sphinxsidebarwrapper"><h3><a href="http://python-guide.org">Python Guide</a></h3>
<p>
This opinionated guide exists to provide both novice and expert Python developers a best-practice handbook to the installation, configuration, and usage of Python on a daily basis.
</p>
<h3><a href="../index.html">Table Of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">Packaging Your Code</a><ul>
<li><a class="reference internal" href="#for-python-developers">For Python Developers</a><ul>
<li><a class="reference internal" href="#pip-vs-easy-install">Pip vs. easy_install</a></li>
<li><a class="reference internal" href="#personal-pypi">Personal PyPI</a><ul>
<li><a class="reference internal" href="#chishop">Chishop</a></li>
</ul>
</li>
</ul>
</li>
<li><a class="reference internal" href="#for-linux-distributions">For Linux Distributions</a><ul>
<li><a class="reference internal" href="#useful-tools">Useful Tools</a></li>
</ul>
</li>
</ul>
</li>
</ul>
<h3>Related Topics</h3>
<ul>
<li><a href="../index.html">Documentation overview</a><ul>
<li>Previous: <a href="../scenarios/scientific.html" title="previous chapter">Scientific Applications</a></li>
<li>Next: <a href="freezing.html" title="next chapter">Freezing Your Code</a></li>
</ul></li>
</ul>
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="../_sources/shipping/packaging.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="footer">
&copy; Copyright 2012. A <a href="http://kennethreitz.com/pages/open-projects.html">Kenneth Reitz</a> Project. <a href="http://creativecommons.org/licenses/by-sa/3.0/"> Creative Commons Share-Alike 3.0</a>..
</div>
<a href="https://github.com/kennethreitz/python-guide" class="github">
<img style="position: absolute; top: 0; right: 0; border: 0;" src="http://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png" alt="Fork me on GitHub" />
</a>
<script type="text/javascript" src="//www.hellobar.com/hellobar.js"></script>
<script type="text/javascript">
new HelloBar(36402,48802);
</script>
<script type="text/javascript">
var _gaq2 = _gaq2 || [];
_gaq2.push(['_setAccount', 'UA-8742933-10']);
_gaq2.push(['_setDomainName', 'none']);
_gaq2.push(['_setAllowLinker', true]);
_gaq2.push(['_trackPageview']);
(function() {
var ga2 = document.createElement('script'); ga.type = 'text/javascript'; ga2.async = true;
ga2.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga2, s);
})();
</script>
<script type="text/javascript">
(function() {
var t = document.createElement('script');
t.type = 'text/javascript';
t.async = true;
t.id = 'gauges-tracker';
t.setAttribute('data-site-id',
'4ddc1cfaf5a1f50fcc000001');
t.src = '//secure.gaug.es/track.js';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(t, s);
})();
</script>
</body>
</html>