<?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>Not My Idea &#187; Python</title>
	<atom:link href="http://www.notmyidea.org/article/category/python/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.notmyidea.org</link>
	<description>Carnets Web d&#039;Alexis Métaireau</description>
	<lastBuildDate>Tue, 20 Jul 2010 10:07:17 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>A distutils2 month &#8212; PyPI simple index ready.</title>
		<link>http://www.notmyidea.org/article/a-distutils2-month-pypi-simple-index-ready/</link>
		<comments>http://www.notmyidea.org/article/a-distutils2-month-pypi-simple-index-ready/#comments</comments>
		<pubDate>Tue, 06 Jul 2010 07:12:00 +0000</pubDate>
		<dc:creator>Alexis Metaireau</dc:creator>
				<category><![CDATA[distutils2]]></category>
		<category><![CDATA[cheeseshop]]></category>
		<category><![CDATA[pypi]]></category>
		<category><![CDATA[simple index]]></category>

		<guid isPermaLink="false">http://www.notmyidea.org/?p=391</guid>
		<description><![CDATA[I&#8217;m working for about a month for distutils2, even if I was being a bit busy (as I had some class courses and exams to work on)
I&#8217;ll try do sum-up my general feelings here, and the work I&#8217;ve made so far. You can also find, if you&#8217;re interested, my weekly summaries in a dedicated wiki [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m working for about a month for distutils2, even if I was being a bit busy (as I had some class courses and exams to work on)</p>
<p>I&#8217;ll try do sum-up my general feelings here, and the work I&#8217;ve made so far. You can also find, if you&#8217;re interested, my weekly summaries in <a class="reference external" href="http://wiki.notmyidea.org/distutils2_schedule">a dedicated wiki page</a>.</p>
<div class="section" id="general-feelings">
<h3 id="toc-general-feelings">General feelings</h3>
<p>First, and it&#8217;s a really important point, the GSoC is going very well, for me as for other students, at least from my perspective. It&#8217;s a pleasure to work with such enthusiast people, as this make the global atmosphere very pleasant to live.</p>
<p>First of all, I&#8217;ve spent time to read the existing codebase, and to understand what we&#8217;re going to do, and what&#8217;s the rationale to do so.</p>
<p>It&#8217;s really clear for me now: what we&#8217;re building is the foundations of a packaging infrastructure in python. The fact is that many projects co-exists, and comes all with their good concepts. Distutils2 tries to take the interesting parts of all, and to provide it in the python standard libs, respecting the recently written PEP about packaging.</p>
<p>With distutils2, it will be simpler to make &quot;things&quot; compatible. So if you think about a new way to deal with distributions and packaging in python, you can use the Distutils2 APIs to do so.</p>
</div>
<div class="section" id="tasks">
<h3 id="toc-tasks">Tasks</h3>
<p>My main task while working on distutils2 is to provide an installation and an un-installation command, as described in PEP 376. For this, I first need to get informations about the existing distributions (what&#8217;s their version, name, metadata, dependencies, etc.)</p>
<p>The main index, you probably know and use, is PyPI. You can access it at <a class="reference external" href="http://pypi.python.org">http://pypi.python.org</a>.</p>
</div>
<div class="section" id="pypi-index-crawling">
<h3 id="toc-pypi-index-crawling">PyPI index crawling</h3>
<p>There is two ways to get these informations from PyPI: using the simple API, or via xml-rpc calls.</p>
<p>A goal was to use the version specifiers defined in<a href="http://www.python.org/dev/peps/pep-0345/"> PEP 345</a> and to provides a way to sort the grabbed distributions depending our needs, to pick the version we want/need.</p>
<div class="section" id="using-the-simple-api">
<h2 id="toc-using-the-simple-api">Using the simple API</h2>
<p>The simple API is composed of HTML pages you can access at <a class="reference external" href="http://pypi.python.org/simple/">http://pypi.python.org/simple/</a>.</p>
<p>Distribute and Setuptools already provides a crawler for that, but it deals with their internal mechanisms, and I found that the code was not so clear as I want, that&#8217;s why I&#8217;ve preferred to pick up the good ideas, and some implementation details, plus re-thinking the global architecture.</p>
<p>The rules are simple: each project have a dedicated page, which allows us to get informations about:</p>
<ul class="simple">
<li>the distribution download locations (for some versions)</li>
<li>homepage links</li>
<li>some other useful informations, as the bugtracker address, for instance.</li>
</ul>
<p>If you want to find all the distributions of the &quot;EggsAndSpam&quot; project, you could do the following (do not take so attention to the names here, as the API will probably change a bit):</p>
<div class="codecolorer-container python notmyidea" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div class="python codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #66cc66;">&gt;&gt;&gt;</span> index = SimpleIndex<span style="color: black;">&#40;</span><span style="color: black;">&#41;</span><br />
<span style="color: #66cc66;">&gt;&gt;&gt;</span> index.<span style="color: black;">find</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;EggsAndSpam&quot;</span><span style="color: black;">&#41;</span><br />
<span style="color: black;">&#91;</span>EggsAndSpam <span style="color: #ff4500;">1.1</span>, EggsAndSpam <span style="color: #ff4500;">1.2</span>, EggsAndSpam <span style="color: #ff4500;">1.3</span><span style="color: black;">&#93;</span></div></div>
<p>We also could use version specifiers:</p>
<div class="codecolorer-container python notmyidea" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div class="python codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #66cc66;">&gt;&gt;&gt;</span> index.<span style="color: black;">find</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;EggsAndSpam (&lt; =1.2)&quot;</span><span style="color: black;">&#41;</span><br />
<span style="color: black;">&#91;</span>EggsAndSpam <span style="color: #ff4500;">1.1</span>, EggsAndSpam <span style="color: #ff4500;">1.2</span><span style="color: black;">&#93;</span></div></div>
<p>Internally, what&#8217;s done here is the following:</p>
<ul class="simple">
<li>it process the <a class="reference external" href="http://pypi.python.org/simple/FooBar/">http://pypi.python.org/simple/FooBar/</a> page, searching for download URLs.</li>
<li>for each found distribution download URL, it creates an object, containing informations about the project name, the version and the URL where the archive remains.</li>
<li>it sort the found distributions, using version numbers. The default<br />
behavior here is to prefer source distributions (over binary ones), and to rely on the last &quot;final&quot; distribution (rather than beta, alpha etc. ones)</li>
</ul>
<p>So, nothing hard or difficult here.</p>
<p>We provides a bunch of other features, like relying on the new <a class="reference external" ref="http://www.python.org/dev/peps/pep-0381/">PyPI mirroring<br />
infrastructure</a> or filter the found distributions by some criterias. If you&#8217;re curious, please browse the <a class="reference external" href="http://distutils2.notmyidea.org/">distutils2 documentation</a>.</p>
<p></code></div>
<div class="section" id="using-xml-rpc">
<h2 id="toc-using-xml-rpc">Using xml-rpc</h2>
<p>We also can make some xmlrpc calls to retreive informations from PyPI. It's a really more reliable way to get informations from from the index (as it's just the index that provides the informations), but cost processes on the PyPI distant server.</p>
<p>For now, this way of querying the xmlrpc client is not available on Distutils2, as I'm working on it. The main pieces are already present (I'll reuse some work I've made from the SimpleIndex querying, and <a class="reference external" href="http://github.com/ametaireau/pypiclient">some code already set up</a>), what I need to do is to provide a xml-rpc PyPI mock server, and that's on what I'm<br />
actually working on.</p>
</div>
</div>
<div class="section" id="processes">
<h3 id="toc-processes">Processes</h3>
<p>For now, I'm trying to follow the &quot;documentation, then test, then code&quot; path, and that seems to be really needed while working with a community. Code is hard to read/understand, compared to documentation, and it's easier to change.</p>
<p>While writing the simple index crawling work, I must have done this to avoid some changes on the API, and some loss of time.</p>
<p>Also, I've set up <a class="reference external" href="http://wiki.notmyidea.org/distutils2_schedule">a schedule</a>, and the goal is to be sure everything will be ready in time, for the end of the summer. (And now, I need to learn to follow schedules ...)</p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.notmyidea.org/article/a-distutils2-month-pypi-simple-index-ready/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>A distutils2 sprint in tours</title>
		<link>http://www.notmyidea.org/article/a-distutils2-sprint-in-tours/</link>
		<comments>http://www.notmyidea.org/article/a-distutils2-sprint-in-tours/#comments</comments>
		<pubDate>Tue, 06 Jul 2010 00:48:41 +0000</pubDate>
		<dc:creator>Alexis Metaireau</dc:creator>
				<category><![CDATA[distutils2]]></category>
		<category><![CDATA[sprint]]></category>

		<guid isPermaLink="false">http://www.notmyidea.org/?p=386</guid>
		<description><![CDATA[
Yesterday, as I was traveling to Tours, I&#8217;ve took some time to visit  Éric, another student who&#8217;s working on distutils2 this summer, as a part of  the GSoC. Basically, it was to take a drink, discuss a bit about distutils2, our  respective tasks and general feelings, and to put a face on [...]]]></description>
			<content:encoded><![CDATA[<div id="a-distutils2-sprint-in-tours">
<p>Yesterday, as I was traveling to Tours, I&#8217;ve took some time to visit  Éric, another student who&#8217;s working on distutils2 this summer, as a part of  the GSoC. Basically, it was to take a drink, discuss a bit about distutils2, our  respective tasks and general feelings, and to put a face on a pseudonym.</p>
<p>I&#8217;d really enjoyed this time, because Éric knows a lot of things  about mercurial and python good practices, and I&#8217;m eager to learn about those.</p>
<p>So, we have discussed about things, have not wrote so much code, but  have some things to propose so far, about documentation, and I also provides here  some bribes of conversations we had.</p>
<div id="documentation">
<h3 id="toc-documentation">Documentation</h3>
<p>While writing the PyPI simple index crawler documentation, I realized  that we miss some structure, or how-to about the documentation. Yep, you read  well. We lack documentation on how to make documentation. Heh.</p>
<p>We&#8217;re missing some rules to follow, and this lead to a  not-so-structured final documentation.</p>
<p>We probably target three type of publics, and we can split the  documentation regarding those:</p>
<ul>
<li><strong>Packagers</strong> who want to distribute their softwares.</li>
<li><strong>End users</strong> who need to understand how to use end  user commands, like the installer/uninstaller</li>
<li><strong>packaging coders</strong> who <em>use</em> distutils2, as a  base for building a package manager.</li>
</ul>
<p>We also need to discuss about a pattern to follow while writing  documentation. How many parts do we need ? Where to put the API description ? etc. That&#8217;s maybe seems to be not so important, but I guess the readers would appreciate to have the same structure all along distutils2  documentation.</p></div>
<div id="mercurial">
<h3 id="toc-mercurial">Mercurial</h3>
<p>I&#8217;m really <em>not</em> a mercurial power user. I use it on daily  basis, but I lack of basic knowledge about it. Big thanks Éric for sharing yours with me,  you&#8217;re of a great help.</p>
<p>We have talked about some mercurial extensions that seems to make the  life simpler, while used the right way. I&#8217;ve not used them so far, so  consider this as a personal note.</p>
<ul>
<li>hg histedit, to edit the history</li>
<li>hg crecord, to select the changes to commit</li>
</ul>
<p>We have spent some time to review a merge I made sunday, to re-merge  it, and commit the changes as a new changeset. Awesome.</p>
<p>These things make me say I <strong>need</strong> to read <a href="http://hgbook.red-bean.com/read/">the hg book</a>,  and will do as soon as I got some spare time: mercurial seems to be simply great.</p>
<p>So &#8230; Great. I&#8217;m a powerful merger now !</p></div>
<div id="on-using-tools">
<h3 id="toc-on-using-tools">On using tools</h3>
<p>Because we <em>also</em> are <em>hackers</em>, we have shared a bit  our ways to code, the tools we use, etc.</p>
<p>Both of us were using vim, and I&#8217;ve discovered vimdiff and hgtk,  which will completely change the way I navigate into the mercurial history.</p>
<p>We aren&#8217;t &laquo;&nbsp;power users&raquo;&nbsp;, so we have learned from each other about vim  tips.</p>
<p>You can find <a href="http://github.com/ametaireau/dotfiles">my dotfiles on github</a>,  if it could help. They&#8217;re not perfect, and not intended to be, because  changing all the time, as I learn. Don&#8217;t hesitate to have a look, and to propose  enhancements if you have !</div>
<div id="on-being-pythonic">
<h3 id="toc-on-being-pythonic">On being pythonic</h3>
<p>My background as an old Java user disserves me so far, as the  paradigms are not the same while coding in python. Hard to find the more pythonic way to do,  and sometimes hard to unlearn my way to think about software engineering.</p>
<p>Well, it seems that the only solution is to read code, and to re-read  <cite>import this</cite> from times to times ! <a href="http://python.net/%7Egoodger/projects/pycon/2007/idiomatic/handout.html">Coding  like a pythonista</a> seems to be a must-read, so, I know what to do.</div>
<div id="conclusion">
<h3 id="toc-conclusion">Conclusion</h3>
<p>It was really great. Next time, we&#8217;ll need to focus a bit more on  distutils2, and to have a bullet list of things to do, but days like this one are  opportunities to catch !</p>
<p>We&#8217;ll probably do another sprint in a few weeks, stay tuned !</p></div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.notmyidea.org/article/a-distutils2-sprint-in-tours/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>GSOC Distutils first report</title>
		<link>http://www.notmyidea.org/article/gsoc-distutils-first-report/</link>
		<comments>http://www.notmyidea.org/article/gsoc-distutils-first-report/#comments</comments>
		<pubDate>Fri, 04 Jun 2010 10:27:33 +0000</pubDate>
		<dc:creator>Alexis Metaireau</dc:creator>
				<category><![CDATA[distutils2]]></category>
		<category><![CDATA[GSOC]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://www.notmyidea.org/?p=369</guid>
		<description><![CDATA[As I&#8217;ve been working on Distutils2 during the past week, taking part of the GSOC program, here is a short summary of what I&#8217;ve done so far.
As my courses are not over yet, I&#8217;ve not worked as much as I wanted, and this will continues until the end of June. My main tasks are about [...]]]></description>
			<content:encoded><![CDATA[<p>As I&#8217;ve been working on <a class="reference external" href="http://hg.python.org/distutils2/">Distutils2</a> during the past week, taking part of the <a class="reference external" href="http://code.google.com/intl/fr/soc/">GSOC</a> program, here is a short summary of what I&#8217;ve done so far.</p>
<p>As my courses are not over yet, I&#8217;ve not worked as much as I wanted, and this will continues until the end of June. My main tasks are about making installation and uninstallation commands, to have a simple way to install distributions via <a class="reference external" href="http://hg.python.org/distutils2/">Distutils2</a>.</p>
<p>To do this, we need to rely on informations provided by the Python Package Index (<a class="reference external" href="http://pypi.python.org/">PyPI</a>), and there is at least two ways to retreive informations from here: XML-RPC and the &quot;simple&quot; API.</p>
<p>So, I&#8217;ve been working on porting some <a class="reference external" href="http://bitbucket.org/tarek/distribute/">Distribute</a> related stuff to <a class="reference external" href="http://hg.python.org/distutils2/">Distutils2</a>, cutting off all non distutils&#8217; things, as we do not want to depend from Distribute&#8217;s internals. My main work has been about reading the whole code, writing tests about this and making those tests possible.</p>
<p>In fact, there was a need of a pypi mocked server, and, after reading and introducing myself to the distutils behaviors and code, I&#8217;ve taken some time to improve the work <a class="reference external" href="http://bitbucket.org/konrad">Konrad</a> makes about this mock.</p>
<div class="section" id="a-pypi-server-mock">
<h3 id="toc-a-pypi-server-mock">A PyPI Server mock</h3>
<p>The mock is embeded in a thread, to make it available during the tests, in a non blocking way. We first used <a class="reference external" href="http://wsgi.org">WSGI</a> and <a class="reference external" href="http://docs.python.org/library/wsgiref.html">wsgiref</a> in order control what to serve, and to log the requests made to the server, but finally realised that <a class="reference external" href="http://docs.python.org/library/wsgiref.html">wsgiref</a> is not python 2.4 compatible (and we <em>need</em> to be python 2.4 compatible in Distutils2).</p>
<p>So, we switched to <a class="reference external" href="http://docs.python.org/library/basehttpserver.html">BaseHTTPServer</a> and <a class="reference external" href="http://docs.python.org/library/simplehttpserver.html">SimpleHTTPServer</a>, and updated our tests accordingly. It&#8217;s been an opportunity to realize that <a class="reference external" href="http://wsgi.org">WSGI</a> has been a great step forward for making HTTP servers, and expose a really simplest way to discuss with HTTP !</p>
<p>You can find <a class="reference external" href="http://bitbucket.org/ametaireau/distutils2/changesets">the modifications I made</a>, and the <a class="reference external" href="http://bitbucket.org/ametaireau/distutils2/src/tip/docs/source/test_framework.rst">related docs</a> about this on <a class="reference external" href="http://bitbucket.org/ametaireau/distutils2/">my bitbucket distutils2 clone</a>.</p>
<h3 id="toc-the-pypi-simple-api">The PyPI Simple API</h3>
<p>So, back to the main problematic: make a python library to access and request information stored on PyPI, via the simple API. As I said, I&#8217;ve just grabbed the work made from <a class="reference external" href="http://bitbucket.org/tarek/distribute/">Distribute</a>, and played a bit with, in order to view what are the different use cases, and started to write the related tests.</p>
<h3 id="toc-the-work-to-come">The work to come</h3>
<p>So, once all use cases covered with tests, I&#8217;ll rewrite a bit the grabbed code, and do some software design work (to not expose all things as privates methods, have a clear API, and other things like this), then update the tests accordingly and write a documentation to make this clear.</p>
<p>Next step is to a little client, as I&#8217;ve <a class="reference external" href="http://github.com/ametaireau/pypiclient">already started here</a> I&#8217;ll take you updated !</p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.notmyidea.org/article/gsoc-distutils-first-report/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A Distutils2 GSOC</title>
		<link>http://www.notmyidea.org/article/a-distutils2-gsoc/</link>
		<comments>http://www.notmyidea.org/article/a-distutils2-gsoc/#comments</comments>
		<pubDate>Sat, 01 May 2010 14:33:01 +0000</pubDate>
		<dc:creator>Alexis Metaireau</dc:creator>
				<category><![CDATA[distutils2]]></category>
		<category><![CDATA[GSOC]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://www.notmyidea.org/?p=352</guid>
		<description><![CDATA[WOW.
I&#8217;ve been accepted to be a part of the Google Summer Of Code program, and will work on python distutils2, with a lot of (intersting!) people.
So, it&#8217;s about building the successor of Distutils2, ie. &#171;&#160;the python package manager&#187;&#160;. Today, there is too many ways to package a python application (pip, setuptools, distribute, distutils, etc.) so there is [...]]]></description>
			<content:encoded><![CDATA[<p>WOW.</p>
<p>I&#8217;ve been accepted to be a part of the <a href="http://code.google.com/intl/fr/soc/">Google Summer Of Code</a> program, and will work on <a href="http://python.org/">python</a> <a href="http://hg.python.org/distutils2/">distutils2</a>, with <a href="http://pygsoc.wordpress.com/">a</a> <a href="http://konryd.blogspot.com/">lot</a> <a href="http://ziade.org/">of</a> (intersting!) <a href="http://zubin71.wordpress.com/">people</a>.</p>
<blockquote><p>So, it&#8217;s about building the successor of Distutils2, ie. &laquo;&nbsp;the python package manager&raquo;&nbsp;. Today, there is too many ways to package a python application (pip, setuptools, distribute, distutils, etc.) so there is a huge effort to make in order to make all this packaging stuff interoperable, as pointed out by the <a href="http://www.python.org/dev/peps/pep-0376/">PEP 376</a>.</p></blockquote>
<p><img src="http://www.notmyidea.org/wp-content/uploads/2010/05/state_of_packaging-300x171.jpg" alt="The current state of packaging" title="The current state of packaging" width="300" height="171" class="size-medium wp-image-355" /></p>
<p>In more details, I&#8217;m going to work on the Installer / Uninstaller features of Distutils2, and on a PyPI XML-RPC client for distutils2. </p>
<p>Here are the already defined tasks:</p>
<ul>
<li>Implement Distutils2 APIs described in PEP 376.</li>
<li>Add the uninstall command.</li>
<li>think about a basic installer / uninstaller script. (with deps) &#8212; similar to pip/easy_install</li>
<li>in a pypi subpackage;</li>
<li>Integrate a module similar to setuptools&#8217; package_index&#8217;</li>
<li>PyPI XML-RPC client for distutils 2: http://bugs.python.org/issue8190</li>
</ul>
<p>As I&#8217;m relatively new to python, I&#8217;ll need some extra work in order to apply all good practice, among other things that can make a developper-life joyful.</p>
<p>I&#8217;ll post here, each week, my advancement, and my tought about python and especialy python packaging world.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.notmyidea.org/article/a-distutils2-gsoc/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Python, go !</title>
		<link>http://www.notmyidea.org/article/python-go/</link>
		<comments>http://www.notmyidea.org/article/python-go/#comments</comments>
		<pubDate>Thu, 17 Dec 2009 13:07:33 +0000</pubDate>
		<dc:creator>Alexis Metaireau</dc:creator>
				<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://www.notmyidea.org/?p=302</guid>
		<description><![CDATA[Cela fait maintenant un peu plus d&#8217;un mois que je travaille sur un projet en django, et que, nécessairement, je me forme à Python.
Je prends un plaisir non dissimulé à découvrir ce langage (et à l&#8217;utiliser), qui ne cesse de me surprendre.  Les premiers mots qui me viennent à l&#8217;esprit à propos de Python, [...]]]></description>
			<content:encoded><![CDATA[<p>Cela fait maintenant un peu plus d&#8217;un mois que je travaille sur un projet en <a href="http://www.djangoproject.org">django</a>, et que, nécessairement, je me forme à <a href="http://python.org/">Python</a>.</p>
<p>Je prends un plaisir non dissimulé à découvrir ce langage (et à l&#8217;utiliser), qui ne cesse de me surprendre.  Les premiers mots qui me viennent à l&#8217;esprit à propos de Python, sont &laquo;&nbsp;logique&raquo;&nbsp; et &laquo;&nbsp;simple&raquo;&nbsp;. Et pourtant puissant pour autant.</p>
<p>Je ne manque d&#8217;ailleurs pas une occasion pour faire un peu d&#8217;<em>évangélisation</em> auprès des quelques personnes qui veulent bien m&#8217;écouter.</p>
<h3 id="toc-the-zen-of-python">The Zen of Python</h3>
<p>Avant toute autre chose, je pense utile de citer Tim Peters, et <a href="http://www.python.org/dev/peps/pep-0020/">le PEP20</a>, qui constituent une très bonne introduction au langage, qui prends la forme d&#8217;un <em>easter egg</em> présent dans python:</p>
<div class="codecolorer-container python notmyidea" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;height:420px;"><div class="python codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #66cc66;">&gt;&gt;&gt;</span> <span style="color: #ff7700;font-weight:bold;">import</span> this<br />
The Zen of Python, by Tim Peters<br />
<br />
Beautiful <span style="color: #ff7700;font-weight:bold;">is</span> better than ugly.<br />
<span style="color: black;">Explicit</span> <span style="color: #ff7700;font-weight:bold;">is</span> better than implicit.<br />
<span style="color: black;">Simple</span> <span style="color: #ff7700;font-weight:bold;">is</span> better than <span style="color: #008000;">complex</span>.<br />
<span style="color: black;">Complex</span> <span style="color: #ff7700;font-weight:bold;">is</span> better than complicated.<br />
<span style="color: black;">Flat</span> <span style="color: #ff7700;font-weight:bold;">is</span> better than nested.<br />
<span style="color: black;">Sparse</span> <span style="color: #ff7700;font-weight:bold;">is</span> better than dense.<br />
<span style="color: black;">Readability</span> counts.<br />
<span style="color: black;">Special</span> cases aren<span style="color: #483d8b;">'t special enough to break the rules.<br />
Although practicality beats purity.<br />
Errors should never pass silently.<br />
Unless explicitly silenced.<br />
In the face of ambiguity, refuse the temptation to guess.<br />
There should be one-- and preferably only one --obvious way to do it.<br />
Although that way may not be obvious at first unless you'</span><span style="color: #dc143c;">re</span> Dutch.<br />
<span style="color: black;">Now</span> <span style="color: #ff7700;font-weight:bold;">is</span> better than never.<br />
<span style="color: black;">Although</span> never <span style="color: #ff7700;font-weight:bold;">is</span> often better than <span style="color: #66cc66;">*</span>right<span style="color: #66cc66;">*</span> now.<br />
<span style="color: black;">If</span> the implementation <span style="color: #ff7700;font-weight:bold;">is</span> hard to explain, it<span style="color: #483d8b;">'s a bad idea.<br />
If the implementation is easy to explain, it may be a good idea.<br />
Namespaces are one honking great idea -- let'</span>s do more of those<span style="color: #66cc66;">!</span></div></div>
<p>J&#8217;ai la vague impression que c&#8217;est ce que j&#8217;ai toujours cherché à faire en PHP, et particulièrement dans <a href="http://www.spiral-project.org">le framework Spiral</a>, mais en ajoutant ces concepts dans une sur-couche au langage.</p>
<p>Ici, c&#8217;est directement de <em>l&#8217;esprit</em> de python qu&#8217;il s&#8217;agit, ce qui signifie que la plupart des bibliothèques python suivent ces concepts. Elle est pas belle la vie ?</p>
<h3 id="toc-comment-commencer-et-par-ou">Comment commencer, et par ou ?</h3>
<p>Pour ma part, j&#8217;ai commencé par la lecture de quelques livres et articles intéressants, qui constituent une bonne entrée en matière sur le sujet (La liste n&#8217;est bien évidemment pas exhaustive et vos commentaires sont les bienvenus) :</p>
<ul>
<li><a href="http://diveintopython.adrahon.org/">Dive into python</a></li>
<li><a href="http://www.swaroopch.com/notes/Python_fr:Table_des_Mati%C3%A8res">A byte of python</a></li>
<li><a href="http://www.amazon.fr/Python-Petit-guide-lusage-d%C3%A9veloppeur/dp/2100508830">Python: petit guide à l&#8217;usage du développeur agile</a> de <a href="http://tarekziade.wordpress.com/">Tarek Ziadé</a></li>
<li><a href="http://docs.python.org/index.html">La documentation officielle python</a>, bien sûr !</li>
<li><a href="http://video.pycon.fr/videos/pycon-fr-2009/">Les vidéos du pyconfr 2009 </a>!</li>
<li>Un peu de temps, et une console python ouverte <img src='http://www.notmyidea.org/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </li>
</ul>
<p>J&#8217;essaye par ailleurs de partager au maximum les ressources que je trouve de temps à autres, que ce soit <a href="http://www.twitter.com/ametaireau">via twitter</a> ou <a href="http://delicious.com/ametaireau">via mon compte delicious</a>. Allez jeter un œil <a href="http://delicious.com/ametaireau/python">au tag python</a> sur mon profil, peut être que vous trouverez des choses intéressantes, qui sait!</p>
<h3 id="toc-un-python-sexy">Un python sexy</h3>
<p>Quelques fonctionnalités qui devraient vous mettre l&#8217;eau à la bouche:</p>
<ul>
<li><a href="http://docs.python.org/library/stdtypes.html#comparisons">Le chaînage des opérateurs de comparaison</a> est possible (a&lt;b &lt;c dans une condition)</li>
<li>Assignation de valeurs multiples (il est possible de faire a,b,c = 1,2,3 par exemple)</li>
<li><a href="http://docs.python.org/tutorial/datastructures.html">Les listes</a> sont simples à manipuler ! </li>
<li>Les<a href="http://docs.python.org/tutorial/datastructures.html#list-comprehensions"> list comprehension</a>, ou comment faire des opérations complexes sur les listes, de manière simple.</li>
<li>Les <a href="http://docs.python.org/library/doctest.html?highlight=doctest">doctests</a>: ou comment faire des tests directement dans la documentation de vos classes, tout en la documentant avec de vrais exemples.</li>
<li>Les <a href="http://www.python.org/doc/essays/metaclasses/meta-vladimir.txt">métaclasses</a>, ou comment contrôler la manière dont les classes se construisent</li>
<li>Python est <a href="http://wiki.python.org/moin/Why%20is%20Python%20a%20dynamic%20language%20and%20also%20a%20strongly%20typed%20language">un langage à typage fort dynamique</a>: c&#8217;est ce qui m&#8217;agaçait avec PHP qui est un langage à typage faible dynamique. </li>
</ul>
<p>Cous pouvez également aller regarder <a href="http://video.pycon.fr/videos/free/53/">l&#8217;atelier donné par Victor Stinner durant le Pyconfr 09</a>.</p>
<p>Have fun !</p>
]]></content:encoded>
			<wfw:commentRss>http://www.notmyidea.org/article/python-go/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Retours sur le scrumpy montpellier</title>
		<link>http://www.notmyidea.org/article/retours-sur-le-scrumpy-montpellier/</link>
		<comments>http://www.notmyidea.org/article/retours-sur-le-scrumpy-montpellier/#comments</comments>
		<pubDate>Tue, 27 Oct 2009 18:10:00 +0000</pubDate>
		<dc:creator>Alexis Metaireau</dc:creator>
				<category><![CDATA[Python]]></category>
		<category><![CDATA[agilité]]></category>
		<category><![CDATA[django]]></category>
		<category><![CDATA[scrum]]></category>

		<guid isPermaLink="false">http://www.notmyidea.org/?p=262</guid>
		<description><![CDATA[Vendredi dernier, j&#8217;ai pu assister à la conférence scrumpy organisée par le collectif particules, sur python et l&#8217;agilité. Ce fut l&#8217;occasion d&#8217;en apprendre un peu plus sur python, django et scrum grâce à David Larlet et Claude Aubry.
Scrum / Agilité
Concept assez récent pour moi puisque j&#8217;ai découvert ce qu&#8217;était l&#8217;agilité lors du passage de l&#8217;agile [...]]]></description>
			<content:encoded><![CDATA[<p>Vendredi dernier, j&#8217;ai pu assister à la conférence <a href="http://scrumpy.particul.es/">scrumpy</a> organisée par <a href="http://particul.es/">le collectif particules</a>, sur python et l&#8217;agilité. Ce fut l&#8217;occasion d&#8217;en apprendre un peu plus sur <a href="http://www.python.org/">python</a>, <a href="http://www.django-fr.org/">django</a> et <a href="http://fr.wikipedia.org/wiki/Scrum">scrum</a> grâce à <a href="http://larlet.fr/">David Larlet</a> et <a href="http://www.aubryconseil.com/">Claude Aubry</a>.</p>
<h3 id="toc-scrum-agilite">Scrum / Agilité</h3>
<p>Concept assez récent pour moi puisque j&#8217;ai découvert ce qu&#8217;était l&#8217;agilité lors du passage de <a href="http://www.agiletour.org/">l&#8217;agile tour</a> sur Toulouse. La présentation de Claude à eu le mérite de reprendre l&#8217;ensemble des concepts et de poser les bases d&#8217;une nouvelle manière de gérer les projets. Rien de bien sorcier à priori, mais l&#8217;agilité remets grandement en question les préceptes appris en cours, notamment durant le BTS ou nous croulions littéralement sous la documentation (inutile?), et ou le temps nous venait fréquemment à manquer. </p>
<p>Après cette présentation, il semble difficile de revenir à des méthodes de gestion de projet <em>standard</em>. On comprends mieux pourquoi l&#8217;agilité à le vent en poupe !</p>
<p>Il me tarde réellement de voir en action ce que ça peut donner, et j&#8217;en aurais d&#8217;ailleurs l&#8217;occasion puisque mon stage commence la semaine prochaine, et m&#8217;apportera &#8212; à priori en tout cas &#8212; des exemples concrets de ce que peut apporter l&#8217;agilité en entreprise, au niveau de la gestion d&#8217;équipe.</p>
<h3 id="toc-python-django">Python / Django</h3>
<p>Une rapide présentation de python, puis une entrée en matière par David sur Django. On y parles de bonnes pratiques, de gain de temps et d&#8217;élégance, puis on passe à la réalisation d&#8217;une mini application (un twitter like). Ayant déjà eu l&#8217;occasion de toucher un peu à Django, je m&#8217;attendais à une présentation un peu plus technique, mais difficile d&#8217;aller en profondeur en si peu de temps. On à pu parler entres autres d&#8217;internationalisation, de templates, de la mise en place d&#8217;un modèle ainsi qu&#8217;un bref aperçu de l&#8217;administration auto-générée de Django. Suffisamment en tout cas pour mettre l&#8217;eau à la bouche. On sent que David maitrise son sujet et ça donne envie de creuser plus loin.</p>
<h3 id="toc-dans-lensemble">Dans l&#8217;ensemble</h3>
<p>Présenter la méthodologie agile et django lors du même après-midi nous à permis de parler à la fois de gestion de projet et de choix technologiques. Les deux points ont malheureusement été abordés sans véritable liant, puisque il y a eu peu d&#8217;interaction entre les deux intervenants. Difficile alors de se rentre compte si Django est adapté aux méthodes agiles (même si on s&#8217;en doute un peu).</p>
<p>Globalement, j&#8217;ai beaucoup apprécie les interventions, même si j&#8217;aurais bien aimé pourvoir rester discuter un peu plus en fin d&#8217;après-midi. Ce fut l&#8217;occasion de rencontrer en chair et en os et d&#8217;échanger (un peu) avec David, <a href="http://prendreuncafe.com/">Nicolas</a> et <a href="http://bballizlife.com/blog/">Loïc</a>. Çà fait du bien de mettre un visage derrière des pseudonymes!</p>
<p>Enfin, merci au collectif particul.es, et en particulier à <a href="http://www.insei.org/site/">Stephane Langlois</a> d&#8217;avoir organisé cet évènement. On en reprendrait volontiers, surtout dans un cadre pareil !</p>
]]></content:encoded>
			<wfw:commentRss>http://www.notmyidea.org/article/retours-sur-le-scrumpy-montpellier/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
