<?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: Trapped in python package; send food.</title>
	<atom:link href="http://jessenoller.com/2009/07/17/trapped-in-python-package-send-food/feed/" rel="self" type="application/rss+xml" />
	<link>http://jessenoller.com/2009/07/17/trapped-in-python-package-send-food/</link>
	<description>python, programming and other things</description>
	<lastBuildDate>Sun, 04 Mar 2012 06:06:00 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: kteague</title>
		<link>http://jessenoller.com/2009/07/17/trapped-in-python-package-send-food/comment-page-1/#comment-139130</link>
		<dc:creator>kteague</dc:creator>
		<pubDate>Sun, 19 Jul 2009 11:00:19 +0000</pubDate>
		<guid isPermaLink="false">http://jessenoller.com/?p=625#comment-139130</guid>
		<description>Twiddling with the shebang, that&#039;s a Distutils thing:&lt;br&gt;&lt;br&gt;&lt;a href=&quot;http://docs.python.org/distutils/setupscript.html#installing-scripts&quot; rel=&quot;nofollow&quot;&gt;http://docs.python.org/distutils/setupscript.ht...&lt;/a&gt;&lt;br&gt;&lt;br&gt;&quot;The only clever feature is that if the first line of the script starts with #! and contains the word “python”, the Distutils will adjust the first line to refer to the current interpreter location.&quot; Heh, one man&#039;s &quot;clever feature&quot; is another man&#039;s headache. The --executable option allows you to override this behaviour though.&lt;br&gt;&lt;br&gt;But the other option is to declare a set of repeatable steps so that you can compile from source on fresh machines. Buildout is the uber-tool for this job! Here&#039;s a decent starter for compiling a Python interpreter using Buildout (&lt;a href=&quot;http://bluedynamics.com/articles/jens/build-python-in-buildout&quot; rel=&quot;nofollow&quot;&gt;http://bluedynamics.com/articles/jens/build-pyt...&lt;/a&gt;). And generally anything is hairy or a PITA to compile on OS X, you can Google for &quot;buildout hard-to-build-thing&quot; and someone has usually put together a recipe for building it.</description>
		<content:encoded><![CDATA[<p>Twiddling with the shebang, that’s a Distutils thing:</p>
<p><a href="http://docs.python.org/distutils/setupscript.html#installing-scripts" rel="nofollow"></a><a href="http://docs.python.org/distutils/setupscript.ht" rel="nofollow">http://docs.python.org/distutils/setupscript.ht</a>…</p>
<p>“The only clever feature is that if the first line of the script starts with #! and contains the word “python”, the Distutils will adjust the first line to refer to the current interpreter location.” Heh, one man’s “clever feature” is another man’s headache. The –executable option allows you to override this behaviour though.</p>
<p>But the other option is to declare a set of repeatable steps so that you can compile from source on fresh machines. Buildout is the uber-tool for this job! Here’s a decent starter for compiling a Python interpreter using Buildout (<a href="http://bluedynamics.com/articles/jens/build-python-in-buildout" rel="nofollow"></a><a href="http://bluedynamics.com/articles/jens/build-pyt" rel="nofollow">http://bluedynamics.com/articles/jens/build-pyt</a>…). And generally anything is hairy or a PITA to compile on OS X, you can Google for “buildout hard-to-build-thing” and someone has usually put together a recipe for building it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: kteague</title>
		<link>http://jessenoller.com/2009/07/17/trapped-in-python-package-send-food/comment-page-1/#comment-96409</link>
		<dc:creator>kteague</dc:creator>
		<pubDate>Sun, 19 Jul 2009 06:00:19 +0000</pubDate>
		<guid isPermaLink="false">http://jessenoller.com/?p=625#comment-96409</guid>
		<description>Twiddling with the shebang, that&#039;s a Distutils thing:&lt;br&gt;&lt;br&gt;&lt;a href=&quot;http://docs.python.org/distutils/setupscript.html#installing-scripts&quot; rel=&quot;nofollow&quot;&gt;http://docs.python.org/distutils/setupscript.ht...&lt;/a&gt;&lt;br&gt;&lt;br&gt;&quot;The only clever feature is that if the first line of the script starts with #! and contains the word “python”, the Distutils will adjust the first line to refer to the current interpreter location.&quot; Heh, one man&#039;s &quot;clever feature&quot; is another man&#039;s headache. The --executable option allows you to override this behaviour though.&lt;br&gt;&lt;br&gt;But the other option is to declare a set of repeatable steps so that you can compile from source on fresh machines. Buildout is the uber-tool for this job! Here&#039;s a decent starter for compiling a Python interpreter using Buildout (&lt;a href=&quot;http://bluedynamics.com/articles/jens/build-python-in-buildout&quot; rel=&quot;nofollow&quot;&gt;http://bluedynamics.com/articles/jens/build-pyt...&lt;/a&gt;). And generally anything is hairy or a PITA to compile on OS X, you can Google for &quot;buildout hard-to-build-thing&quot; and someone has usually put together a recipe for building it.</description>
		<content:encoded><![CDATA[<p>Twiddling with the shebang, that’s a Distutils thing:</p>
<p><a href="http://docs.python.org/distutils/setupscript.html#installing-scripts" rel="nofollow"></a><a href="http://docs.python.org/distutils/setupscript.ht" rel="nofollow">http://docs.python.org/distutils/setupscript.ht</a>…</p>
<p>“The only clever feature is that if the first line of the script starts with #! and contains the word “python”, the Distutils will adjust the first line to refer to the current interpreter location.” Heh, one man’s “clever feature” is another man’s headache. The –executable option allows you to override this behaviour though.</p>
<p>But the other option is to declare a set of repeatable steps so that you can compile from source on fresh machines. Buildout is the uber-tool for this job! Here’s a decent starter for compiling a Python interpreter using Buildout (<a href="http://bluedynamics.com/articles/jens/build-python-in-buildout" rel="nofollow"></a><a href="http://bluedynamics.com/articles/jens/build-pyt" rel="nofollow">http://bluedynamics.com/articles/jens/build-pyt</a>…). And generally anything is hairy or a PITA to compile on OS X, you can Google for “buildout hard-to-build-thing” and someone has usually put together a recipe for building it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Shaun Walbridge</title>
		<link>http://jessenoller.com/2009/07/17/trapped-in-python-package-send-food/comment-page-1/#comment-95370</link>
		<dc:creator>Shaun Walbridge</dc:creator>
		<pubDate>Sat, 18 Jul 2009 17:54:02 +0000</pubDate>
		<guid isPermaLink="false">http://jessenoller.com/?p=625#comment-95370</guid>
		<description>Perhaps I&#039;m missing something, but have you given buildout (&lt;a href=&quot;http://www.buildout.org/&quot; rel=&quot;nofollow&quot;&gt;http://www.buildout.org/&lt;/a&gt;) a shot? It&#039;s used to good effect in the Plone community, where it helps manage complex dependencies including compiled software, and works quite nicely once you&#039;ve learned the basics of creating buildout.cfg files.</description>
		<content:encoded><![CDATA[<p>Perhaps I’m missing something, but have you given buildout (<a href="http://www.buildout.org/" rel="nofollow">http://www.buildout.org/</a>) a shot? It’s used to good effect in the Plone community, where it helps manage complex dependencies including compiled software, and works quite nicely once you’ve learned the basics of creating buildout.cfg files.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jnoller</title>
		<link>http://jessenoller.com/2009/07/17/trapped-in-python-package-send-food/comment-page-1/#comment-95306</link>
		<dc:creator>jnoller</dc:creator>
		<pubDate>Sat, 18 Jul 2009 15:39:30 +0000</pubDate>
		<guid isPermaLink="false">http://jessenoller.com/?p=625#comment-95306</guid>
		<description>I missed that in 370, I thought it only handled the site-packages bit - I&#039;m surprised it handles the bin scripts properly - they should not be installed in /bin. I&#039;ll double check my stuff to check that, and the proper shebang line (cause so far, setuptools/distutils isn&#039;t playing nice like that.</description>
		<content:encoded><![CDATA[<p>I missed that in 370, I thought it only handled the site-packages bit — I’m surprised it handles the bin scripts properly — they should not be installed in /bin. I’ll double check my stuff to check that, and the proper shebang line (cause so far, setuptools/distutils isn’t playing nice like that.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Damjan</title>
		<link>http://jessenoller.com/2009/07/17/trapped-in-python-package-send-food/comment-page-1/#comment-95304</link>
		<dc:creator>Damjan</dc:creator>
		<pubDate>Sat, 18 Jul 2009 15:19:14 +0000</pubDate>
		<guid isPermaLink="false">http://jessenoller.com/?p=625#comment-95304</guid>
		<description>If you  only need to use Python 2.6 (or better) you can use PEP370 instead of virtualenv:&lt;br&gt;&lt;br&gt;all I do is:&lt;br&gt;PYTHONUSERBASE=$HOME/my-python&lt;br&gt;pip.py install --install-option=&quot;--user&quot; PythonPackage&lt;br&gt;&lt;br&gt;There&#039;s no copy of the interpreter, no setuptools required, the shebang is still &quot;#!/usr/bin/python&quot; everything is installed in $HOME/my-python/bin and $HOME/my-python/lib/python2.6/site-packages&lt;br&gt;&lt;br&gt;If I switch to python3(.1) I don&#039;t have to do anything special since my custom packages for 3.1 will be installed in $HOME/my-python/lib/python3.1/site-packages (except that the /bin might be conflicting).</description>
		<content:encoded><![CDATA[<p>If you  only need to use Python 2.6 (or better) you can use PEP370 instead of virtualenv:</p>
<p>all I do is:<br />PYTHONUSERBASE=$HOME/my-python<br />pip.py install –install-option=”–user” PythonPackage</p>
<p>There’s no copy of the interpreter, no setuptools required, the shebang is still “#!/usr/bin/python” everything is installed in $HOME/my-python/bin and $HOME/my-python/lib/python2.6/site-packages</p>
<p>If I switch to python3(.1) I don’t have to do anything special since my custom packages for 3.1 will be installed in $HOME/my-python/lib/python3.1/site-packages (except that the /bin might be conflicting).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Giuseppe</title>
		<link>http://jessenoller.com/2009/07/17/trapped-in-python-package-send-food/comment-page-1/#comment-95260</link>
		<dc:creator>Giuseppe</dc:creator>
		<pubDate>Sat, 18 Jul 2009 13:14:35 +0000</pubDate>
		<guid isPermaLink="false">http://jessenoller.com/?p=625#comment-95260</guid>
		<description>I forgot: boostrapping is also kind of easy using the API. These are the two file I use on a (toy) project I am developing:&lt;br&gt;&lt;br&gt;&lt;a href=&quot;http://pastebin.com/f71e884ba&quot; rel=&quot;nofollow&quot;&gt;http://pastebin.com/f71e884ba&lt;/a&gt; to boostrap a box and install python in it&lt;br&gt;&lt;a href=&quot;http://pastebin.com/fe1f06fa&quot; rel=&quot;nofollow&quot;&gt;http://pastebin.com/fe1f06fa&lt;/a&gt; to install non-python dependencies (python dependencies use a pip requirements file).&lt;br&gt;&lt;br&gt;This is something I&#039;d really like to automate, but I need to figure out some problems before starting to code...</description>
		<content:encoded><![CDATA[<p>I forgot: boostrapping is also kind of easy using the API. These are the two file I use on a (toy) project I am developing:</p>
<p><a href="http://pastebin.com/f71e884ba" rel="nofollow">http://pastebin.com/f71e884ba</a> to boostrap a box and install python in it<br /><a href="http://pastebin.com/fe1f06fa" rel="nofollow">http://pastebin.com/fe1f06fa</a> to install non-python dependencies (python dependencies use a pip requirements file).</p>
<p>This is something I’d really like to automate, but I need to figure out some problems before starting to code…</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Giuseppe</title>
		<link>http://jessenoller.com/2009/07/17/trapped-in-python-package-send-food/comment-page-1/#comment-95259</link>
		<dc:creator>Giuseppe</dc:creator>
		<pubDate>Sat, 18 Jul 2009 13:07:39 +0000</pubDate>
		<guid isPermaLink="false">http://jessenoller.com/?p=625#comment-95259</guid>
		<description>Thanks :)&lt;br&gt;&lt;br&gt;I completely agree about the symlink. Actually if there are better solutions, the code that does that is limited to few lines that are easily changed. However, I could not think of anything better.&lt;br&gt;&lt;br&gt;I mean, on linux there would be FUSE, or some tricks with LD_PRELOAD like fakechroot does. But they would need FUSE/etc to be installed on the guest machine, while it is important for me to have as few dependencies as possible on that side. Besides, Mac compatibility is very important for me :) (I know, mac-fuse and everything, but it is a huge jump in complexity).</description>
		<content:encoded><![CDATA[<p>Thanks :)</p>
<p>I completely agree about the symlink. Actually if there are better solutions, the code that does that is limited to few lines that are easily changed. However, I could not think of anything better.</p>
<p>I mean, on linux there would be FUSE, or some tricks with LD_PRELOAD like fakechroot does. But they would need FUSE/etc to be installed on the guest machine, while it is important for me to have as few dependencies as possible on that side. Besides, Mac compatibility is very important for me :) (I know, mac-fuse and everything, but it is a huge jump in complexity).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jnoller</title>
		<link>http://jessenoller.com/2009/07/17/trapped-in-python-package-send-food/comment-page-1/#comment-95256</link>
		<dc:creator>jnoller</dc:creator>
		<pubDate>Sat, 18 Jul 2009 12:59:00 +0000</pubDate>
		<guid isPermaLink="false">http://jessenoller.com/?p=625#comment-95256</guid>
		<description>I like the way you think ;)&lt;br&gt;&lt;br&gt;Ugh to the hoops you have to jump through to symlink things. That&#039;s gross, I know why, but ugh.</description>
		<content:encoded><![CDATA[<p>I like the way you think ;)</p>
<p>Ugh to the hoops you have to jump through to symlink things. That’s gross, I know why, but ugh.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Giuseppe</title>
		<link>http://jessenoller.com/2009/07/17/trapped-in-python-package-send-food/comment-page-1/#comment-95255</link>
		<dc:creator>Giuseppe</dc:creator>
		<pubDate>Sat, 18 Jul 2009 12:49:48 +0000</pubDate>
		<guid isPermaLink="false">http://jessenoller.com/?p=625#comment-95255</guid>
		<description>Bash is without a doubt the easiest way to do it, but I&#039;d like to try a scons/waf approach instead of a series of check_calls, i.e. abstracting some commands (configure, make, etc...) to python declarations. This could result in more platform independency (maybe it could even support windows.). The new system would not necessarily replace the bash one: bpt is made to support different ways of installing packages inside a box, it just provides a virtual filesystem based on symlinks. &quot;build&quot;, &quot;autobuild&quot;, etc... are just commands implemented on top of it.&lt;br&gt;&lt;br&gt;The &quot;virtual filesystem&quot; /tmp/box_&lt;...&gt; trick works this way: when you run the env script, a symbolic link is created from your current box location to /tmp/box_&lt;...&gt; where &lt;...&gt; is an id unique to the box. So if the box is relocated the link is created to point to the current box directory (actually if you move the box you will have to remove the link by hand. Better safe than sorry). &lt;br&gt;This trick makes python work if it is installed in the box, because /tmp/box_&lt;...&gt;/bin/python will point to the correct binary regardless where you have put your actual box.&lt;br&gt;&lt;br&gt;Thanks for the links about licenses, I&#039;ll have a look ASAP.</description>
		<content:encoded><![CDATA[<p>Bash is without a doubt the easiest way to do it, but I’d like to try a scons/waf approach instead of a series of check_calls, i.e. abstracting some commands (configure, make, etc…) to python declarations. This could result in more platform independency (maybe it could even support windows.). The new system would not necessarily replace the bash one: bpt is made to support different ways of installing packages inside a box, it just provides a virtual filesystem based on symlinks. “build”, “autobuild”, etc… are just commands implemented on top of it.</p>
<p>The “virtual filesystem” /tmp/box_&lt;…&gt; trick works this way: when you run the env script, a symbolic link is created from your current box location to /tmp/box_&lt;…&gt; where &lt;…&gt; is an id unique to the box. So if the box is relocated the link is created to point to the current box directory (actually if you move the box you will have to remove the link by hand. Better safe than sorry). <br />This trick makes python work if it is installed in the box, because /tmp/box_&lt;…&gt;/bin/python will point to the correct binary regardless where you have put your actual box.</p>
<p>Thanks for the links about licenses, I’ll have a look ASAP.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jnoller</title>
		<link>http://jessenoller.com/2009/07/17/trapped-in-python-package-send-food/comment-page-1/#comment-95247</link>
		<dc:creator>jnoller</dc:creator>
		<pubDate>Sat, 18 Jul 2009 12:40:01 +0000</pubDate>
		<guid isPermaLink="false">http://jessenoller.com/?p=625#comment-95247</guid>
		<description>I went the bash script route too, given it&#039;s faster/easier then a series of check_calls from python. As for the boxes being portable - they&#039;re not, because of exactly what you mention - the hardcoded shebang line. If you move a box from /tmp/sandbox_&lt;...&gt;/bin/python to say, /home/jnoller/sandbox_&lt;...&gt;/bin/python - those hardcoded shebangs break. And I agree with compiling python *into* the sandbox, that&#039;s a trick a lot of us use to have many, not-system-wide installs of Python running.&lt;br&gt;&lt;br&gt;I&#039;d have to resurrect my notes (I don&#039;t know what I did with them) on the patching, but things like dependency resolution, virtualenv support and swapping to python scripts comes to mind. &lt;br&gt;&lt;br&gt;As for licenses, that&#039;s really a matter of personal taste. I avoid it, and stick with Apache License 2.0 (compatible with the python software license) for most things. The more permissive licenses don&#039;t invoke additional clauses, meaning I can import bpt in my app, without making my app&#039;s license change (wherein the GPL would force the combined app to be GPL).&lt;br&gt;&lt;br&gt;The licensing thing was part of a debate recently, without digging too much into my own reasons, see:&lt;br&gt;&lt;br&gt;&lt;a href=&quot;http://farmdev.com/thoughts/80/why-you-should-not-license-your-code-as-gpl/&quot; rel=&quot;nofollow&quot;&gt;http://farmdev.com/thoughts/80/why-you-should-n...&lt;/a&gt;&lt;br&gt;&lt;a href=&quot;http://zedshaw.com/blog/2009-07-13.html&quot; rel=&quot;nofollow&quot;&gt;http://zedshaw.com/blog/2009-07-13.html&lt;/a&gt;&lt;br&gt;&lt;a href=&quot;http://www.b-list.org/weblog/2009/jul/14/licensing/&quot; rel=&quot;nofollow&quot;&gt;http://www.b-list.org/weblog/2009/jul/14/licens...&lt;/a&gt;&lt;br&gt;&lt;a href=&quot;http://jacobian.org/writing/gpl-questions/&quot; rel=&quot;nofollow&quot;&gt;http://jacobian.org/writing/gpl-questions/&lt;/a&gt;</description>
		<content:encoded><![CDATA[<p>I went the bash script route too, given it’s faster/easier then a series of check_calls from python. As for the boxes being portable — they’re not, because of exactly what you mention — the hardcoded shebang line. If you move a box from /tmp/sandbox_&lt;…&gt;/bin/python to say, /home/jnoller/sandbox_&lt;…&gt;/bin/python — those hardcoded shebangs break. And I agree with compiling python *into* the sandbox, that’s a trick a lot of us use to have many, not-system-wide installs of Python running.</p>
<p>I’d have to resurrect my notes (I don’t know what I did with them) on the patching, but things like dependency resolution, virtualenv support and swapping to python scripts comes to mind. </p>
<p>As for licenses, that’s really a matter of personal taste. I avoid it, and stick with Apache License 2.0 (compatible with the python software license) for most things. The more permissive licenses don’t invoke additional clauses, meaning I can import bpt in my app, without making my app’s license change (wherein the GPL would force the combined app to be GPL).</p>
<p>The licensing thing was part of a debate recently, without digging too much into my own reasons, see:</p>
<p><a href="http://farmdev.com/thoughts/80/why-you-should-not-license-your-code-as-gpl/" rel="nofollow"></a><a href="http://farmdev.com/thoughts/80/why-you-should-n" rel="nofollow">http://farmdev.com/thoughts/80/why-you-should-n</a>…<br /><a href="http://zedshaw.com/blog/2009-07-13.html" rel="nofollow">http://zedshaw.com/blog/2009–07-13.html</a><br /><a href="http://www.b-list.org/weblog/2009/jul/14/licensing/" rel="nofollow"></a><a href="http://www.b-list.org/weblog/2009/jul/14/licens" rel="nofollow">http://www.b-list.org/weblog/2009/jul/14/licens</a>…<br /><a href="http://jacobian.org/writing/gpl-questions/" rel="nofollow">http://jacobian.org/writing/gpl-questions/</a></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 733/734 objects using disk: basic

Served from: jessenoller.com @ 2012-05-22 08:21:33 -->
