Markdown documentation

Introduction Documentation should live with the code. Therefore a common problem is to keep your code documentation beside your source code, in a Git-friendly manner, while also being able to transform it later in a user-friendly format. In other words, you want to keep your documentation written in easy-to-read and easy-to-modify text files while also being able to generate PDF files from it (or HTML). You may want also to be able to include nice diagrams in your documentation, while also being able to version them in a Git-friendly manner. ...

4 avril 2022

Python: packaging data and translation files

Data files in your Python package The cleanest way I’ve found has 3 steps. MANIFEST.in Your MANIFEST.in must include the files you want in the package. For example, to include all .mo files: recursive-include multisense_processes *.py *.mo recursive-include tests * include *.md __init__.py All the directories containing data files must be Python modules, even if they don’t actually contain any actual code. In other words, they must all have files called __init__.py. For instance: ...

4 avril 2022

Git, MariaDB and Python3

Pour un projet perso top secret, je me suis retrouvé dans une situation où je souhaitais être capable de : stocker un grand nombre de petits dépôts Git les avoir en haute-disponibilité (99.9% d’uptime) encaisser une forte charge en lecture sur ces dépôts être capable de monter en charge verticalement mais aussi horizontalement rapidement si besoin est toujours avoir un contenu apparent cohérent : Quand on fait un push sur une des machines du cluster et qu’on enchaîne sur un pull depuis une autre, il faut que le contenu du push soit systématiquement apparent accéder et manipuler ces dépôts depuis un programme en Python 3. Autrement dit, il me fallait essentiellement un moyen de répliquer des dépôts Git sur plusieurs machines efficacement. ...

1 septembre 2015

Git Dumb Protocol

Git supports various protocols. One of them is called the “dumb” protocol. This dumb protocol is based on HTTP+Webdav. There is also a smart protocol, but this one is not really HTTP compliant (it starts as HTTP for an handshake, but then switches to a custom protocol). The dumb protocol is really handy in scenarios where you can only expose a Git repository through standard HTTP+WebDav. For instance, if you have a firewall in front of your webserver. Or if you want to implement a “fake” Git repository using a standard web framework (Django for instance). ...

5 octobre 2013