mirror of
https://github.com/almet/notmyidea.git
synced 2025-04-28 19:42:37 +02:00
226 lines
No EOL
9.8 KiB
HTML
226 lines
No EOL
9.8 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<title>first week working on distutils2</title>
|
|
<meta charset="utf-8" />
|
|
<link rel="stylesheet" href="./theme/css/main.css" type="text/css" />
|
|
<link href="./feeds/all.atom.xml" type="application/atom+xml" rel="alternate" title="Alexis' log ATOM Feed" />
|
|
|
|
|
|
<!--[if IE]>
|
|
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script><![endif]-->
|
|
|
|
<!--[if lte IE 7]>
|
|
<link rel="stylesheet" type="text/css" media="all" href="./css/ie.css"/>
|
|
<script src="./js/IE8.js" type="text/javascript"></script><![endif]-->
|
|
|
|
<!--[if lt IE 7]>
|
|
<link rel="stylesheet" type="text/css" media="all" href="./css/ie6.css"/><![endif]-->
|
|
|
|
</head>
|
|
|
|
<body id="index" class="home">
|
|
|
|
<a href="http://github.com/ametaireau/">
|
|
|
|
<img style="position: absolute; top: 0; right: 0; border: 0;" src="http://s3.amazonaws.com/github/ribbons/forkme_right_red_aa0000.png" alt="Fork me on GitHub" />
|
|
|
|
</a>
|
|
|
|
<header id="banner" class="body">
|
|
<h1><a href=".">Alexis' log </a></h1>
|
|
<nav><ul>
|
|
|
|
|
|
|
|
<li><a href="./pages/projects.html">projects</a></li>
|
|
|
|
|
|
|
|
<li ><a href="./category/asso.html">asso</a></li>
|
|
|
|
<li class="active"><a href="./category/dev.html">dev</a></li>
|
|
|
|
<li ><a href="./category/python.html">python</a></li>
|
|
|
|
<li ><a href="./category/system.html">system</a></li>
|
|
|
|
<li ><a href="./category/thoughts.html">thoughts</a></li>
|
|
|
|
</ul></nav>
|
|
</header><!-- /#banner -->
|
|
|
|
<section id="content" class="body">
|
|
<article>
|
|
<header> <h1 class="entry-title"><a href=""
|
|
rel="bookmark" title="Permalink to first week working on distutils2">first week working on distutils2</a></h1> </header>
|
|
<div class="entry-content">
|
|
<footer class="post-info">
|
|
<abbr class="published" title="2010-06-04T00:00:00">
|
|
Fri 04 June 2010
|
|
</abbr>
|
|
|
|
|
|
<address class="vcard author">
|
|
By <a class="url fn" href="./author/Alexis Métaireau.html">Alexis Métaireau</a>
|
|
</address>
|
|
|
|
<p>In <a href="./category/dev.html">dev</a>. </p>
|
|
|
|
|
|
|
|
</footer><!-- /.post-info -->
|
|
<p>As I'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've done so far.</p>
|
|
<p>As my courses are not over yet, I'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
|
|
"simple" API.</p>
|
|
<p>So, I'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' things, as we do not want to depend from
|
|
Distribute'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'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">
|
|
<h2>A PyPI Server mock</h2>
|
|
<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'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>
|
|
</div>
|
|
<div class="section" id="the-pypi-simple-api">
|
|
<h2>The PyPI Simple API</h2>
|
|
<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'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>
|
|
</div>
|
|
<div class="section" id="the-work-to-come">
|
|
<h2>The work to come</h2>
|
|
<p>So, once all use cases covered with tests, I'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've
|
|
<a class="reference external" href="http://github.com/ametaireau/pypiclient">already started here</a>
|
|
I'll take you updated !</p>
|
|
</div>
|
|
|
|
</div><!-- /.entry-content -->
|
|
|
|
<div class="comments">
|
|
<h2>Comments !</h2>
|
|
<div id="disqus_thread"></div>
|
|
<script type="text/javascript">
|
|
var disqus_identifier = "first-week-working-on-distutils2.html";
|
|
(function() {
|
|
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
|
|
dsq.src = 'http://blog-notmyidea.disqus.com/embed.js';
|
|
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
|
|
})();
|
|
</script>
|
|
</div>
|
|
|
|
|
|
</article>
|
|
</section>
|
|
|
|
<section id="extras" class="body">
|
|
|
|
<div class="blogroll">
|
|
<h2>blogroll</h2>
|
|
<ul>
|
|
|
|
<li><a href="http://biologeek.org">Biologeek</a></li>
|
|
|
|
<li><a href="http://filyb.info/">Filyb</a></li>
|
|
|
|
<li><a href="http://www.libert-fr.com">Libert-fr</a></li>
|
|
|
|
<li><a href="http://prendreuncafe.com/blog/">N1k0</a></li>
|
|
|
|
<li><a href="http://ziade.org/blog">Tarek Ziadé</a></li>
|
|
|
|
<li><a href="http://zubin71.wordpress.com/">Zubin Mithra</a></li>
|
|
|
|
</ul>
|
|
</div><!-- /.blogroll -->
|
|
|
|
|
|
<div class="social">
|
|
<h2>social</h2>
|
|
<ul>
|
|
<li><a href="./feeds/all.atom.xml" rel="alternate">atom feed</a></li>
|
|
|
|
|
|
|
|
<li><a href="http://twitter.com/ametaireau">twitter</a></li>
|
|
|
|
<li><a href="http://lastfm.com/user/akounet">lastfm</a></li>
|
|
|
|
<li><a href="http://github.com/ametaireau">github</a></li>
|
|
|
|
</ul>
|
|
</div><!-- /.social -->
|
|
|
|
</section><!-- /#extras -->
|
|
|
|
<footer id="contentinfo" class="body">
|
|
<address id="about" class="vcard body">
|
|
Proudly powered by <a href="http://alexis.notmyidea.org/pelican/">pelican</a>, which takes great advantages of <a href="http://python.org">python</a>.
|
|
</address><!-- /#about -->
|
|
|
|
<p>The theme is by <a href="http://coding.smashingmagazine.com/2009/08/04/designing-a-html-5-layout-from-scratch/">Smashing Magazine</a>, thanks!</p>
|
|
</footer><!-- /#contentinfo -->
|
|
|
|
|
|
|
|
|
|
<script type="text/javascript">
|
|
var disqus_shortname = 'blog-notmyidea';
|
|
(function () {
|
|
var s = document.createElement('script'); s.async = true;
|
|
s.type = 'text/javascript';
|
|
s.src = 'http://' + disqus_shortname + '.disqus.com/count.js';
|
|
(document.getElementsByTagName('HEAD')[0] || document.getElementsByTagName('BODY')[0]).appendChild(s);
|
|
}());
|
|
</script>
|
|
|
|
</body>
|
|
</html> |