<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: PEP 370 — Per user site-packages, and environment stew</title>
	<atom:link href="http://jessenoller.com/2009/07/19/pep-370-per-user-site-packages-and-environment-stew/feed/" rel="self" type="application/rss+xml" />
	<link>http://jessenoller.com/2009/07/19/pep-370-per-user-site-packages-and-environment-stew/</link>
	<description>python, programming and other things</description>
	<lastBuildDate>Mon, 02 Jan 2012 09:21:00 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: jnoller</title>
		<link>http://jessenoller.com/2009/07/19/pep-370-per-user-site-packages-and-environment-stew/comment-page-1/#comment-139119</link>
		<dc:creator>jnoller</dc:creator>
		<pubDate>Tue, 21 Jul 2009 05:44:47 +0000</pubDate>
		<guid isPermaLink="false">http://jessenoller.com/?p=638#comment-139119</guid>
		<description>Interesting thoughts - I&#039;ve been pondering more and more &quot;hooks&quot; we could target for tarek&#039;s refacing of distutils to make things like buildout/virtualenv &quot;more of a first class citizen&quot;. &lt;br&gt;&lt;br&gt;I *do* like the recipe approach, although I admit that I&#039;m not familiar enough with generating them to &quot;really be keen on them&quot; - also, some part of me wishes all of the recipes were centralized in some way to make them mentally mesh a bit more.&lt;br&gt;&lt;br&gt;And I have headbanged on buildout a bit, and bounced off - it&#039;s relatively alien to my workflow and personally I found the very simple pip/virtualenv workflow dead simple to use (and rapid to learn). But that&#039;s just me.</description>
		<content:encoded><![CDATA[<p>Interesting thoughts — I’ve been pondering more and more “hooks” we could target for tarek’s refacing of distutils to make things like buildout/virtualenv “more of a first class citizen”. </p>
<p>I *do* like the recipe approach, although I admit that I’m not familiar enough with generating them to “really be keen on them” — also, some part of me wishes all of the recipes were centralized in some way to make them mentally mesh a bit more.</p>
<p>And I have headbanged on buildout a bit, and bounced off — it’s relatively alien to my workflow and personally I found the very simple pip/virtualenv workflow dead simple to use (and rapid to learn). But that’s just me.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kevin Teague</title>
		<link>http://jessenoller.com/2009/07/19/pep-370-per-user-site-packages-and-environment-stew/comment-page-1/#comment-139120</link>
		<dc:creator>Kevin Teague</dc:creator>
		<pubDate>Tue, 21 Jul 2009 05:22:48 +0000</pubDate>
		<guid isPermaLink="false">http://jessenoller.com/?p=638#comment-139120</guid>
		<description>&quot;we play in a setuptools-based world, which is unfortunate in a lot of respects&quot;&lt;br&gt;&lt;br&gt;This is only unfortunate in so much as setuptools hasn&#039;t seen a lot of maintenance of late, and that setuptools does way too much stuff. Typically its behavoiur such as how scripts are generated by easy_install which irks people, or how packages are downloaded which bother others, or how package metadata is different between setuptools and distutils. But there is nothing in the python packaging ecosystem which says you need to consume or use the ugly bits of setuptools - none of the ugly bits have been immortalized in a PEP! And the ugly bits of Distutils that have been PEP-immortalized will hopefully be kicked to the curb (PEP 314&#039;s Requires and Provides fields) without too much fuss.&lt;br&gt;&lt;br&gt;Hopefully the &#039;Distribute&#039; fork can further clarify what people want to keep and what to seperate out from setuptools. Heck, if someone came up today with yet-another setuptools fork, aside from an outcry of &quot;code duplication&quot;, I think this could be a good thing! It would further clarify for folks what parts of packaging are &#039;standards&#039; and &#039;interchangle formats&#039; and what parts are just instances of behaviour of a given tool and can easily be changed (by switching tools) and only affect user&#039;s of that given tool.&lt;br&gt;&lt;br&gt;I also think any truly satisfying solution to library management for a developer with reasonably complex requirements won&#039;t involve any site-packages. Obviously site-packages isn&#039;t going away any time soon, it caters really well for the &quot;scripters&quot; use-case where they just want to consume 3rd party libs in a more one-off scripting nature. But PEP 370 and VirtualEnv work within the assumption and the constraints of &quot;we already have a Python installation with a shared &#039;bin&#039; location and shared &#039;library&#039; location&quot; and then place installed files inside those locations. VirtualEnv is a total hack - but a beautiful one! It&#039;s good how virtualenv is backwards compatible with all of the existing stuff - but by it&#039;s nature it doesn&#039;t try and re-think or re-work how the problem is solved. With any shared location, be it a root-only site-packages, a .local site-packages, or a virtualenv-cloned site-packages, any shared location is an all-or-nothing location. With any all-or-nothing shared location you will always have the potential for conflicts: installing or updating dependencies for one app may break another already installed app. When attempting to sort out version/dependency issues you can&#039;t choose just some libs from a shared location, but easily ignore other libs of the wrong version in that location.&lt;br&gt;&lt;br&gt;If you start without any notion of using a site-packages, then instead you can do something such as the Buildout approach:&lt;br&gt;&lt;br&gt;  ~/projects&lt;br&gt;    /app1&lt;br&gt;      /buildout.cfg&lt;br&gt;      /bin&lt;br&gt;        /yolk&lt;br&gt;    /app2&lt;br&gt;      /buildout.cfg&lt;br&gt;      /bin&lt;br&gt;        /yolk&lt;br&gt;  ~/pythonlibs&lt;br&gt;     /yolk-0.4.1-py2.6.egg  &lt;br&gt;     /yolk-0.4.1-py2.4.egg&lt;br&gt;&lt;br&gt;This approach has the benefits of:&lt;br&gt;&lt;br&gt; * Don&#039;t need to have duplicate installations of the same version of the same library. Each version of each library only has to be installed once.&lt;br&gt;  &lt;br&gt; * Scripts are installed in a project-specific location, not in a shared space.&lt;br&gt;&lt;br&gt;This does mean that if yolk-0.4.1 is used by two different projects, then Buildout will generate two ./[someproj]/bin/yolk script entries. But that&#039;s a case where duplication is a good thing! While you may happen to be working on both projects today, and both projects are using the same libraries and python version, tomorrow could be a different story. You might want to update one project up to a cutting-edge dev version of a library but don&#039;t want to do that right now for the other project. Or maybe one project is being migrated from Python 2.5 to 2.6, but you want to hold the other project back to 2.5. You might want to have a yolk-0.4.1 and yolk-0.5dev installed side-by-side for one project, where ./bin/yolk-stable and ./bin/yolk-dev are expressed. heck, you might even want two scripts that call into yolk-0.4.1, but one version of the script needs to contain an extra line or two of hard-coded python to handle a specific use case (./bin/yolk and ./bin/yolk-extra-easy). Scripts are always installed to support a specific application or project, so always putting the scripts into a project-specific location makes things a lot simpler and I think is the way to go.&lt;br&gt;&lt;br&gt;Using a bootstrap in conjunction with VirtualEnv to bring a suite of dev tools into any new project is a good idea (e.g. pylint, nose, zest.releaser). But why state, &quot;These are the dev tools I use and want to carry around with me&quot;, when instead you can state, &quot;This project uses these dev tools for support&quot; and &quot;That project uses those dev tools for support&quot;. Each project states it&#039;s own requirement&#039;s and preferences for what tools (and possibly versions) it needs. In this way two developer&#039;s who normally prefer different dev tools can easily collaborate on a project together. They don&#039;t need to argue over what the &quot;standard dev tool&quot; suite should to be, instead they can say, &quot;we should switch from Tool X to Tool Y for Project A because if gives use Benefit C&quot;. Each project expresses it&#039;s preferences of what scripts are powered by which version of which libs and which python interpreter (whew!). Then the only thing remaining is for installation tool to care of the ugly work of expressing those preferences by outputting the gory details of the hard-coded bits of a script into a project&#039;s /bin/ directory.&lt;br&gt;&lt;br&gt;Many language camps have toyed with the approach of writing out hard-coded scripts that declare library locations up-front, and typically they back away from it because this approach is deemed to be &quot;clunky&quot;. But it&#039;s only clunky if you have to deal with the hard-coding manually! As soon as you check-in hard-coded scripts into version control, the other developers would rightfully berate you (and so instead you put &quot;#!/usr/bin/env python&quot; as a script header, but then you are only pushing the need to hard-code what python and what libs will be used into a hard-coded shell file ...) But instead if you simply express the requirements of each script (which interpreter, which libraries, where to call into for the main function), then it becomes possible to allow a tool to automate expression of all of the clunky bits and from the developer&#039;s perspective &quot;clunky&quot; becomes &quot;effortless&quot;. Furthermore if your definition of &quot;clunky&quot; is guided by actual performance benchmarks in a given deployment, then you can use different recipes to express script and package layout (flat install, egg-install, zipped-only install) until you reach a file layout that is optimized for a given deployment.&lt;br&gt;&lt;br&gt;Another reason for taking the appraoach of having an install tool layout the gory details of setting up scripts and libs for a project is that you can accomodate more than one language. Sure, python is far and away my favorite language, but I appreciate python the language just fine without appreciate how the files to support a given implementation of python are layed out. Imagine if you had &quot;VirtualRubyEnv&quot; and &quot;VirtualPerlEnv&quot; and you working on some mongrelly project that wanted to combine Python, Ruby and Perl into one place (and in an acedemic/bioinformatics setting, mongrelly projects seem to be more common than pure one language only projects). Which &quot;VirtualLang&quot; would be the master one? What if one languages notion of where it puts stuff is incompatible with how another language lays out it&#039;s files? &lt;br&gt;&lt;br&gt;So we already have, in one incarnation via Buildout and zc.recipe.egg, ostensibly reached some form of Python packaging nirvana, where libraries are consumed from a multi-version only-installed-once-each repository and subtly different scripts aren&#039;t attempting to overwrite each other. You still have the valid criticisms of Buildout being more difficult to approach and learn than it needs to be, and these practices need to be more standardized so that any install method is interchangeable with any other one. And people need to simply be aware where a practice that is causing them grief *is not* a set-in-stone standard (or any standard at all), but merely the behaviour of a given tool.&lt;br&gt;&lt;br&gt;For the Buildout problem, this can be solved with either better docs, or simply using a different install tool but taking the same approach to installation (e.g. you could do all this with Paver). It would be be a sign of success if we could get to a place where a Ruby-centric developer who wanted to use a little Python in their project could easily manage Python script generation and library installation from Ruby code.&lt;br&gt;&lt;br&gt;For standardizing things so that more and different tools can play and interoperate well (e.g. if Buildout could cherry-pick some, but not all, OS distro installed libraries). This is what the bulk of most of Tarek&#039;s PEP writing has been pushing python packaging towards: adding install_requires and entry_points to the official metadata, writing out proper installation metadata so that you can query a location and it can tell you what package and version are installed there, and the mentioned but as-yet-un-pep&#039;ed way to structure and consume a multi-version location.</description>
		<content:encoded><![CDATA[<p>“we play in a setuptools-based world, which is unfortunate in a lot of respects”</p>
<p>This is only unfortunate in so much as setuptools hasn’t seen a lot of maintenance of late, and that setuptools does way too much stuff. Typically its behavoiur such as how scripts are generated by easy_install which irks people, or how packages are downloaded which bother others, or how package metadata is different between setuptools and distutils. But there is nothing in the python packaging ecosystem which says you need to consume or use the ugly bits of setuptools — none of the ugly bits have been immortalized in a PEP! And the ugly bits of Distutils that have been PEP-immortalized will hopefully be kicked to the curb (PEP 314’s Requires and Provides fields) without too much fuss.</p>
<p>Hopefully the ‘Distribute’ fork can further clarify what people want to keep and what to seperate out from setuptools. Heck, if someone came up today with yet-another setuptools fork, aside from an outcry of “code duplication”, I think this could be a good thing! It would further clarify for folks what parts of packaging are ‘standards’ and ‘interchangle formats’ and what parts are just instances of behaviour of a given tool and can easily be changed (by switching tools) and only affect user’s of that given tool.</p>
<p>I also think any truly satisfying solution to library management for a developer with reasonably complex requirements won’t involve any site-packages. Obviously site-packages isn’t going away any time soon, it caters really well for the “scripters” use-case where they just want to consume 3rd party libs in a more one-off scripting nature. But PEP 370 and VirtualEnv work within the assumption and the constraints of “we already have a Python installation with a shared ‘bin’ location and shared ‘library’ location” and then place installed files inside those locations. VirtualEnv is a total hack — but a beautiful one! It’s good how virtualenv is backwards compatible with all of the existing stuff — but by it’s nature it doesn’t try and re-think or re-work how the problem is solved. With any shared location, be it a root-only site-packages, a .local site-packages, or a virtualenv-cloned site-packages, any shared location is an all-or-nothing location. With any all-or-nothing shared location you will always have the potential for conflicts: installing or updating dependencies for one app may break another already installed app. When attempting to sort out version/dependency issues you can’t choose just some libs from a shared location, but easily ignore other libs of the wrong version in that location.</p>
<p>If you start without any notion of using a site-packages, then instead you can do something such as the Buildout approach:</p>
<p>  ~/projects<br />    /app1<br />      /buildout.cfg<br />      /bin<br />        /yolk<br />    /app2<br />      /buildout.cfg<br />      /bin<br />        /yolk<br />  ~/pythonlibs<br />     /yolk-0.4.1-py2.6.egg  <br />     /yolk-0.4.1-py2.4.egg</p>
<p>This approach has the benefits of:</p>
<p> * Don’t need to have duplicate installations of the same version of the same library. Each version of each library only has to be installed once.</p>
<p> * Scripts are installed in a project-specific location, not in a shared space.</p>
<p>This does mean that if yolk-0.4.1 is used by two different projects, then Buildout will generate two ./[someproj]/bin/yolk script entries. But that’s a case where duplication is a good thing! While you may happen to be working on both projects today, and both projects are using the same libraries and python version, tomorrow could be a different story. You might want to update one project up to a cutting-edge dev version of a library but don’t want to do that right now for the other project. Or maybe one project is being migrated from Python 2.5 to 2.6, but you want to hold the other project back to 2.5. You might want to have a yolk-0.4.1 and yolk-0.5dev installed side-by-side for one project, where ./bin/yolk-stable and ./bin/yolk-dev are expressed. heck, you might even want two scripts that call into yolk-0.4.1, but one version of the script needs to contain an extra line or two of hard-coded python to handle a specific use case (./bin/yolk and ./bin/yolk-extra-easy). Scripts are always installed to support a specific application or project, so always putting the scripts into a project-specific location makes things a lot simpler and I think is the way to go.</p>
<p>Using a bootstrap in conjunction with VirtualEnv to bring a suite of dev tools into any new project is a good idea (e.g. pylint, nose, zest.releaser). But why state, “These are the dev tools I use and want to carry around with me”, when instead you can state, “This project uses these dev tools for support” and “That project uses those dev tools for support”. Each project states it’s own requirement’s and preferences for what tools (and possibly versions) it needs. In this way two developer’s who normally prefer different dev tools can easily collaborate on a project together. They don’t need to argue over what the “standard dev tool” suite should to be, instead they can say, “we should switch from Tool X to Tool Y for Project A because if gives use Benefit C”. Each project expresses it’s preferences of what scripts are powered by which version of which libs and which python interpreter (whew!). Then the only thing remaining is for installation tool to care of the ugly work of expressing those preferences by outputting the gory details of the hard-coded bits of a script into a project’s /bin/ directory.</p>
<p>Many language camps have toyed with the approach of writing out hard-coded scripts that declare library locations up-front, and typically they back away from it because this approach is deemed to be “clunky”. But it’s only clunky if you have to deal with the hard-coding manually! As soon as you check-in hard-coded scripts into version control, the other developers would rightfully berate you (and so instead you put “#!/usr/bin/env python” as a script header, but then you are only pushing the need to hard-code what python and what libs will be used into a hard-coded shell file …) But instead if you simply express the requirements of each script (which interpreter, which libraries, where to call into for the main function), then it becomes possible to allow a tool to automate expression of all of the clunky bits and from the developer’s perspective “clunky” becomes “effortless”. Furthermore if your definition of “clunky” is guided by actual performance benchmarks in a given deployment, then you can use different recipes to express script and package layout (flat install, egg-install, zipped-only install) until you reach a file layout that is optimized for a given deployment.</p>
<p>Another reason for taking the appraoach of having an install tool layout the gory details of setting up scripts and libs for a project is that you can accomodate more than one language. Sure, python is far and away my favorite language, but I appreciate python the language just fine without appreciate how the files to support a given implementation of python are layed out. Imagine if you had “VirtualRubyEnv” and “VirtualPerlEnv” and you working on some mongrelly project that wanted to combine Python, Ruby and Perl into one place (and in an acedemic/bioinformatics setting, mongrelly projects seem to be more common than pure one language only projects). Which “VirtualLang” would be the master one? What if one languages notion of where it puts stuff is incompatible with how another language lays out it’s files? </p>
<p>So we already have, in one incarnation via Buildout and zc.recipe.egg, ostensibly reached some form of Python packaging nirvana, where libraries are consumed from a multi-version only-installed-once-each repository and subtly different scripts aren’t attempting to overwrite each other. You still have the valid criticisms of Buildout being more difficult to approach and learn than it needs to be, and these practices need to be more standardized so that any install method is interchangeable with any other one. And people need to simply be aware where a practice that is causing them grief *is not* a set-in-stone standard (or any standard at all), but merely the behaviour of a given tool.</p>
<p>For the Buildout problem, this can be solved with either better docs, or simply using a different install tool but taking the same approach to installation (e.g. you could do all this with Paver). It would be be a sign of success if we could get to a place where a Ruby-centric developer who wanted to use a little Python in their project could easily manage Python script generation and library installation from Ruby code.</p>
<p>For standardizing things so that more and different tools can play and interoperate well (e.g. if Buildout could cherry-pick some, but not all, OS distro installed libraries). This is what the bulk of most of Tarek’s PEP writing has been pushing python packaging towards: adding install_requires and entry_points to the official metadata, writing out proper installation metadata so that you can query a location and it can tell you what package and version are installed there, and the mentioned but as-yet-un-pep’ed way to structure and consume a multi-version location.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kevin Teague</title>
		<link>http://jessenoller.com/2009/07/19/pep-370-per-user-site-packages-and-environment-stew/comment-page-1/#comment-139118</link>
		<dc:creator>Kevin Teague</dc:creator>
		<pubDate>Tue, 21 Jul 2009 05:22:25 +0000</pubDate>
		<guid isPermaLink="false">http://jessenoller.com/?p=638#comment-139118</guid>
		<description>There are 143 at the moment, to be precise:&lt;br&gt;&lt;br&gt;&lt;a href=&quot;http://pypi.python.org/pypi?:action=browse&amp;show=all&amp;c=512&quot; rel=&quot;nofollow&quot;&gt;http://pypi.python.org/pypi?:action=browse&amp;show...&lt;/a&gt;&lt;br&gt;&lt;br&gt;But as a general purpose project setup and installation tool, that&#039;s kind of the point - different recipes to install different stuff. Although there are lots of recipes that are overly-specific and often a single more generic recipe is later developed which can be used, and other recipes that are near-duplicates and a &quot;canonical&quot; one needs to be chosen: templating of config files is a good example here.&lt;br&gt;&lt;br&gt;But usually when people talk about Buildout in the context of managing Python libraries, they actually mean the zc.recipe.egg recipe, which is the most commonly used recipe used to install python packages and scripts.&lt;br&gt;&lt;br&gt;As for reaching understanding with Buildout, well, I think there is still lots of room for improvement in making a more user friendly &quot;getting starting with Buildout&quot; document. Learning Buildout still does tend to require more headbanging than should be needed.</description>
		<content:encoded><![CDATA[<p>There are 143 at the moment, to be precise:</p>
<p><a href="http://pypi.python.org/pypi?:action=browse&#038;show=all&#038;c=512" rel="nofollow">http://pypi.python.org/pypi?:action=browse&amp;show…</a></p>
<p>But as a general purpose project setup and installation tool, that’s kind of the point — different recipes to install different stuff. Although there are lots of recipes that are overly-specific and often a single more generic recipe is later developed which can be used, and other recipes that are near-duplicates and a “canonical” one needs to be chosen: templating of config files is a good example here.</p>
<p>But usually when people talk about Buildout in the context of managing Python libraries, they actually mean the zc.recipe.egg recipe, which is the most commonly used recipe used to install python packages and scripts.</p>
<p>As for reaching understanding with Buildout, well, I think there is still lots of room for improvement in making a more user friendly “getting starting with Buildout” document. Learning Buildout still does tend to require more headbanging than should be needed.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jnoller</title>
		<link>http://jessenoller.com/2009/07/19/pep-370-per-user-site-packages-and-environment-stew/comment-page-1/#comment-139121</link>
		<dc:creator>jnoller</dc:creator>
		<pubDate>Tue, 21 Jul 2009 02:23:14 +0000</pubDate>
		<guid isPermaLink="false">http://jessenoller.com/?p=638#comment-139121</guid>
		<description>You can change the name of the directory with the PYTHONUSERBASE environment variable; but I definitely agree with you</description>
		<content:encoded><![CDATA[<p>You can change the name of the directory with the PYTHONUSERBASE environment variable; but I definitely agree with you</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jnoller</title>
		<link>http://jessenoller.com/2009/07/19/pep-370-per-user-site-packages-and-environment-stew/comment-page-1/#comment-139117</link>
		<dc:creator>jnoller</dc:creator>
		<pubDate>Tue, 21 Jul 2009 02:22:37 +0000</pubDate>
		<guid isPermaLink="false">http://jessenoller.com/?p=638#comment-139117</guid>
		<description>Thanks - my big problem with buildout has been one of simplicity, and understanding which recipe does which thing and which one makes sense. Trolling pypi for the &quot;buildout&quot; term results in *cough* quite a few of them.&lt;br&gt;&lt;br&gt;That being said, until Tarek can kickass and fix up distutils to be &quot;on par&quot;-ish with setuptools, and push out his fork of it, we play in a setuptools-based world, which is unfortunate in a lot of respects.</description>
		<content:encoded><![CDATA[<p>Thanks — my big problem with buildout has been one of simplicity, and understanding which recipe does which thing and which one makes sense. Trolling pypi for the “buildout” term results in *cough* quite a few of them.</p>
<p>That being said, until Tarek can kickass and fix up distutils to be “on par”-ish with setuptools, and push out his fork of it, we play in a setuptools-based world, which is unfortunate in a lot of respects.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jnoller</title>
		<link>http://jessenoller.com/2009/07/19/pep-370-per-user-site-packages-and-environment-stew/comment-page-1/#comment-96715</link>
		<dc:creator>jnoller</dc:creator>
		<pubDate>Tue, 21 Jul 2009 00:44:47 +0000</pubDate>
		<guid isPermaLink="false">http://jessenoller.com/?p=638#comment-96715</guid>
		<description>Interesting thoughts - I&#039;ve been pondering more and more &quot;hooks&quot; we could target for tarek&#039;s refacing of distutils to make things like buildout/virtualenv &quot;more of a first class citizen&quot;. &lt;br&gt;&lt;br&gt;I *do* like the recipe approach, although I admit that I&#039;m not familiar enough with generating them to &quot;really be keen on them&quot; - also, some part of me wishes all of the recipes were centralized in some way to make them mentally mesh a bit more.&lt;br&gt;&lt;br&gt;And I have headbanged on buildout a bit, and bounced off - it&#039;s relatively alien to my workflow and personally I found the very simple pip/virtualenv workflow dead simple to use (and rapid to learn). But that&#039;s just me.</description>
		<content:encoded><![CDATA[<p>Interesting thoughts — I’ve been pondering more and more “hooks” we could target for tarek’s refacing of distutils to make things like buildout/virtualenv “more of a first class citizen”. </p>
<p>I *do* like the recipe approach, although I admit that I’m not familiar enough with generating them to “really be keen on them” — also, some part of me wishes all of the recipes were centralized in some way to make them mentally mesh a bit more.</p>
<p>And I have headbanged on buildout a bit, and bounced off — it’s relatively alien to my workflow and personally I found the very simple pip/virtualenv workflow dead simple to use (and rapid to learn). But that’s just me.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kevin Teague</title>
		<link>http://jessenoller.com/2009/07/19/pep-370-per-user-site-packages-and-environment-stew/comment-page-1/#comment-96711</link>
		<dc:creator>Kevin Teague</dc:creator>
		<pubDate>Tue, 21 Jul 2009 00:22:48 +0000</pubDate>
		<guid isPermaLink="false">http://jessenoller.com/?p=638#comment-96711</guid>
		<description>&quot;we play in a setuptools-based world, which is unfortunate in a lot of respects&quot;&lt;br&gt;&lt;br&gt;This is only unfortunate in so much as setuptools hasn&#039;t seen a lot of maintenance of late, and that setuptools does way too much stuff. Typically its behavoiur such as how scripts are generated by easy_install which irks people, or how packages are downloaded which bother others, or how package metadata is different between setuptools and distutils. But there is nothing in the python packaging ecosystem which says you need to consume or use the ugly bits of setuptools - none of the ugly bits have been immortalized in a PEP! And the ugly bits of Distutils that have been PEP-immortalized will hopefully be kicked to the curb (PEP 314&#039;s Requires and Provides fields) without too much fuss.&lt;br&gt;&lt;br&gt;Hopefully the &#039;Distribute&#039; fork can further clarify what people want to keep and what to seperate out from setuptools. Heck, if someone came up today with yet-another setuptools fork, aside from an outcry of &quot;code duplication&quot;, I think this could be a good thing! It would further clarify for folks what parts of packaging are &#039;standards&#039; and &#039;interchangle formats&#039; and what parts are just instances of behaviour of a given tool and can easily be changed (by switching tools) and only affect user&#039;s of that given tool.&lt;br&gt;&lt;br&gt;I also think any truly satisfying solution to library management for a developer with reasonably complex requirements won&#039;t involve any site-packages. Obviously site-packages isn&#039;t going away any time soon, it caters really well for the &quot;scripters&quot; use-case where they just want to consume 3rd party libs in a more one-off scripting nature. But PEP 370 and VirtualEnv work within the assumption and the constraints of &quot;we already have a Python installation with a shared &#039;bin&#039; location and shared &#039;library&#039; location&quot; and then place installed files inside those locations. VirtualEnv is a total hack - but a beautiful one! It&#039;s good how virtualenv is backwards compatible with all of the existing stuff - but by it&#039;s nature it doesn&#039;t try and re-think or re-work how the problem is solved. With any shared location, be it a root-only site-packages, a .local site-packages, or a virtualenv-cloned site-packages, any shared location is an all-or-nothing location. With any all-or-nothing shared location you will always have the potential for conflicts: installing or updating dependencies for one app may break another already installed app. When attempting to sort out version/dependency issues you can&#039;t choose just some libs from a shared location, but easily ignore other libs of the wrong version in that location.&lt;br&gt;&lt;br&gt;If you start without any notion of using a site-packages, then instead you can do something such as the Buildout approach:&lt;br&gt;&lt;br&gt;  ~/projects&lt;br&gt;    /app1&lt;br&gt;      /buildout.cfg&lt;br&gt;      /bin&lt;br&gt;        /yolk&lt;br&gt;    /app2&lt;br&gt;      /buildout.cfg&lt;br&gt;      /bin&lt;br&gt;        /yolk&lt;br&gt;  ~/pythonlibs&lt;br&gt;     /yolk-0.4.1-py2.6.egg  &lt;br&gt;     /yolk-0.4.1-py2.4.egg&lt;br&gt;&lt;br&gt;This approach has the benefits of:&lt;br&gt;&lt;br&gt; * Don&#039;t need to have duplicate installations of the same version of the same library. Each version of each library only has to be installed once.&lt;br&gt;  &lt;br&gt; * Scripts are installed in a project-specific location, not in a shared space.&lt;br&gt;&lt;br&gt;This does mean that if yolk-0.4.1 is used by two different projects, then Buildout will generate two ./[someproj]/bin/yolk script entries. But that&#039;s a case where duplication is a good thing! While you may happen to be working on both projects today, and both projects are using the same libraries and python version, tomorrow could be a different story. You might want to update one project up to a cutting-edge dev version of a library but don&#039;t want to do that right now for the other project. Or maybe one project is being migrated from Python 2.5 to 2.6, but you want to hold the other project back to 2.5. You might want to have a yolk-0.4.1 and yolk-0.5dev installed side-by-side for one project, where ./bin/yolk-stable and ./bin/yolk-dev are expressed. heck, you might even want two scripts that call into yolk-0.4.1, but one version of the script needs to contain an extra line or two of hard-coded python to handle a specific use case (./bin/yolk and ./bin/yolk-extra-easy). Scripts are always installed to support a specific application or project, so always putting the scripts into a project-specific location makes things a lot simpler and I think is the way to go.&lt;br&gt;&lt;br&gt;Using a bootstrap in conjunction with VirtualEnv to bring a suite of dev tools into any new project is a good idea (e.g. pylint, nose, zest.releaser). But why state, &quot;These are the dev tools I use and want to carry around with me&quot;, when instead you can state, &quot;This project uses these dev tools for support&quot; and &quot;That project uses those dev tools for support&quot;. Each project states it&#039;s own requirement&#039;s and preferences for what tools (and possibly versions) it needs. In this way two developer&#039;s who normally prefer different dev tools can easily collaborate on a project together. They don&#039;t need to argue over what the &quot;standard dev tool&quot; suite should to be, instead they can say, &quot;we should switch from Tool X to Tool Y for Project A because if gives use Benefit C&quot;. Each project expresses it&#039;s preferences of what scripts are powered by which version of which libs and which python interpreter (whew!). Then the only thing remaining is for installation tool to care of the ugly work of expressing those preferences by outputting the gory details of the hard-coded bits of a script into a project&#039;s /bin/ directory.&lt;br&gt;&lt;br&gt;Many language camps have toyed with the approach of writing out hard-coded scripts that declare library locations up-front, and typically they back away from it because this approach is deemed to be &quot;clunky&quot;. But it&#039;s only clunky if you have to deal with the hard-coding manually! As soon as you check-in hard-coded scripts into version control, the other developers would rightfully berate you (and so instead you put &quot;#!/usr/bin/env python&quot; as a script header, but then you are only pushing the need to hard-code what python and what libs will be used into a hard-coded shell file ...) But instead if you simply express the requirements of each script (which interpreter, which libraries, where to call into for the main function), then it becomes possible to allow a tool to automate expression of all of the clunky bits and from the developer&#039;s perspective &quot;clunky&quot; becomes &quot;effortless&quot;. Furthermore if your definition of &quot;clunky&quot; is guided by actual performance benchmarks in a given deployment, then you can use different recipes to express script and package layout (flat install, egg-install, zipped-only install) until you reach a file layout that is optimized for a given deployment.&lt;br&gt;&lt;br&gt;Another reason for taking the appraoach of having an install tool layout the gory details of setting up scripts and libs for a project is that you can accomodate more than one language. Sure, python is far and away my favorite language, but I appreciate python the language just fine without appreciate how the files to support a given implementation of python are layed out. Imagine if you had &quot;VirtualRubyEnv&quot; and &quot;VirtualPerlEnv&quot; and you working on some mongrelly project that wanted to combine Python, Ruby and Perl into one place (and in an acedemic/bioinformatics setting, mongrelly projects seem to be more common than pure one language only projects). Which &quot;VirtualLang&quot; would be the master one? What if one languages notion of where it puts stuff is incompatible with how another language lays out it&#039;s files? &lt;br&gt;&lt;br&gt;So we already have, in one incarnation via Buildout and zc.recipe.egg, ostensibly reached some form of Python packaging nirvana, where libraries are consumed from a multi-version only-installed-once-each repository and subtly different scripts aren&#039;t attempting to overwrite each other. You still have the valid criticisms of Buildout being more difficult to approach and learn than it needs to be, and these practices need to be more standardized so that any install method is interchangeable with any other one. And people need to simply be aware where a practice that is causing them grief *is not* a set-in-stone standard (or any standard at all), but merely the behaviour of a given tool.&lt;br&gt;&lt;br&gt;For the Buildout problem, this can be solved with either better docs, or simply using a different install tool but taking the same approach to installation (e.g. you could do all this with Paver). It would be be a sign of success if we could get to a place where a Ruby-centric developer who wanted to use a little Python in their project could easily manage Python script generation and library installation from Ruby code.&lt;br&gt;&lt;br&gt;For standardizing things so that more and different tools can play and interoperate well (e.g. if Buildout could cherry-pick some, but not all, OS distro installed libraries). This is what the bulk of most of Tarek&#039;s PEP writing has been pushing python packaging towards: adding install_requires and entry_points to the official metadata, writing out proper installation metadata so that you can query a location and it can tell you what package and version are installed there, and the mentioned but as-yet-un-pep&#039;ed way to structure and consume a multi-version location.</description>
		<content:encoded><![CDATA[<p>“we play in a setuptools-based world, which is unfortunate in a lot of respects”</p>
<p>This is only unfortunate in so much as setuptools hasn’t seen a lot of maintenance of late, and that setuptools does way too much stuff. Typically its behavoiur such as how scripts are generated by easy_install which irks people, or how packages are downloaded which bother others, or how package metadata is different between setuptools and distutils. But there is nothing in the python packaging ecosystem which says you need to consume or use the ugly bits of setuptools — none of the ugly bits have been immortalized in a PEP! And the ugly bits of Distutils that have been PEP-immortalized will hopefully be kicked to the curb (PEP 314’s Requires and Provides fields) without too much fuss.</p>
<p>Hopefully the ‘Distribute’ fork can further clarify what people want to keep and what to seperate out from setuptools. Heck, if someone came up today with yet-another setuptools fork, aside from an outcry of “code duplication”, I think this could be a good thing! It would further clarify for folks what parts of packaging are ‘standards’ and ‘interchangle formats’ and what parts are just instances of behaviour of a given tool and can easily be changed (by switching tools) and only affect user’s of that given tool.</p>
<p>I also think any truly satisfying solution to library management for a developer with reasonably complex requirements won’t involve any site-packages. Obviously site-packages isn’t going away any time soon, it caters really well for the “scripters” use-case where they just want to consume 3rd party libs in a more one-off scripting nature. But PEP 370 and VirtualEnv work within the assumption and the constraints of “we already have a Python installation with a shared ‘bin’ location and shared ‘library’ location” and then place installed files inside those locations. VirtualEnv is a total hack — but a beautiful one! It’s good how virtualenv is backwards compatible with all of the existing stuff — but by it’s nature it doesn’t try and re-think or re-work how the problem is solved. With any shared location, be it a root-only site-packages, a .local site-packages, or a virtualenv-cloned site-packages, any shared location is an all-or-nothing location. With any all-or-nothing shared location you will always have the potential for conflicts: installing or updating dependencies for one app may break another already installed app. When attempting to sort out version/dependency issues you can’t choose just some libs from a shared location, but easily ignore other libs of the wrong version in that location.</p>
<p>If you start without any notion of using a site-packages, then instead you can do something such as the Buildout approach:</p>
<p>  ~/projects<br />    /app1<br />      /buildout.cfg<br />      /bin<br />        /yolk<br />    /app2<br />      /buildout.cfg<br />      /bin<br />        /yolk<br />  ~/pythonlibs<br />     /yolk-0.4.1-py2.6.egg  <br />     /yolk-0.4.1-py2.4.egg</p>
<p>This approach has the benefits of:</p>
<p> * Don’t need to have duplicate installations of the same version of the same library. Each version of each library only has to be installed once.</p>
<p> * Scripts are installed in a project-specific location, not in a shared space.</p>
<p>This does mean that if yolk-0.4.1 is used by two different projects, then Buildout will generate two ./[someproj]/bin/yolk script entries. But that’s a case where duplication is a good thing! While you may happen to be working on both projects today, and both projects are using the same libraries and python version, tomorrow could be a different story. You might want to update one project up to a cutting-edge dev version of a library but don’t want to do that right now for the other project. Or maybe one project is being migrated from Python 2.5 to 2.6, but you want to hold the other project back to 2.5. You might want to have a yolk-0.4.1 and yolk-0.5dev installed side-by-side for one project, where ./bin/yolk-stable and ./bin/yolk-dev are expressed. heck, you might even want two scripts that call into yolk-0.4.1, but one version of the script needs to contain an extra line or two of hard-coded python to handle a specific use case (./bin/yolk and ./bin/yolk-extra-easy). Scripts are always installed to support a specific application or project, so always putting the scripts into a project-specific location makes things a lot simpler and I think is the way to go.</p>
<p>Using a bootstrap in conjunction with VirtualEnv to bring a suite of dev tools into any new project is a good idea (e.g. pylint, nose, zest.releaser). But why state, “These are the dev tools I use and want to carry around with me”, when instead you can state, “This project uses these dev tools for support” and “That project uses those dev tools for support”. Each project states it’s own requirement’s and preferences for what tools (and possibly versions) it needs. In this way two developer’s who normally prefer different dev tools can easily collaborate on a project together. They don’t need to argue over what the “standard dev tool” suite should to be, instead they can say, “we should switch from Tool X to Tool Y for Project A because if gives use Benefit C”. Each project expresses it’s preferences of what scripts are powered by which version of which libs and which python interpreter (whew!). Then the only thing remaining is for installation tool to care of the ugly work of expressing those preferences by outputting the gory details of the hard-coded bits of a script into a project’s /bin/ directory.</p>
<p>Many language camps have toyed with the approach of writing out hard-coded scripts that declare library locations up-front, and typically they back away from it because this approach is deemed to be “clunky”. But it’s only clunky if you have to deal with the hard-coding manually! As soon as you check-in hard-coded scripts into version control, the other developers would rightfully berate you (and so instead you put “#!/usr/bin/env python” as a script header, but then you are only pushing the need to hard-code what python and what libs will be used into a hard-coded shell file …) But instead if you simply express the requirements of each script (which interpreter, which libraries, where to call into for the main function), then it becomes possible to allow a tool to automate expression of all of the clunky bits and from the developer’s perspective “clunky” becomes “effortless”. Furthermore if your definition of “clunky” is guided by actual performance benchmarks in a given deployment, then you can use different recipes to express script and package layout (flat install, egg-install, zipped-only install) until you reach a file layout that is optimized for a given deployment.</p>
<p>Another reason for taking the appraoach of having an install tool layout the gory details of setting up scripts and libs for a project is that you can accomodate more than one language. Sure, python is far and away my favorite language, but I appreciate python the language just fine without appreciate how the files to support a given implementation of python are layed out. Imagine if you had “VirtualRubyEnv” and “VirtualPerlEnv” and you working on some mongrelly project that wanted to combine Python, Ruby and Perl into one place (and in an acedemic/bioinformatics setting, mongrelly projects seem to be more common than pure one language only projects). Which “VirtualLang” would be the master one? What if one languages notion of where it puts stuff is incompatible with how another language lays out it’s files? </p>
<p>So we already have, in one incarnation via Buildout and zc.recipe.egg, ostensibly reached some form of Python packaging nirvana, where libraries are consumed from a multi-version only-installed-once-each repository and subtly different scripts aren’t attempting to overwrite each other. You still have the valid criticisms of Buildout being more difficult to approach and learn than it needs to be, and these practices need to be more standardized so that any install method is interchangeable with any other one. And people need to simply be aware where a practice that is causing them grief *is not* a set-in-stone standard (or any standard at all), but merely the behaviour of a given tool.</p>
<p>For the Buildout problem, this can be solved with either better docs, or simply using a different install tool but taking the same approach to installation (e.g. you could do all this with Paver). It would be be a sign of success if we could get to a place where a Ruby-centric developer who wanted to use a little Python in their project could easily manage Python script generation and library installation from Ruby code.</p>
<p>For standardizing things so that more and different tools can play and interoperate well (e.g. if Buildout could cherry-pick some, but not all, OS distro installed libraries). This is what the bulk of most of Tarek’s PEP writing has been pushing python packaging towards: adding install_requires and entry_points to the official metadata, writing out proper installation metadata so that you can query a location and it can tell you what package and version are installed there, and the mentioned but as-yet-un-pep’ed way to structure and consume a multi-version location.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kevin Teague</title>
		<link>http://jessenoller.com/2009/07/19/pep-370-per-user-site-packages-and-environment-stew/comment-page-1/#comment-96710</link>
		<dc:creator>Kevin Teague</dc:creator>
		<pubDate>Tue, 21 Jul 2009 00:22:25 +0000</pubDate>
		<guid isPermaLink="false">http://jessenoller.com/?p=638#comment-96710</guid>
		<description>There are 143 at the moment, to be precise:&lt;br&gt;&lt;br&gt;&lt;a href=&quot;http://pypi.python.org/pypi?:action=browse&amp;show=all&amp;c=512&quot; rel=&quot;nofollow&quot;&gt;http://pypi.python.org/pypi?:action=browse&amp;show...&lt;/a&gt;&lt;br&gt;&lt;br&gt;But as a general purpose project setup and installation tool, that&#039;s kind of the point - different recipes to install different stuff. Although there are lots of recipes that are overly-specific and often a single more generic recipe is later developed which can be used, and other recipes that are near-duplicates and a &quot;canonical&quot; one needs to be chosen: templating of config files is a good example here.&lt;br&gt;&lt;br&gt;But usually when people talk about Buildout in the context of managing Python libraries, they actually mean the zc.recipe.egg recipe, which is the most commonly used recipe used to install python packages and scripts.&lt;br&gt;&lt;br&gt;As for reaching understanding with Buildout, well, I think there is still lots of room for improvement in making a more user friendly &quot;getting starting with Buildout&quot; document. Learning Buildout still does tend to require more headbanging than should be needed.</description>
		<content:encoded><![CDATA[<p>There are 143 at the moment, to be precise:</p>
<p><a href="http://pypi.python.org/pypi?:action=browse&#038;show=all&#038;c=512" rel="nofollow">http://pypi.python.org/pypi?:action=browse&amp;show…</a></p>
<p>But as a general purpose project setup and installation tool, that’s kind of the point — different recipes to install different stuff. Although there are lots of recipes that are overly-specific and often a single more generic recipe is later developed which can be used, and other recipes that are near-duplicates and a “canonical” one needs to be chosen: templating of config files is a good example here.</p>
<p>But usually when people talk about Buildout in the context of managing Python libraries, they actually mean the zc.recipe.egg recipe, which is the most commonly used recipe used to install python packages and scripts.</p>
<p>As for reaching understanding with Buildout, well, I think there is still lots of room for improvement in making a more user friendly “getting starting with Buildout” document. Learning Buildout still does tend to require more headbanging than should be needed.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jnoller</title>
		<link>http://jessenoller.com/2009/07/19/pep-370-per-user-site-packages-and-environment-stew/comment-page-1/#comment-96578</link>
		<dc:creator>jnoller</dc:creator>
		<pubDate>Mon, 20 Jul 2009 21:23:14 +0000</pubDate>
		<guid isPermaLink="false">http://jessenoller.com/?p=638#comment-96578</guid>
		<description>You can change the name of the directory with the PYTHONUSERBASE environment variable; but I definitely agree with you</description>
		<content:encoded><![CDATA[<p>You can change the name of the directory with the PYTHONUSERBASE environment variable; but I definitely agree with you</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jnoller</title>
		<link>http://jessenoller.com/2009/07/19/pep-370-per-user-site-packages-and-environment-stew/comment-page-1/#comment-96577</link>
		<dc:creator>jnoller</dc:creator>
		<pubDate>Mon, 20 Jul 2009 21:22:37 +0000</pubDate>
		<guid isPermaLink="false">http://jessenoller.com/?p=638#comment-96577</guid>
		<description>Thanks - my big problem with buildout has been one of simplicity, and understanding which recipe does which thing and which one makes sense. Trolling pypi for the &quot;buildout&quot; term results in *cough* quite a few of them.&lt;br&gt;&lt;br&gt;That being said, until Tarek can kickass and fix up distutils to be &quot;on par&quot;-ish with setuptools, and push out his fork of it, we play in a setuptools-based world, which is unfortunate in a lot of respects.</description>
		<content:encoded><![CDATA[<p>Thanks — my big problem with buildout has been one of simplicity, and understanding which recipe does which thing and which one makes sense. Trolling pypi for the “buildout” term results in *cough* quite a few of them.</p>
<p>That being said, until Tarek can kickass and fix up distutils to be “on par”-ish with setuptools, and push out his fork of it, we play in a setuptools-based world, which is unfortunate in a lot of respects.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: enhanced
Object Caching 727/728 objects using disk: basic

Served from: jessenoller.com @ 2012-02-08 02:42:31 -->
