aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristophe Besson <cbesson@gmail.com>2026-08-09 22:28:47 +0200
committerChristophe Besson <cbesson@gmail.com>2026-08-09 22:28:47 +0200
commit82ce18ef9f45f817505b12e24c958beda45465f0 (patch)
tree2e33da4474b33153a1071281b0c03af447a76ea7
parenta4dbeb368d19f6afc0f6da3819c8e0d6242b0732 (diff)
downloadmeshbay-82ce18ef9f45f817505b12e24c958beda45465f0.tar.gz
fix: complete pyproject.toml deps + graceful QUIC fallback
meshbay-node/pyproject.toml: add aioquic>=1.0 (was commented 'v2'), websockets>=12.0 (revocation push). Both are production code since Phase 5. meshbay-hub/pyproject.toml: add aiosqlite (tests without PostgreSQL), slowapi (rate limiting), websockets (revocation push), PyJWT (explicit). transport/__init__.py: QUIC imports wrapped in try/except — node works without aioquic (TCP+TLS + HTTP fallback). QUIC_AVAILABLE flag exported. QUICKSTART.md: replace manual pip list with 'pip install -e' that pulls all deps from pyproject.toml automatically. Add dependency table. CLAUDE.md: clarify that all deps go in pyproject.toml, not manual installs. 81/81 tests. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
-rw-r--r--CLAUDE.md13
-rw-r--r--docs/QUICKSTART.md29
-rw-r--r--packages/meshbay-hub/pyproject.toml6
-rw-r--r--packages/meshbay-node/pyproject.toml11
-rw-r--r--packages/meshbay-node/src/meshbay_node/transport/__init__.py19
5 files changed, 57 insertions, 21 deletions
diff --git a/CLAUDE.md b/CLAUDE.md
index 6293bdb..32c4e8b 100644
--- a/CLAUDE.md
+++ b/CLAUDE.md
@@ -32,12 +32,19 @@ Jamais de processus orphelins ni de ports ouverts après un test.
- **Build backend:** hatchling (per package `pyproject.toml`)
```bash
-# Créer le venv et installer les packages
-python3 -m venv .venv && source .venv/bin/activate
+# Créer le venv (--clear si recréation sur une autre 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
pip install -e packages/meshbay-common -e packages/meshbay-hub -e packages/meshbay-node
-pip install httpx blake3 uvicorn pytest pytest-asyncio
+pip install pytest pytest-asyncio aiosqlite # extras 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`.
+
> **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`.
diff --git a/docs/QUICKSTART.md b/docs/QUICKSTART.md
index 2fa5af0..ca3beee 100644
--- a/docs/QUICKSTART.md
+++ b/docs/QUICKSTART.md
@@ -14,21 +14,34 @@ Le node tourne sur votre machine et héberge vos fichiers.
```bash
cd ~/meshbay # le dépôt local (pas encore publié sur GitHub)
-python3 -m venv .venv && source .venv/bin/activate
```
-> **Important — ne pas copier `.venv/` entre machines d'OS différents.**
-> Le venv est spécifique à l'OS. Si vous avez cloné/copié le repo depuis une machine Fedora
-> vers Ubuntu (ou inversement), le venv doit être recréé avec `--clear` :
+> **Si vous synchez le repo depuis une autre machine (rsync, scp)** :
+> ne pas copier `.venv/` — il est lié à l'OS source et casse pip sur l'OS cible.
+> Toujours recréer le venv avec `--clear` sur la machine cible.
```bash
-python3 -m venv .venv --clear # ← --clear force la recréation propre
+# Créer (ou recréer proprement) le venv
+python3 -m venv .venv --clear
source .venv/bin/activate
-pip install -e packages/meshbay-common -e packages/meshbay-node httpx blake3 uvicorn
+
+# Installer les packages — les dépendances (aioquic, watchdog, etc.) viennent automatiquement
+pip install -e packages/meshbay-common -e packages/meshbay-node -e packages/meshbay-hub
```
-Sans `--clear`, pip peut échouer avec `FileNotFoundError` dans `certifi` parce qu'il
-cherche les certificats CA à un chemin valide sur l'OS d'origine mais absent sur l'OS cible.
+Les dépendances déclarées dans les `pyproject.toml` sont installées automatiquement :
+
+| Package | Vient de | Rôle |
+|---|---|---|
+| `cryptography` | meshbay-common | crypto (Ed25519, ChaCha20, Argon2id) |
+| `PyJWT` | meshbay-common | JWT EdDSA |
+| `blake3`, `msgpack`, `zstandard` | meshbay-common | hashing, sérialisation, compression |
+| `fastapi`, `uvicorn` | meshbay-node | HTTP API + UI locale |
+| `httpx` | meshbay-node | client hub |
+| `watchdog` | meshbay-node | surveillance répertoire |
+| `aioquic` | meshbay-node | transport QUIC (MNP v2) |
+| `aioice` | meshbay-node | ICE/STUN NAT traversal |
+| `websockets` | meshbay-node | notifications hub→node |
---
diff --git a/packages/meshbay-hub/pyproject.toml b/packages/meshbay-hub/pyproject.toml
index e0a880a..5487a6a 100644
--- a/packages/meshbay-hub/pyproject.toml
+++ b/packages/meshbay-hub/pyproject.toml
@@ -13,8 +13,12 @@ dependencies = [
"uvicorn[standard]>=0.30",
"sqlalchemy>=2.0",
"alembic>=1.13",
- "asyncpg>=0.30", # PostgreSQL async driver
+ "asyncpg>=0.30", # PostgreSQL async driver
+ "aiosqlite>=0.20", # SQLite async (tests + dev without PostgreSQL)
"httpx>=0.28",
+ "slowapi>=0.1", # rate limiting
+ "PyJWT>=2.9", # JWT EdDSA (also in meshbay-common but explicit here)
+ "websockets>=12.0", # hub→node revocation push
]
[project.optional-dependencies]
diff --git a/packages/meshbay-node/pyproject.toml b/packages/meshbay-node/pyproject.toml
index 48231ad..805871e 100644
--- a/packages/meshbay-node/pyproject.toml
+++ b/packages/meshbay-node/pyproject.toml
@@ -9,12 +9,13 @@ description = "MeshBay Node — local file host, streaming server, and group dae
requires-python = ">=3.12"
dependencies = [
"meshbay-common>=0.1.0",
- "fastapi>=0.115", # local web UI on localhost:18000
+ "fastapi>=0.115", # local web UI on localhost:18000
"uvicorn[standard]>=0.30",
- "httpx>=0.28", # hub client
- "watchdog>=5.0", # directory monitoring
- "aioice>=0.9", # ICE/STUN for NAT traversal
- # aioquic>=1.0 added in v2 (QUIC transport)
+ "httpx>=0.28", # hub client
+ "watchdog>=5.0", # directory monitoring
+ "aioice>=0.9", # ICE/STUN for NAT traversal
+ "aioquic>=1.0", # QUIC transport (MNP v2) — implemented in Phase 5
+ "websockets>=12.0", # hub→node revocation push
]
[project.optional-dependencies]
diff --git a/packages/meshbay-node/src/meshbay_node/transport/__init__.py b/packages/meshbay-node/src/meshbay_node/transport/__init__.py
index 8b49b22..b3144a6 100644
--- a/packages/meshbay-node/src/meshbay_node/transport/__init__.py
+++ b/packages/meshbay-node/src/meshbay_node/transport/__init__.py
@@ -2,8 +2,19 @@
from .server import ChunkServer
from .client import ChunkClient
from .http_server import create_http_app
-from .quic_server import QuicChunkServer
-from .quic_client import QuicChunkClient
-__all__ = ["ChunkServer", "ChunkClient", "create_http_app",
- "QuicChunkServer", "QuicChunkClient"]
+# QUIC transport (MNP v2) — requires aioquic>=1.0
+# Falls back gracefully if not installed; node still works via TCP+TLS and HTTP.
+try:
+ from .quic_server import QuicChunkServer
+ from .quic_client import QuicChunkClient
+ QUIC_AVAILABLE = True
+except ImportError:
+ QuicChunkServer = None # type: ignore[assignment,misc]
+ QuicChunkClient = None # type: ignore[assignment,misc]
+ QUIC_AVAILABLE = False
+
+__all__ = [
+ "ChunkServer", "ChunkClient", "create_http_app",
+ "QuicChunkServer", "QuicChunkClient", "QUIC_AVAILABLE",
+]