"…mais ce serait peut-être l'une des plus grandes opportunités manquées de notre époque si le logiciel libre ne libérait rien d'autre que du code…"

Archive for the ‘Revue de code’ Category

Code source, gestionnaire de versions/code: mercurial, bazaar, git

Posted by patrick sur juillet 7, 2008

Quelques informations concernant la gestion des programmes source sous GNU/Debian Ubuntu.

Comment obtenir les sources d’un programme sous Debian/Ubuntu ?

Quand on installe une distribution Debian/Ubuntu nous avons un ensemble de logiciels sous forme de fichiers (ou paquets) binaires, la liste de ces « paquets » étant donné dans le fichier /etc/apt/sources.list. Si l’on veut consulter le code source correspondant à ces  programmes, il faudra:

  • modifier le fichier /etc/apt/sources.list (sudo gtkedit /etc/apt/sources.list) en rajoutant pour chaque ligne commençant par « deb http://xxxx… » une ligne « deb-src http://xxx… ».
  • lancer commande « sudo apt-get update » pour mettre à jour la liste des paquets.

Si l’on veut voir à quoi ressemble les sources de l’interpréteur python on se crée un répertoire ~/src/python par exemple et un simple « apt-get source python2.5 » suffira pour télécharger les sources. A cette occasion, on aura le message suivant:

Lecture des listes de paquets... Fait
Construction de l'arbre des dépendances
Lecture des informations d'état... Fait
NOTE : l'empaquetage de 'python2.5' est maintenu dans le système de contrôle de version 'Bzr' à:
Veuillez utiliser:
bzr get http://bazaar.launchpad.net/~doko/python/pkg2.5
pour télécharger les dernières mises à jours (probablement non publiées) de ce module.

On apprend donc que ce paquet Ubuntu est géré avec un logiciel de gestion de version distribué appelé ‘bazaar’ (petit nom :’ bzr’) ce logiciel étant écrit en python (faire un apt-get source bzr pour voir le code python).

Pourquoi vouloir obtenir le code source  d’un programme ?

  • les logiciels libres/open source étant des logiciels de très bonne qualité, il est très intéressant de voir comment tel programme a été implémenté
  • cela permet de contrôler le contenu d’un programme (absence de spywares par exemple) et/ou de faire une revue de code (http://en.wikipedia.org/wiki/Code_review)
  • si on est très motivé, cela permet de participer au développement d’un logiciel ou si l’on n’est pas développeur de participer à sa documentation.

Les gestionnaires de versions

La participation à un projet open source implique l’utilisation d’un gestionnaire de versions. Depuis 2003 environ, CVS  est progressivement remplacé par subversion. Et depuis quelques moi, subversion est remplacé par des systèmes de gestion distribué tels que Mercurial (ou hg, écrit lui aussi en python), git (écrit par Linus Torwals), et bazaar.

Ainsi le langage python actuellement géré avec subversion pourrait passer sous bazaar ou mercurial:  http://www.python.org/dev/bazaar/ (« Python’s source code is maintained under the Subversion revision control system. We are experimenting with distributed revision control systems (dvcs) because of their greatly improved workflow, accessibility and merging facilities over Subversion. While there are several serious dvcs contenders in the open source world, this page describes the experimental Bazaar mirrors of the Python Subversion tree that we are making available to developers« )

A voir:

  • http://en.wikipedia.org/wiki/Bazaar_(software) (« Bazaar (formerly Bazaar-NG) is a distributed revision control system sponsored by Canonical Ltd., designed to make it easier for anyone to contribute to free and open source software projectsBazaar is written in the Python programming language, with packages for major LinuxMac OS X and Windows. Bazaar is free software and part of the distributions, GNU projectBazaar has support for working with some other revision control systems.[3] This allows users to branch from another system (such as Subversion), make local changes and commit them into a Bazaar branch, and then later merge them back into the other system. Bazaar has basic support for Subversion with the bzr-svn plugin.[4] There is also beginnings of support for both Mercurial[5] and Git.[6] Currently these are not feature complete, but are complete enough to show a graphical history. »)
  • http://bazaar-vcs.org/WhoUsesBzr
  • http://wiki.list.org/display/DEV/MailmanOnLaunchpad (« The Mailman source code was originally maintained using CVS, and only a few people had write access to the code. Later, development was moved to SourceForge and then the CVS repository was converted to Subversion. This proved to be a successful transition, as Subversion provided many benefits over CVS.Now however, it’s become clear that even Subversion has its limitations, and better options exist. Specifically, we are now using the distributed (or decentralized) revision control system (dvcs) called Bazaar. Bazaar has many beneficial features, both for the core developers and for casual, third party developers. »)

Posted in 2008, Développement logiciel, Génie logiciel, Gestion de version, GNU/Linux, logiciel libre, python, Revue de code, ubuntu | Leave a Comment »

Les nouveaux projets python: codereview/rietveld, Paver, Sphinx

Posted by patrick sur mai 12, 2008


http://googleappengine.blogspot.com/2008/05/open-source-app-rietveld-code-review.html (« My first project as a Google engineer was an internal web app for code review. According to Wikipedia, code review is « systematic examination (often as peer review) of computer source code intended to find and fix mistakes overlooked in the initial development phase, improving both the overall quality of software and the developers’ skills. » Not an exciting topic, perhaps, but the internal web app, which I code-named Mondrian after one of my favorite Dutch painters, was an overnight success among Google engineers (who evidently value software quality and skills development :-). I even gave a public presentation about it: you can watch the video on YouTube.« )

http://groups.google.com/group/codereview-discuss?hl=en (« Discussion of the code review tool « Rietveld », http://codereview.appspot.com, open source at http://code.google.com/p/rietveld/.« )


http://www.blueskyonmars.com/projects/paver/ (« Paver is a Python-based build/distribution/deployment scripting tool along the lines of Make or Rake. What makes Paver unique is its integration with commonly used Python libraries. Common tasks that were easy before remain easy. More importantly, dealing with yourKevin Dangoor of SitePen applications specific needs and requirements is now much easier…Paver is currently alpha release software. There is one major feature (zc.buildout integration) planned for 1.0. At this point, it is unlikely that there will be significant changes to the pavement syntax, but there are no guarantees. If there are breaking changes, they will almost certainly be minor…Paver was created by . »)

http://groups.google.com/group/comp.lang.python.announce/browse_thread/thread/1b84e15dab7f02d6?hl=en (« With Version 0.7, Paver is now a full stand-in for the traditional distutils- or setuptools-based setup.py. Need to perform some extra work before an sdist runs? No problem:

def sdist():
…move files around, etc….
call_task(« distutils.command.sdist »)

You put that in your pavement.py file and now running « paver sdist » will perform your logic and then run the distutils sdist command. Paver can even generate a setup.py so « python setup.py sdist » or « python setup.py install » work just as they always have. And to make it easier for people who don’t yet have Paver, you can include a small zip file that enables « python setup.py install » to work off of a pavement.py file even without Paver. Paver 0.7 has a bunch of new tools to help with project documentation (taking advantage of Georg Brandl’s Sphinx and also including Ned Batchelder’s Cog). Paver now includes much better docs, too.« )

http://nedbatchelder.com/code/cog/ (« Cog is a code generation tool. It lets you use pieces of Python code as generators in your source files to generate whatever code you need…Cog transforms files in a very simple way: it finds chunks of Python code embedded in them, executes the Python code, and inserts its output back into the original file. The file can contain whatever text you like around the Python code. It will usually be source code« )


http://sphinx.pocoo.org/ (« Sphinx is a tool that makes it easy to create intelligent and beautiful documentation for Python projects, written by Georg Brandl and licensed under the BSD license.It was originally created to translate the new Python documentation, but has now been cleaned up in the hope that it will be useful to many other projects. (Of course, this site is also created from reStructuredText sources using Sphinx!) »)

A voir:

http://en.wikipedia.org/wiki/Code_review (« Code reviews can often find and remove common vulnerabilities such as format string exploits, race conditions, memory leaks and buffer overflows, thereby improving software security. Online software repositories based on Subversion with Trac, Mercurial, GIT or others allow groups of individuals to collaboratively review code. Additionally, specific tools for collaborative code review can facilitate the code review process. »)

http://en.wikipedia.org/wiki/Software_distribution (« A software distribution is a bundle of a specific software (or a collection of multiple, even an entire operating system), already compiled and configured. It is generally the closest thing to a turnkey form of a usually GPL or open source source code for a software. It usually takes the form of either rpm, deb, tgz, msi, exe etc. installer and is downloadable from the Internet. These are also known as a Binary distributions…The Python programming language offers a distribution utility called distutils, which requires the creation of a setup.py configuration file »)

http://docs.python.org/dist/dist.html (« Distributing Python Modules »)

http://mail.python.org/mailman/listinfo/doc-sig (« For discussion of both the form and content of Python documentation. The SIG should work towards setting up a Python Documentation Project effort like the Linux Documentation Project. « )

http://fr.wikipedia.org/wiki/Documentation_logicielle (« La documentation logicielle est un texte écrit qui accompagne le logiciel informatique. Elle explique comment le logiciel fonctionne, ou comment on doit l’employer. Le terme peut avoir des significations différentes pour des personnes de différents profils.La documentation constitue une partie importante de l’ingénierie logicielle, qui est trop souvent négligéeDonald Knuth a insisté sur le fait que la documentation peut être un processus très difficile de réflexion après coup et a recommandé la programmation lettrée, qui consiste à écrire la documentation en même temps et en un même lieu que le code source et à l’extraire par des moyens automatiques. »)

http://fr.wikipedia.org/wiki/Gestion_de_configuration (« La gestion de configuration consiste à gérer la description technique d’un système (et de ses divers composants), ainsi qu’à gérer l’ensemble des modifications apportées au cours de l’évolution du système. La gestion de configuration est utilisée pour la gestion de systèmes complexes« )

http://en.wikipedia.org/wiki/Software_deployment (« Software deployment is all of the activities that make a software system available for use. The general deployment process consists of several interrelated activities with possible transitions between them. These activities can occur at the producer site or at the consumer site or both. Because every software system is unique, the precise processes or procedures within each activity can hardly be defined. Therefore, « deployment » should be interpreted as a general process that has to be customized according to specific requirements or characteristics. A brief description of each activity will be presented later. »)

Posted in Distribution de logiciel, Documentation, Génie logiciel, Gestion de projet, Gestion de version, python, Revue de code | Tagué: | Leave a Comment »