blog.notmyidea.org/an-amazing-summer-of-code-working-on-distutils2.html

163 lines
No EOL
9.4 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<title>An amazing summer of code working on&nbsp;distutils2 - Alexis Métaireau</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://blog.notmyidea.org/theme/css/main.css?v2" type="text/css" />
<link href="https://blog.notmyidea.org/feeds/all.atom.xml" type="application/atom+xml" rel="alternate"
title="Alexis Métaireau ATOM Feed" />
</head>
<body>
<div id="content">
<section id="links">
<ul>
<li><a class="main" href="/">Alexis Métaireau</a></li>
<li><a class=""
href="https://blog.notmyidea.org/journal/index.html">Journal</a></li>
<li><a class="selected"
href="https://blog.notmyidea.org/code/">Code, etc.</a></li>
<li><a class=""
href="https://blog.notmyidea.org/weeknotes/">Notes hebdo</a></li>
<li><a class=""
href="https://blog.notmyidea.org/lectures/">Lectures</a></li>
</ul>
</section>
<header>
<h1 class="post-title">An amazing summer of code working on&nbsp;distutils2</h1>
<time datetime="2010-08-16T00:00:00+02:00">16 août 2010</time>
</header>
<article>
<p>The <a href="http://code.google.com/soc/">Google Summer of Code</a> I&#8217;ve spent
working on <a href="http://hg.python.org/distutils2/">distutils2</a> is over. It
was a really amazing experience, for many&nbsp;reasons.</p>
<p>First of all, we had a very good team, we were 5 students working on
distutils2: <a href="http://zubin71.wordpress.com">Zubin</a>,
<a href="http://wokslog.wordpress.com/">Éric</a>,
<a href="http://gsoc.djolonga.com/">Josip</a>,
<a href="http://konryd.blogspot.com/">Konrad</a> and me. In addition,
<a href="http://mouadino.blogspot.com/">Mouad</a> have worked on the PyPI testing
infrastructure. You could find what each person have done on <a href="http://bitbucket.org/tarek/distutils2/wiki/GSoC_2010_teams">the wiki
page of
distutils2</a>.</p>
<p>We were in contact with each others really often, helping us when
possible (in #distutils), and were continuously aware of the state of
the work of each participant. This, in my opinion, have bring us in a
good&nbsp;shape.</p>
<p>Then, I&#8217;ve learned a lot. Python packaging was completely new to me at
the time of the GSoC start, and I was pretty unfamiliar with python good
practices too, as I&#8217;ve been introducing myself to python in the late&nbsp;2009.</p>
<p>I&#8217;ve recently looked at some python code I wrote just three months ago,
and I was amazed to think about many improvements to made on it. I guess
this is a good indicator of the path I&#8217;ve traveled since I wrote&nbsp;it.</p>
<p>This summer was awesome because I&#8217;ve learned about python good
practices, now having some strong
<a href="http://mercurial.selenic.com/">mercurial</a> knowledge, and I&#8217;ve seen a
little how the python community&nbsp;works.</p>
<p>Then, I would like to say a big thanks to all the mentors that have
hanged around while needed, on <span class="caps">IRC</span> or via mail, and especially my mentor
for this summer, <a href="http://tarek.ziade.org">Tarek Ziadé</a>.</p>
<p>Thanks a lot for your motivation, your leadership and your cheerfulness,
even with a new-born and a new&nbsp;work!</p>
<h2 id="why">Why&nbsp;?</h2>
<p>I wanted to work on python packaging because, as the time pass, we were
having a sort of complex tools in this field. Each one wanted to add
features to distutils, but not in a standard&nbsp;way.</p>
<p>Now, we have PEPs that describes some format we agreed on (see <span class="caps">PEP</span> 345),
and we wanted to have a tool on which users can base their code on,
that&#8217;s <a href="http://hg.python.org/distutils2/">distutils2</a>.</p>
<h2 id="my-job">My&nbsp;job</h2>
<p>I had to provide a way to crawl the PyPI indexes in a simple way, and do
some installation / uninstallation&nbsp;scripts.</p>
<p>All the work done is available in <a href="http://bitbucket.org/ametaireau/distutils2/">my bitbucket
repository</a>.</p>
<h3 id="crawling-the-pypi-indexes">Crawling the PyPI&nbsp;indexes</h3>
<p>There are two ways of requesting informations from the indexes: using
the &#8220;simple&#8221; index, that is a kind of <span class="caps">REST</span> index, and using <span class="caps">XML</span>-<span class="caps">RPC</span>.</p>
<p>I&#8217;ve done the two implementations, and a high level <span class="caps">API</span> to query those
twos. Basically, this supports the mirroring infrastructure defined in
<span class="caps">PEP</span> 381. So far, the work I&#8217;ve done is gonna be used in pip (they&#8217;ve
basically copy/paste the code, but this will change as soon as we get
something completely stable for distutils2), and that&#8217;s a good news, as
it was the main reason for what I&#8217;ve done&nbsp;that.</p>
<p>I&#8217;ve tried to have an unified <span class="caps">API</span> for the clients, to switch from one to
another implementation easily. I&#8217;m already thinking of adding others
crawlers to this stuff, and it was made to be&nbsp;extensible.</p>
<p>If you want to get more informations about the crawlers/PyPI clients,
please refer to the distutils2 documentation, especially <a href="http://distutils2.notmyidea.org/library/distutils2.index.html">the pages
about
indexes</a>.</p>
<p>You can find the changes I made about this in the
<a href="http://hg.python.org/distutils2/">distutils2</a> source code&nbsp;.</p>
<h3 id="installation-uninstallation-scripts">Installation / Uninstallation&nbsp;scripts</h3>
<p>Next step was to think about an installation script, and an uninstaller.
I&#8217;ve not done the uninstaller part, and it&#8217;s a smart part, as it&#8217;s
basically removing some files from the system, so I&#8217;ll probably do it in
a near&nbsp;future.</p>
<p><a href="http://hg.python.org/distutils2/">distutils2</a> provides a way to install
distributions, and to handle dependencies between releases. For now,
this support is only about the last version of the <span class="caps">METADATA</span> (1.2) (See,
the <span class="caps">PEP</span> 345), but I&#8217;m working on a compatibility layer for the old
metadata, and for the informations provided via <span class="caps">PIP</span> requires.txt, for&nbsp;instance.</p>
<h3 id="extra-work">Extra&nbsp;work</h3>
<p>Also, I&#8217;ve done some extra work. this&nbsp;includes:</p>
<ul>
<li>working on the <span class="caps">PEP</span> 345, and having some discussion about it (about
the names of some&nbsp;fields).</li>
<li>writing a PyPI server mock, useful for tests. you can find more
information about it on the
<a href="http://distutils.notmyidea.org">documentation</a>.</li>
</ul>
<h2 id="futures-plans">Futures&nbsp;plans</h2>
<p>As I said, I&#8217;ve enjoyed working on distutils2, and the people I&#8217;ve met
here are really pleasant to work with. So I <em>want</em> to continue
contributing on python, and especially on python packaging, because
there is still a lot of things to do in this scope, to get something
really&nbsp;usable.</p>
<p>I&#8217;m not plainly satisfied by the work I&#8217;ve done, so I&#8217;ll probably tweak
it a bit: the installer part is not yet completely finished, and I want
to add support for a real
<a href="http://en.wikipedia.org/wiki/Representational_State_Transfer"><span class="caps">REST</span></a>
index in the&nbsp;future.</p>
<p>We&#8217;ll talk again of this in the next months, probably, but we definitely
need a real
<a href="http://en.wikipedia.org/wiki/Representational_State_Transfer"><span class="caps">REST</span></a> <span class="caps">API</span>
for <a href="http://pypi.python.org">PyPI</a>, as the &#8220;simple&#8221; index <em>is</em> an ugly
hack, in my opinion. I&#8217;ll work on a serious proposition about this,
maybe involving <a href="http://couchdb.org">CouchDB</a>, as it seems to be a good
option for what we want&nbsp;here.</p>
<h2 id="issues">Issues</h2>
<p>I&#8217;ve encountered some issues during this summer. The main one is that&#8217;s
hard to work remotely, especially being in the same room that we live,
with others. I like to just think about a project with other people, a
paper and a pencil, no computers. This have been not so possible at the
start of the project, as I needed to read a lot of code to understand
the codebase, and then to read/write&nbsp;emails.</p>
<p>I&#8217;ve finally managed to work in an office, so good point for home/office&nbsp;separation.</p>
<p>I&#8217;d not planned there will be so a high number of emails to read, in
order to follow what&#8217;s up in the python world, and be a part of the
community seems to takes some times to read/write emails, especially for
those (like me) that arent so confortable with english (but this had
brought me some english fu&nbsp;!).</p>
<h2 id="thanks">Thanks&nbsp;!</h2>
<p>A big thanks to <a href="http://www.graine-libre.fr/">Graine Libre</a> and <a href="http://www.makina-corpus.com/">Makina
Corpus</a>, which has offered me to come
into their offices from time to time, to share they cheerfulness ! Many
thanks too to the Google Summer of Code program for setting up such an
initiative. If you&#8217;re a student, if you&#8217;re interested about <span class="caps">FOSS</span>, dont
hesitate any second, it&#8217;s a really good opportunity to work on
interesting&nbsp;projects!</p>
</article>
<footer>
<a id="feed" href="/feeds/all.atom.xml"><img src="/theme/rss.svg" /></a>
</footer>
</div>
</body>
</html>