From 43b2fcb90a0649de052fbbac77311a3b90a2349c Mon Sep 17 00:00:00 2001 From: Christophe Besson Date: Fri, 25 Sep 2026 11:50:17 +0200 Subject: docs(claude): translate the Python environment section into English Co-Authored-By: Claude Opus 5.5 --- CLAUDE.md | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index 19381cb..0a3aa45 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -48,36 +48,36 @@ Jamais de processus orphelins ni de ports ouverts après un test. - **Build backend:** hatchling (per package `pyproject.toml`) ```bash -# Créer le venv (--clear si recréation sur une autre machine/OS) +# Create the venv (--clear when recreating it on another machine/OS) python3 -m venv .venv --clear source .venv/bin/activate -# Toutes les dépendances sont déclarées dans les pyproject.toml — un seul pip install suffit +# All dependencies are declared in the pyproject.toml files — a single pip install is enough pip install -e "packages/meshbay-common[dev]" -e "packages/meshbay-hub[dev]" \ -e "packages/meshbay-node[dev]" ``` -Les deps clés (aioquic, watchdog, fastapi, blake3, etc.) sont dans les `pyproject.toml` -et installées automatiquement. Ne pas ajouter manuellement des packages sans les déclarer -dans le bon `pyproject.toml`. - -> **L'extra `[dev]`, pas une liste à la main.** Cette ligne a longtemps été -> `pip install pytest pytest-asyncio aiosqlite`, ce qui contredisait la règle -> ci-dessus et coûtait trois choses invisibles. Sans `piexif`, -> `test_enrich_photo.py` échoue à l'import et **toute la suite du nœud s'arrête à -> la collecte**. Sans `pytest-timeout`, le `timeout = 60` du `pyproject.toml` est -> une option inconnue : la protection que son propre commentaire décrit — « un -> test bloqué ne doit pas coincer le run » — n'existe pas, et pytest ne le dit que -> dans un warning parmi d'autres. Sans `ruff`, le linter du projet n'est pas là. -> `aiosqlite` n'avait pas à être cité : c'est une dépendance de runtime du hub et -> du nœud, déjà installée par les `-e`. - -> **Ne jamais copier `.venv/` entre machines d'OS différents.** Si rsync depuis Fedora vers Ubuntu, -> exclure `.venv/` et recréer sur la cible avec `python3 -m venv .venv --clear`. -> Sans `--clear`, `certifi.where()` pointe vers un chemin Fedora inexistant sur Ubuntu → `FileNotFoundError`. +The key deps (aioquic, watchdog, fastapi, blake3, etc.) are in the `pyproject.toml` files +and installed automatically. Do not add packages by hand without declaring them +in the right `pyproject.toml`. + +> **The `[dev]` extra, not a hand-written list.** This line was long +> `pip install pytest pytest-asyncio aiosqlite`, which contradicted the rule +> above and cost three invisible things. Without `piexif`, +> `test_enrich_photo.py` fails at import and **the whole node suite stops at +> collection**. Without `pytest-timeout`, the `timeout = 60` in `pyproject.toml` is +> an unknown option: the protection its own comment describes — "a +> hung test must not jam the run" — does not exist, and pytest only says so +> in one warning among others. Without `ruff`, the project's linter is not there. +> `aiosqlite` did not need to be listed: it is a runtime dependency of the hub and +> the node, already installed by the `-e`. + +> **Never copy `.venv/` between machines running different OSes.** If rsyncing from Fedora to Ubuntu, +> exclude `.venv/` and recreate it on the target with `python3 -m venv .venv --clear`. +> Without `--clear`, `certifi.where()` points to a Fedora path that does not exist on Ubuntu → `FileNotFoundError`. ```bash -# Lancer les tests +# Run the tests .venv/bin/pytest ``` -- cgit v1.2.3