<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>David Fischer dot Name &#187; pip</title>
	<atom:link href="http://davidfischer.name/tag/pip/feed/" rel="self" type="application/rss+xml" />
	<link>http://davidfischer.name</link>
	<description>Some Things to Some People</description>
	<lastBuildDate>Fri, 03 Feb 2012 04:53:34 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Djangocon Day One</title>
		<link>http://davidfischer.name/2010/09/djangocon-day-one/</link>
		<comments>http://davidfischer.name/2010/09/djangocon-day-one/#comments</comments>
		<pubDate>Wed, 08 Sep 2010 00:04:30 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[celery]]></category>
		<category><![CDATA[djangocon]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[launchpad]]></category>
		<category><![CDATA[pip]]></category>
		<category><![CDATA[pylint]]></category>
		<category><![CDATA[pypi]]></category>

		<guid isPermaLink="false">http://www.davidfischer.name/?p=599</guid>
		<description><![CDATA[As I promised, here&#8217;s some]]></description>
			<content:encoded><![CDATA[<p>As I promised, here&#8217;s some (semi-live) blogging from <a href="http://djangocon.us">Djangocon</a>.</p>
<p>The first talk of the day was <em>Scaling the World&#8217;s Largest Django Application</em> given by the guys at <a href="http://disqus.com/">Disqus</a> (<a href="http://www.slideshare.net/zeeg/djangocon-2010-scaling-disqus">slides</a>). The basic gist is how they scaled up Django to handle a bajillion requests per month. One thing that I noticed is that to reach this scale, they are effectively throwing away referential integrity in their database. When asked about it, one of the guy mentioned that they have some scripts to verify that things have some level of integrity which I thought was a little scary. I was happy to see that they are basically measuring everything. On top of the usual continuous integration stuff like unit tests, lint (<a href="http://www.divmod.org/trac/wiki/DivmodPyflakes">Pyflakes</a>, actually) they are logging every query and every traceback using a package they opensourced named <a href="http://github.com/dcramer/django-sentry">Sentry</a>. In addition, the brief mention of the <span style="font-family: monospace">save()</span> method&#8217;s concurrency issues was interesting.</p>
<p>Jeff Balogh&#8217;s talk on <em>Switching addons.mozilla.org [AMO] from CakePHP to Django</em> (<a href="http://jbalogh.me/djangocon.pdf">slides</a> &#8211; pdf) was on the similar subject of switching the high traffic site AMO to Django from PHP. My favorite point from this talk is how they handle the classic stale DB replication problem of a user submitting new data (to the master) and then not seeing their data (from the slave). Basically, they use a custom Django <a href="http://github.com/jbalogh/django-multidb-router">router</a> that detects a POST and switches that user&#8217;s session to always read and write from the master which is pretty damn clever. Mozilla also de-normalized their database in order store a reference to the latest add-on (a classic problem). However, Jeff did mention that they might switch that to storing that info in cache. The main gist of this talk was cache everything.</p>
<p>Russell Keith-Magee&#8217;s <em>So you want to be a core developer?</em> and James Bennett&#8217;s <em>Topics of Interest</em> (going on now &#8212; see live blogging) are both on the future of Django and how to get involved and what needs to change in the Django community. The Django people need more people to get involved. James said there are only 14 committing developers and Russell said that to get Django 1.2 out the door he had to review tickets for 5 hours a night for 2 weeks because nobody else was doing it. As James said, their bus numbers &#8212; the number of people who get hit by a bus and then you&#8217;re screwed &#8212; is frighteningly small. There&#8217;s only 2 people who know Django Oracle support.</p>
<h5>Themes from the con</h5>
<ul>
<li><strong>Git seems to be winning in the DVCS space</strong>. It really seems like git and <a href="http://github.com/">github</a> are taking over and Bazaar and Mercurial are being left at the wayside. I&#8217;ve seen tons of links to github and zero to bitbucket or launchpad. James Bennett just now briefly mentioned bitbucket and launchpad.</li>
<li>Django developers think that database<strong> referential integrity is overrated</strong>. Multiple people mentioned that integrity is a farce when things scale insanely.</li>
<li><strong>Deploy early and often</strong>. The Mozilla guys deploy at least weekly. The Disqus guys deploy daily or more often. Although Jeff Balogh from Mozilla didn&#8217;t say it, I wonder if this means that like Disqus they are running out of trunk rather than branching and releasing.</li>
<li>Celery (see my <a href="/2010/09/django-and-asynchronous-jobs/">previous post</a>) is awesome and everybody seems to be adopting it.</li>
<li>If you aren&#8217;t using Pip and Virtualenv, you should (<a href="http://www.davidfischer.name/2010/04/why-you-should-be-using-pip-and-virtualenv/">previous post</a>). However, you probably shouldn&#8217;t deploy a production box from Pip and Pypi.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://davidfischer.name/2010/09/djangocon-day-one/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Why You Should Be Using Pip and Virtualenv</title>
		<link>http://davidfischer.name/2010/04/why-you-should-be-using-pip-and-virtualenv/</link>
		<comments>http://davidfischer.name/2010/04/why-you-should-be-using-pip-and-virtualenv/#comments</comments>
		<pubDate>Tue, 13 Apr 2010 07:00:35 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[installation]]></category>
		<category><![CDATA[pip]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[virtualenv]]></category>

		<guid isPermaLink="false">http://www.davidfischer.name/?p=467</guid>
		<description><![CDATA[In a previous post, I]]></description>
			<content:encoded><![CDATA[<p>In a <a href="/2010/01/extending-distutils-for-repeatable-builds/">previous post</a>, I promised to write about <a href="http://pip.openplans.org/">Pip</a> and <a href="http://virtualenv.openplans.org/">Virtualenv</a> and I&#8217;m now finally making good. Others have <a href="http://www.b-list.org/weblog/2008/dec/15/pip/">done</a> this <a href="http://www.saltycrane.com/blog/2009/05/notes-using-pip-and-virtualenv-django/">before</a>, but I think I have a little to add. If you develop a Python module and you don&#8217;t test it with virtualenv, don&#8217;t make your next release until you do.</p>
<h5>Configuring the environment</h5>
<p>Virtualenv creates a Python environment that is segregated from your system wide Python installation.  In this way, you can test your module without any external packages mucking up the result, add different versions of dependency packages and generally verify the exact set of requirements for your package.</p>
<p>To create the virtual environment:</p>
<pre>% virtualenv --no-site-packages testarea</pre>
<p>This creates a directory <span style="font-family: monospace">testarea/</span> that contains directories for installing modules and a Python executable. Using the virtual environment:</p>
<pre>% cd testarea
% source bin/activate</pre>
<p>Sourcing activate will set environment variables so that only modules installed under <span style="font-family: monospace">testarea/</span> are used. After setting up the environment, any desired packages can be installed (from <a href="http://pypi.python.org">pypi</a>):</p>
<pre>(testarea) % pip install rpc4django</pre>
<p>Packages can also be uninstalled, specific versions can be installed or packages can be installed from the file system, URLs or directly from source control:</p>
<pre>(testarea) % pip uninstall rpc4django
(testarea) % pip install rpc4django==0.1.6</pre>
<p>Pip is worth using over easy_install for its uninstall capabilities alone, but I should mention that pip is actively maintained while setuptools is mostly dead.</p>
<p>When you&#8217;re done with the virtual environment, simply deactivate it:</p>
<pre>(testarea) % deactivate</pre>
<h5>Do it for the tests</h5>
<p><a href="/wp-content/uploads/2010/04/virtualenv_testing.png" rel="lightbox[467]"><img src="/wp-content/uploads/2010/04/virtualenv_testing-300x229.png" alt="Testing with virtualenv" title="Testing with virtualenv and pip" width="300" height="229" style="border: 1px solid black; margin: 5px; width: 300px; float: right;" /></a><br />
While the segregated environment that virtualenv provides is extremely well suited to getting the correct environment up and running, it is just as well suited to testing your application under a variety of different package configurations. With pip and virtualenv, testing your application under three different versions of Django is a snap and it doesn&#8217;t affect your system environment in the slightest. </p>
<h5>Dependencies made easy</h5>
<p>My favorite feature of pip is the ability to create a requirements file based on a set of packages installed in your virtual environment (or your global site-packages). Creating a requirements file can be done automatically using the <span style="font-family: monospace">freeze</span> command for pip:</p>
<pre>(testarea) % pip freeze > requirements.txt
(testarea) % more requirements.txt
Django==1.1.1
rpc4django==0.1.7
wsgiref==0.1.2</pre>
<p>Wsgiref will always appear in pip&#8217;s output. It is a <a href="http://docs.python.org/library/wsgiref.html">standard library</a> package that includes <a href="http://guide.python-distribute.org/installation.html#listing-installed-packages">package metadata</a>. The requirements file is used as follows:</p>
<pre>% pip install -r requirements.txt</pre>
<p>The requirements file can be version controlled both to aid in installation and to capture the exact versions of your dependencies directly where they are used rather than after the fact in documentation that can easily become out of date. The requirements file can be used to rebuild a virtual environment or to deploy a virtual environment into the machine&#8217;s site-packages. Pip and virtualenv are exceptionally easy to use and there&#8217;s really no excuse for a Python packager not to use them. </p>
<p><strong>Note:</strong> I&#8217;m working on a fairly large sized application for work. When it is finished, I will release a post-mortem that will also function as an update to my post about <a href="/2009/07/packaging-and-sharing-django-applications/">packaging and distributing</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://davidfischer.name/2010/04/why-you-should-be-using-pip-and-virtualenv/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

