Not My Idea

Carnets Web d'Alexis Métaireau

Archive for the ‘Python’ tag

GSOC Distutils first report

leave a comment

As I’ve been working on Distutils2 during the past week, taking part of the GSOC program, here is a short summary of what I’ve done so far.

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 Distutils2.

To do this, we need to rely on informations provided by the Python Package Index (PyPI), and there is at least two ways to retreive informations from here: XML-RPC and the "simple" API.

So, I’ve been working on porting some Distribute related stuff to Distutils2, 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.

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 Konrad makes about this mock.

A PyPI Server mock

The mock is embeded in a thread, to make it available during the tests, in a non blocking way. We first used WSGI and wsgiref in order control what to serve, and to log the requests made to the server, but finally realised that wsgiref is not python 2.4 compatible (and we need to be python 2.4 compatible in Distutils2).

So, we switched to BaseHTTPServer and SimpleHTTPServer, and updated our tests accordingly. It’s been an opportunity to realize that WSGI has been a great step forward for making HTTP servers, and expose a really simplest way to discuss with HTTP !

You can find the modifications I made, and the related docs about this on my bitbucket distutils2 clone.

The PyPI Simple API

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 Distribute, and played a bit with, in order to view what are the different use cases, and started to write the related tests.

The work to come

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.

Next step is to a little client, as I’ve already started here I’ll take you updated !

Written by Alexis Metaireau

juin 4th, 2010 at 12:27

Posted in distutils2

Tagged with , ,

A Distutils2 GSOC

one comment

WOW.

I’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’s about building the successor of Distutils2, ie. « the python package manager» . 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 PEP 376.

The current state of packaging

In more details, I’m going to work on the Installer / Uninstaller features of Distutils2, and on a PyPI XML-RPC client for distutils2.

Here are the already defined tasks:

  • Implement Distutils2 APIs described in PEP 376.
  • Add the uninstall command.
  • think about a basic installer / uninstaller script. (with deps) — similar to pip/easy_install
  • in a pypi subpackage;
  • Integrate a module similar to setuptools’ package_index’
  • PyPI XML-RPC client for distutils 2: http://bugs.python.org/issue8190

As I’m relatively new to python, I’ll need some extra work in order to apply all good practice, among other things that can make a developper-life joyful.

I’ll post here, each week, my advancement, and my tought about python and especialy python packaging world.

Written by Alexis Metaireau

mai 1st, 2010 at 4:33

Posted in distutils2

Tagged with , ,

Et c’est reparti pour un tour!

leave a comment

Un petit billet plein de bonnes nouvelles !

Ce blog

Un « sous blog»  consacrée aux différentes astuces, compilations, partage de connaissances, via des billets courts, la partie « snippets»  fait son apparition. J’y publie bien plus souvent des mini articles sur des trucs que je rencontre au jour le jour. Allez y jeter un oeil, et pourquoi pas, mettez le dans vos lecteurs de flux ;)

Quand à ce blog , il continuera de décrire l’ensemble des évolutions des divers projets auquel je participe, qu’ils soient ou non liés au monde logiciel, ponctué par quelques articles techniques que j’ai sous le coude.

Spiral

Depuis la publication de l’injecteur de dépendances de Spiral, nous avons travaillé durant une petite semaine à plein temps sur spiral, sur des thématiques telle que le système de packages, ou le modèle de persistance des données. Puis on à recentré nos efforts sur la mise en place d’un environnement de tests digne de ce nom. J’en ai profité pour faire pour la première fois, du *vrai* TDD !

Spiral continue d’être ce que nous souhaitons qu’il soit: un lieu d’expérimentations et de mise en place de bonnes pratiques. En parallèle, nous travaillons dur sur la mise en place d’une documentation, mettant en lumière les nombreux concepts qui nous obligent à réfléchir et à écumer l’horizon des possibles, et … de changer de direction tous les 4 matins. Tant qu’à faire, autant que ce soit accessible au plus grand nombre.

Je ne vais pas retracer toutes les modifications, mais, rapidement, nous sommes arrivés à un système de packages des plus stables1, et je suis en train de terminer la nouvelle mouture de l’injecteur de dépendances, qui sera cette fois-ci facilement extensible.

Nous avons récupéré le nom de domaine www.spiral-project.org, qui servira à publier la documentation et les diverses expériences en relation avec spiral. Rien de terminé pour le moment (d’ailleurs, vous pouvez voir que c’est bien vide), mais on à un joli site web en préparation, vous pouvez tout suivre en direct sur bitbucket !

Stage

Je termine un stage de pratiquement un an chez Keo Networks, en tant que développeur web, sur du Zend Framework (PHP). De bons souvenirs, mais ce changement démarque aussi une envie d’aller aussi voir ailleurs, pour plusieurs raisons, et la permissivité du langage PHP n’y est pas pour rien.

Je m’en vais donc vers d’autres horizons, puisque j’aurais le plaisir d’aller bosser chez Makina Corpus, dans l’équipe Python/Django/Zope. L’entreprise est très attachée aux valeurs du logiciel libre, ce qui n’est pas vraiment pour me déplaire :)

J’ai donc déjà commencé à creuser un peu sur django et sur python, pour l’instant, je dois surtout avouer que je ne suis pas aussi à l’aise qu’avec le PHP que j’ai tant l’habitude de manier, mais ça vient progressivement !

Associatif !

Et puis, pour terminer sur une note un peu moins « geek» , cette année, on reprends les mêmes, et on recommence ! Plusieurs projets qui pointent le bout de leur nez, dont un qui arrive au terme de la période de réflexion, pour entrer en action: l’AMAP étudiante Toulousaine, Zest. Les distributions commencent demain (lundi 5 octobre), je croise les doigts pour que tout roule !

La semaine de l’environnement de l’année prochaine commence à pointer le bout de son nez aussi, et les réunions d’organisation vont bientôt débouler. Y’à du pain sur la planche !

Au réseau GRAPPE, aussi, on continue à avoir des réflexions sur la thématique de l’alimentation, d’ailleurs, vous pourrez trouver un document qui résume notre boulot de l’année dernière: « Les étudiants se mettent à table« .

  1. et qui ressemble à celui de Flow3, tiens tiens…

Written by Alexis Metaireau

octobre 4th, 2009 at 5:54

Posted in 3615 MyLife

Tagged with , , , ,