Add a subset of the articles from my old blog.

This commit is contained in:
Alexis Metaireau 2010-10-17 03:29:42 +01:00
parent 7b40ff3965
commit af31668f2a
10 changed files with 832 additions and 0 deletions

View file

@ -0,0 +1,42 @@
AMAP + Média = Paniers bio à 5€ ?!
##################################
:Date: 2009-11-11
Le raccourci me semble un peu rapide. Et pourtant, il est emprunté
bien trop souvent. La dernière *mes-utilisation* que j'ai à décrier
est celle d'un reportage télé, passé sur France 2 vendredi 23
Octobre
(`voir la vidéo <http://docs.notmyidea.org/amap/amap-fr2.avi>`_),
ou on parles de
`l'AMAP étudiante Zest <http://amap.zest.free.fr>`_.
Malgré tout le temps passé à expliquer que justement, l'AMAP c'est
avant tout, pour nous, une notion de solidarité envers les
agriculteurs, malgré le fait que le message soit plus profond que
simplement aller acheter du bio (ça, c'est possible aussi en
supermarché), malgré le fait qu'il s'agisse en fait d'une remise en
cause plus profonde de la société, les journalistes n'ont choisi de
prendre que les quelques secondes qui leurs convenaient, celles qui
ne faisaient pas tache, celle ou je dis que "l'AMAP permet aux
étudiants de réapprendre à cuisiner, plutôt que de manger des
nouilles et de se faire des plats réchauffés". Bien sur, je l'ai
dit et je le pense d'ailleurs, là n'est pas le problème, mais mon
message n'était pas celui là.
Jamais, dans les quelques minutes du reportage, on ne dit ce que
AMAP signifie: Association de **Maintien** d'une Agriculture
**Paysanne**. On ne parles même pas des agriculteurs ! C'est
simplement plus facile pour les étudiants de venir récupérer leurs
paniers, puisque les points de distribution sont sur les facs, et
en plus ça ne coute que 5 euros ! ...
Alors je crois bon de rappeler que L'AMAP n'est pas seulement un
service, c'est un engagement. Sur 5 mois, un engagement solidaire,
c'est la donnée principale de l'équation, celle sans quoi ça ne
peut fonctionner. Par le biais de cette AMAP, on essaye de montrer
que d'autres agricultures sont possibles, que la solidarité c'est
bien réel, et qu'il est possible de sortir du
*tout, tout de suite*.
Mais bon, apparemment, ça passe pas bien à la télé.

View file

@ -0,0 +1,62 @@
Le temps des grâces, courrez-y !
################################
:date: 2010-03-28
Ouf, notre
`semaine de l'environnement <http://www.reseaugrappe.org>`_ s'est
terminée, après un peu de neige et un brin de soleil quand il en
fallait. Ce fut l'occasion de rencontrer beaucoup de gens biens, et
de regarder d'un peu plus près toutes ces problématiques qui
mériteraient à elles seules, chacune un billet. Après un répis
d'une semaine, pour récupérer des folies organisatrices (c'est ça
qui fait du bien, ceci dit -- les folies, pas le repos), je me
retrouve de nouveau sur ces mêms réflexions, grâce aux journées
organisées par
`France Nature Environnement <http://www.fne.asso.fr/>`_, qui
proposaient ce jeudi soir une projection de "Le temps des grâces",
un documentaire sur l'agriculture. |affiche-le-temps-des-graces|
Parce que depuis 60 ans, il est pratiqué le remembrement des
parcelles à gogo, parce que nos sols deviennent completement morts
à cause des tonnes d'intrants qu'on leur fait absorber, et parce
que les exploitations s'agrandissent sans en finir pour tenter de
réagir façe à un marché financier toujours plus insaisissable, mené
de très loin par la PAC, il fallait un film pour en parler. C'est
ce que fait "le temps des grâçes", avec un bon sens et une facilité
à faire passer des messages, qu'on ne peut qu'applaudir.
Malheureusement il s'agissait de la dernière diffusion à
`L'Utopia de Toulouse <http://www.cinemas-utopia.org/toulouse/>`_...
Si vous en avez l'occasion, sautez dessus et profitez le temps de
ces 2 heures, ou vous pourrez écouter à la fois des discours
d'agronomes, d'agriculteurs, de chercheurs et bien d'autres, qui
dressent un constat pas si brillant de notre agriculture. On n'est
pas sorti de l'auberge, enfin, c'est l'expression. Je vous laisse
avec le synopsis et une bande annonce. Une enquête documentaire sur
le monde agricole français aujourd'hui à travers de nombreux récits
: agriculteurs, chercheurs, agronomes, écrivains... Un monde qui
parvient à résister aux bouleversements qui le frappent -
économiques, scientifiques, sociaux - et qui, bon gré mal gré,
continue d'entretenir les liens entre générations. Un monde au
centre d'interrogations majeures sur l'avenir.
Ainsi qu'un commentaire que je ne peux m'empécher de relayer,
trouvé sur allocine.fr (oui, vous savez, ce site rempli de pubs).
Le temps des grâces c'est je pense le plus grand film traitant de
l'écologie en tant que documentaire ou en sujet principal, on y
apprend une multitude de choses, on en ressort en colère contre le
système, le film propose différents points de vues, ici on a pas de
voix off moralisatrice à deux balles avec des gros titres bien
surlignés pour que même les beaufs matant TF1 puissent comprendre,
ici même si ça reste accessible au citoyen lambda, le film ne fait
pas de compromis avec le monde agroalimentaire, il ose dénoncer les
filière d'agronomie qui apprennent pas les bonnes choses à leurs
étudiants, aux lobbys de cette agro-industrie qui n'en fait qu'à sa
tête pour amasser de l'argent, cette tendance à tout uniformiser et
détruire… Franchement j'ai trouvé ça génial de bout en bout,
captivant, on explore cette campagne française, on comprend les
dilemmes des paysants. Le film n'étant pas opposé à la modernité,
ni même réactionnaire, il propose juste un constat alarmant du
monde agricole français, tout en proposant des alternatives qui
pourraient être utilisée, si les pouvoirs publics lâchaient un peu
la main des lobbys. Passionnant, vraiment. Courrez-y, je vous dis.
.. |affiche-le-temps-des-graces| image:: http://www.notmyidea.org/wp-content/uploads/2010/03/affiche-le-temps-des-graces-225x300.jpg

View file

@ -0,0 +1,48 @@
Semaine de lenvironnement: La consommation étudiante
#####################################################
:Date: 2010-02-24
*Les acteurs associatifs sont bien souvent moteurs des critiques de nos sociétés. Je pense à `Framasoft <http://www.framasoft.net/>`_, à `la Quadrature du net <http://www.laquadrature.net/>`_ ou à `Ars Industrialis <http://www.arsindustrialis.org/>`_ (dans le domaine de la science et de l'informatique), mais aussi `aux Amis de la Terre <http://www.amisdelaterre.org/>`_, à `ATTAC <http://www.attac.org/>`_ (dans le domaine de l'environnement entres autres), et a tout un tas d'autres associations que je ne peux pas citer ici exhaustivement... Ce sont eux qui sont porteurs de messages alternatifs, et qui sont les initiateurs de débats publics, qui permettent de faire avancer des thématiques aussi importantes que le logiciel libre ou la protection de l'environnement.*
Dans cette optique, depuis près de 3 ans (déjà !), au sein du
`réseau GRAPPE <http://www.reseaugrappe.org>`_, on *essaye*
d'aborder des thématiques qui touchent de près ou de loin à
l'environnement, parce que c'est un sujet qui nous importe et nous
passionne. L'année dernière, c'était l'alimentation étudiante, ce
qui à abouti à la publication de
`la revue "les étudiants se mettent à table" <http://public.reseaugrappe.org/alimentation.pdf>`_.
Cette année c'est la consommation étudiante qui est au programme.
La consommation étudiante ?
~~~~~~~~~~~~~~~~~~~~~~~~~~~
L'idée principale de cette étude est de tenter de faire une analyse
de la "société de consommation", souvent questionnée par les
étudiants et par d'autres, et de jeter un œil sur le rapport des
étudiants à cette société: Quoi et comment consomment-ils ? Les
universités et les écoles ne poussent-elles pas dune certaine
manière les étudiants à la consommation ? Quelles sont les
alternatives face aux dérives de surconsommation ?
Analyse des pratiques, réflexions et mobilisations des étudiants en
termes de consommation seront réalisés pour comprendre leur modes
de vie, mais aussi leurs attentes, leurs propositions sur cette
thématique
La semaine de l'environnement !
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
A travers l'ensemble des villes du réseau,
des projections de films et des débats auront donc lieu sur ce
thème, lors de la semaine de l'environnement 2010, qui se déroulera
d'ailleurs durant le mois de Mars
`partout en france <http://www.reseaugrappe.org/la-semaine-de-lenvironnement-programme/>`_,
et **du 6 au 14 Mars sur Toulouse**.
`Jetez un oeil au programme <http://docs.notmyidea.org/sde/prog-toulouse.pdf>`_
! Avec pour objectif de sonder un peu le ressenti des étudiants en
terme de consommation, nous avons mis en place
`un questionnaire en ligne <http://spreadsheets.google.com/viewform?formkey=dHV2bVllS2lWbzhyV3NBN3NUbi1TM2c6MA>`_,
que vous pouvez compléter en une petite 10aine de minutes,
n'hésitez pas !
`La page sur la consommation étudiante sur le site du GRAPPE <http://www.reseaugrappe.org/consommation/>`_

View file

@ -0,0 +1,29 @@
Use Restructured Text (ReST) to power your presentations
#########################################################
:Date: 2010-06-25
Wednesday, we give a presentation, with some friends, about the
CouchDB Database, to
`the Toulouse local LUG <http://www.toulibre.org>`_. Thanks a lot
to all the presents for being there, it was a pleasure to talk
about this topic with you. Too bad the season is over now an I quit
Toulouse next year. During our brainstorming about the topic, we
used some paper, and we wanted to make a presentation the simpler
way. First thing that come to my mind was using
`restructured text <http://docutils.sourceforge.net/rst.html>`_, so
I've wrote a simple file containing our different bullet points. In
fact, there is quite nothing to do then, to have a working
presentation. So far, I've used
`the rst2pdf program <http://code.google.com/p/rst2pdf/>`_, and a
simple template, to generate output. It's probably simple to have
similar results using latex + beamer, I'll try this next time, but
as I'm not familiar with latex syntax, restructured text was a
great option. Here are
`the final PDF output <http://files.lolnet.org/alexis/rst-presentations/couchdb/couchdb.pdf>`_,
`Rhe ReST source <http://files.lolnet.org/alexis/rst-presentations/couchdb/couchdb.rst>`_,
`the theme used <http://files.lolnet.org/alexis/rst-presentations/slides.style>`_,
and the command line to generate the PDF::
rst2pdf couchdb.rst -b1 -s ../slides.style

View file

@ -0,0 +1,40 @@
A Distutils2 GSoC
#################
:Date: 2010-05-01
WOW. I've been accepted to be a part of the
`Google Summer Of Code <http://code.google.com/intl/fr/soc/>`_
program, and will work on `python <http://python.org/>`_
`distutils2 <http://hg.python.org/distutils2/>`_, with
`a <http://pygsoc.wordpress.com/>`_
`lot <http://konryd.blogspot.com/>`_ `of <http://ziade.org/>`_
(intersting!) `people <http://zubin71.wordpress.com/>`_.
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 <http://www.python.org/dev/peps/pep-0376/>`_.
|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.
.. |The current state of packaging| image:: http://www.notmyidea.org/wp-content/uploads/2010/05/state_of_packaging-300x171.jpg

View file

@ -0,0 +1,149 @@
Introducing the distutils2 index crawlers
##########################################
:Date: 2010-07-06
I'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'll try do sum-up my general feelings here, and the work I've made
so far. You can also find, if you're interested, my weekly
summaries in
`a dedicated wiki page <http://wiki.notmyidea.org/distutils2_schedule>`_.
General feelings
~~~~~~~~~~~~~~~~
First, and it's a really important point, the GSoC is going very
well, for me as for other students, at least from my perspective.
It's a pleasure to work with such enthusiast people, as this make
the global atmosphere very pleasant to live.
First of all, I've spent time to read the existing codebase, and to
understand what we're going to do, and what's the rationale to do
so.
It's really clear for me now: what we'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.
With distutils2, it will be simpler to make "things" 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.
Tasks
~~~~~
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's their version, name, metadata, dependencies,
etc.)
The main index, you probably know and use, is PyPI. You can access
it at `http://pypi.python.org <http://pypi.python.org>`_.
PyPI index crawling
~~~~~~~~~~~~~~~~~~~
There is two ways to get these informations from PyPI: using the
simple API, or via xml-rpc calls.
A goal was to use the version specifiers defined
in`PEP 345 <http://www.python.org/dev/peps/pep-0345/>`_ and to
provides a way to sort the grabbed distributions depending our
needs, to pick the version we want/need.
Using the simple API
--------------------
The simple API is composed of HTML pages you can access at
`http://pypi.python.org/simple/ <http://pypi.python.org/simple/>`_.
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's why I've preferred to pick up
the good ideas, and some implementation details, plus re-thinking
the global architecture.
The rules are simple: each project have a dedicated page, which
allows us to get informations about:
- the distribution download locations (for some versions)
- homepage links
- some other useful informations, as the bugtracker address, for
instance.
If you want to find all the distributions of the "EggsAndSpam"
project, you could do the following (do not take so attention to
the names here, as the API will probably change a bit):
.. code-block:: python
>>> index = SimpleIndex()
>>> index.find("EggsAndSpam")
[EggsAndSpam 1.1, EggsAndSpam 1.2, EggsAndSpam 1.3]
We also could use version specifiers:
.. code-block:: python
>>> index.find("EggsAndSpam (< =1.2)")
[EggsAndSpam 1.1, EggsAndSpam 1.2]
Internally, what's done here is the following:
- it process the
`http://pypi.python.org/simple/FooBar/ <http://pypi.python.org/simple/FooBar/>`_
page, searching for download URLs.
- 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.
- it sort the found distributions, using version numbers. The
default behavior here is to prefer source distributions (over
binary ones), and to rely on the last "final" distribution (rather
than beta, alpha etc. ones)
So, nothing hard or difficult here.
We provides a bunch of other features, like relying on the new PyPI
mirroring infrastructure or filter the found distributions by some
criterias. If you're curious, please browse the
`distutils2 documentation <http://distutils2.notmyidea.org/>`_.
Using xml-rpc
-------------
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.
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
`some code already set up <http://github.com/ametaireau/pypiclient>`_),
what I need to do is to provide a xml-rpc PyPI mock server, and
that's on what I'm actually working on.
Processes
~~~~~~~~~
For now, I'm trying to follow the "documentation, then test, then
code" 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.
While writing the simple index crawling work, I must have done this
to avoid some changes on the API, and some loss of time.
Also, I've set up
`a schedule <http://wiki.notmyidea.org/distutils2_schedule>`_, 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
...)

View file

@ -0,0 +1,87 @@
Sprinting on distutils2 in Tours
################################
:Date: 2010-07-06
Yesterday, as I was traveling to Tours, I've took some time to
visit Éric, another student who'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. I'd really enjoyed this
time, because Éric knows a lot of things about mercurial and python
good practices, and I'm eager to learn about those. 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.
Documentation
~~~~~~~~~~~~~
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. We're missing some rules to follow, and
this lead to a not-so-structured final documentation. We probably
target three type of publics, and we can split the documentation
regarding those:
- **Packagers** who want to distribute their softwares.
- **End users** who need to understand how to use end user
commands, like the installer/uninstaller
- **packaging coders** who *use* distutils2, as a base for
building a package manager.
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's maybe seems to be not so important, but I
guess the readers would appreciate to have the same structure all
along distutils2 documentation.
Mercurial
~~~~~~~~~
I'm really *not* 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're of a great help. We have talked about some
mercurial extensions that seems to make the life simpler, while
used the right way. I've not used them so far, so consider this as
a personal note.
- hg histedit, to edit the history
- hg crecord, to select the changes to commit
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.
These things make me say I **need** to read
`the hg book <http://hgbook.red-bean.com/read/>`_, and will do as
soon as I got some spare time: mercurial seems to be simply great.
So ... Great. I'm a powerful merger now !
On using tools
~~~~~~~~~~~~~~
Because we *also* are *hackers*, we have shared a bit our ways to
code, the tools we use, etc. Both of us were using vim, and I've
discovered vimdiff and hgtk, which will completely change the way I
navigate into the mercurial history. We aren't "power users", so we
have learned from each other about vim tips. You can find
`my dotfiles on github <http://github.com/ametaireau/dotfiles>`_,
if it could help. They're not perfect, and not intended to be,
because changing all the time, as I learn. Don't hesitate to have a
look, and to propose enhancements if you have !
On being pythonic
~~~~~~~~~~~~~~~~~
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. Well, it seems that the only
solution is to read code, and to re-read import this from times to
times !
`Coding like a pythonista <http://python.net/~goodger/projects/pycon/2007/idiomatic/handout.html>`_
seems to be a must-read, so, I know what to do.
Conclusion
~~~~~~~~~~
It was really great. Next time, we'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 ! We'll probably do
another sprint in a few weeks, stay tuned !

View file

@ -0,0 +1,176 @@
An amazing summer of code working on distutils2
###############################################
:Date: 2010-08-16
The `Google Summer of Code <http://code.google.com/soc/>`_ I've
spent working on `distutils2 <http://hg.python.org/distutils2/>`_
is over. It was a really amazing experience, for many reasons.
First of all, we had a very good team, we were 5 students working
on distutils2: `Zubin <http://zubin71.wordpress.com>`_,
`Éric <http://wokslog.wordpress.com/>`_,
`Josip <http://gsoc.djolonga.com/>`_,
`Konrad <http://konryd.blogspot.com/>`_ and me. In addition,
`Mouad <http://mouadino.blogspot.com/>`_ have worked on the PyPI
testing infrastructure. You could find what each person have done
on
`the wiki page of distutils2 <http://bitbucket.org/tarek/distutils2/wiki/GSoC_2010_teams>`_.
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 shape.
Then, I'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've been introducing myself to
python in the late 2009.
I'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've traveled
since I wrote it.
This summer was awesome because I've learned about python good
practices, now having some strong
`mercurial <http://mercurial.selenic.com/>`_ knowledge, and I've
seen a little how the python community works.
Then, I would like to say a big thanks to all the mentors that have
hanged around while needed, on IRC or via mail, and especially my
mentor for this summer, `Tarek Ziadé <http://tarek.ziade.org>`_.
Thanks a lot for your motivation, your leadership and your
cheerfulness, even with a new-born and a new work!
Why ?
-----
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 way.
Now, we have PEPs that describes some format we agreed on (see PEP
345), and we wanted to have a tool on which users can base their
code on, that's `distutils2 <http://hg.python.org/distutils2/>`_.
My job
------
I had to provides a way to crawl the PyPI indexes in a simple way,
and do some installation / uninstallation scripts.
All the work done is available in
`my bitbucket repository <http://bitbucket.org/ametaireau/distutils2/>`_.
Crawling the PyPI indexes
~~~~~~~~~~~~~~~~~~~~~~~~~
There are two ways of requesting informations from the indexes:
using the "simple" index, that is a kind of REST index, and using
XML-RPC.
I've done the two implementations, and a high level API to query
those twos. Basically, this supports the mirroring infrastructure
defined in PEP 381. So far, the work I've done is gonna be used in
pip (they've basically copy/paste the code, but this will change as
soon as we get something completely stable for distutils2), and
that's a good news, as it was the main reason for what I've done
that.
I've tried to have an unified API for the clients, to switch from
one to another implementation easily. I'm already thinking of
adding others crawlers to this stuff, and it was made to be
extensible.
If you want to get more informations about the crawlers/PyPI
clients, please refer to the distutils2 documentation, especially
`the pages about indexes <http://distutils2.notmyidea.org/library/distutils2.index.html>`_.
You can find the changes I made about this in the
`distutils2 <http://hg.python.org/distutils2/>`_ source code .
Installation / Uninstallation scripts
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Next step was to think about an installation script, and an
uninstaller. I've not done the uninstaller part, and it's a smart
part, as it's basically removing some files from the system, so
I'll probably do it in a near future.
`distutils2 <http://hg.python.org/distutils2/>`_ provides a way to
install distributions, and to handle dependencies between releases.
For now, this support is only about the last version of the
METADATA (1.2) (See, the PEP 345), but I'm working on a
compatibility layer for the old metadata, and for the informations
provided via PIP requires.txt, for instance.
Extra work
~~~~~~~~~~
Also, I've done some extra work. this includes:
- working on the PEP 345, and having some discussion about it
(about the names of some fields).
- writing a PyPI server mock, useful for tests. you can find more
information about it on the
`documentation <http://distutils.notmyidea.org>`_.
Futures plans
-------------
As I said, I've enjoyed working on distutils2, and the people I've
met here are really pleasant to work with. So I *want* 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 usable.
I'm not plainly satisfied by the work I've done, so I'll probably
tweak it a bit: the installer part is not yet completely finished,
and I want to add support for a real
`REST <http://en.wikipedia.org/wiki/Representational_State_Transfer>`_
index in the future.
We'll talk again of this in the next months, probably, but we
definitely need a real
`REST <http://en.wikipedia.org/wiki/Representational_State_Transfer>`_
API for `PyPI <http://pypi.python.org>`_, as the "simple" index
*is* an ugly hack, in my opinion. I'll work on a serious
proposition about this, maybe involving
`CouchDB <http://couchdb.org>`_, as it seems to be a good option
for what we want here.
Issues
------
I've encountered some issues during this summer. The main one is
that'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 emails.
I've finally managed to work in an office, so good point for
home/office separation.
I'd not planned there will be so a high number of emails to read,
in order to follow what'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 !).
Thanks !
--------
A big thanks to `Graine Libre <http://www.graine-libre.fr/>`_ and
`Makina Corpus <http://www.makina-corpus.com/>`_, 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're a student, if you're
interested about FOSS, dont hesitate any second, it's a really good
opportunity to work on interesting projects!

View file

@ -0,0 +1,88 @@
first week working on distutils2
#################################
:date: 2010-06-04
As I've been working on
`Distutils2 <http://hg.python.org/distutils2/>`_ during the past
week, taking part of the
`GSOC <http://code.google.com/intl/fr/soc/>`_ 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 <http://hg.python.org/distutils2/>`_.
To do this, we need to rely on informations provided by the Python
Package Index (`PyPI <http://pypi.python.org/>`_), 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 <http://bitbucket.org/tarek/distribute/>`_ related
stuff to `Distutils2 <http://hg.python.org/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 <http://bitbucket.org/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 <http://wsgi.org>`_ and
`wsgiref <http://docs.python.org/library/wsgiref.html>`_ in order
control what to serve, and to log the requests made to the server,
but finally realised that
`wsgiref <http://docs.python.org/library/wsgiref.html>`_ is not
python 2.4 compatible (and we *need* to be python 2.4 compatible in
Distutils2).
So, we switched to
`BaseHTTPServer <http://docs.python.org/library/basehttpserver.html>`_
and
`SimpleHTTPServer <http://docs.python.org/library/simplehttpserver.html>`_,
and updated our tests accordingly. It's been an opportunity to
realize that `WSGI <http://wsgi.org>`_ 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 <http://bitbucket.org/ametaireau/distutils2/changesets>`_,
and the
`related docs <http://bitbucket.org/ametaireau/distutils2/src/tip/docs/source/test_framework.rst>`_
about this on
`my bitbucket distutils2 clone <http://bitbucket.org/ametaireau/distutils2/>`_.
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 <http://bitbucket.org/tarek/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 <http://github.com/ametaireau/pypiclient>`_
I'll take you updated !

111
python/python-go.rst Normal file
View file

@ -0,0 +1,111 @@
Python ? go !
##############
:date: 2009-12-17
Cela fait maintenant un peu plus d'un mois que je travaille sur un
projet en `django <http://www.djangoproject.org>`_, et que,
nécessairement, je me forme à `Python <http://python.org/>`_. Je
prends un plaisir non dissimulé à découvrir ce langage (et à
l'utiliser), qui ne cesse de me surprendre. Les premiers mots qui
me viennent à l'esprit à propos de Python, sont "logique" et
"simple". Et pourtant puissant pour autant. Je ne manque d'ailleurs
pas une occasion pour faire un peu d'*évangélisation* auprès des
quelques personnes qui veulent bien m'écouter.
The Zen of Python
~~~~~~~~~~~~~~~~~
Avant toute autre chose, je pense utile de citer Tim Peters, et
`le PEP20 <http://www.python.org/dev/peps/pep-0020/>`_, qui
constituent une très bonne introduction au langage, qui prends la
forme d'un *easter egg* présent dans python
.. code-block:: bash
>>> import this
The Zen of Python, by Tim Peters
Beautiful is better than ugly.
Explicit is better than implicit.
Simple is better than complex.
Complex is better than complicated.
Flat is better than nested.
Sparse is better than dense.
Readability counts.
Special cases aren't special enough to break the rules.
Although practicality beats purity.
Errors should never pass silently.
Unless explicitly silenced.
In the face of ambiguity, refuse the temptation to guess.
There should be one-- and preferably only one --obvious way to do it.
Although that way may not be obvious at first unless you're Dutch.
Now is better than never.
Although never is often better than *right* now.
If the implementation is hard to explain, it's a bad idea.
If the implementation is easy to explain, it may be a good idea.
Namespaces are one honking great idea -- let's do more of those!
J'ai la vague impression que c'est ce que j'ai toujours cherché à
faire en PHP, et particulièrement dans
`le framework Spiral <http://www.spiral-project.org>`_, mais en
ajoutant ces concepts dans une sur-couche au langage. Ici, c'est
directement de *l'esprit* de python qu'il s'agit, ce qui signifie
que la plupart des bibliothèques python suivent ces concepts. Elle
est pas belle la vie ?
Comment commencer, et par ou ?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Pour ma part, j'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'est bien évidemment pas exhaustive et vos
commentaires sont les bienvenus) :
- `Dive into python <http://diveintopython.adrahon.org/>`_
- `A byte of python <http://www.swaroopch.com/notes/Python_fr:Table_des_Matières>`_
- `Python: petit guide à l'usage du développeur agile <http://www.amazon.fr/Python-Petit-guide-lusage-développeur/dp/2100508830>`_
de `Tarek Ziadé <http://tarekziade.wordpress.com/>`_
- `La documentation officielle python <http://docs.python.org/index.html>`_,
bien sûr !
- `Les vidéos du pyconfr 2009 <http://video.pycon.fr/videos/pycon-fr-2009/>`_!
- Un peu de temps, et une console python ouverte :)
J'essaye par ailleurs de partager au maximum les ressources que je
trouve de temps à autres, que ce soit
`via twitter <http://www.twitter.com/ametaireau>`_ ou
`via mon compte delicious <http://delicious.com/ametaireau>`_.
Allez jeter un œil
`au tag python <http://delicious.com/ametaireau/python>`_ sur mon
profil, peut être que vous trouverez des choses intéressantes, qui
sait!
Un python sexy
~~~~~~~~~~~~~~
Quelques fonctionnalités qui devraient vous mettre l'eau à la
bouche:
- `Le chaînage des opérateurs de comparaison <http://docs.python.org/library/stdtypes.html#comparisons>`_
est possible (a<b <c dans une condition)
- Assignation de valeurs multiples (il est possible de faire a,b,c
= 1,2,3 par exemple)
- `Les listes <http://docs.python.org/tutorial/datastructures.html>`_
sont simples à manipuler !
- Les`list comprehension <http://docs.python.org/tutorial/datastructures.html#list-comprehensions>`_,
ou comment faire des opérations complexes sur les listes, de
manière simple.
- Les
`doctests <http://docs.python.org/library/doctest.html?highlight=doctest>`_:
ou comment faire des tests directement dans la documentation de vos
classes, tout en la documentant avec de vrais exemples.
- Les
`métaclasses <http://www.python.org/doc/essays/metaclasses/meta-vladimir.txt>`_,
ou comment contrôler la manière dont les classes se construisent
- Python est
`un langage à typage fort dynamique <http://wiki.python.org/moin/Why%20is%20Python%20a%20dynamic%20language%20and%20also%20a%20strongly%20typed%20language>`_:
c'est ce qui m'agaçait avec PHP qui est un langage à typage faible
dynamique.
Cous pouvez également aller regarder
`l'atelier donné par Victor Stinner durant le Pyconfr 09 <http://video.pycon.fr/videos/free/53/>`_.
Have fun !