diff --git a/agent_v0/agent_v1/requirements.txt b/agent_v0/agent_v1/requirements.txt index e1a07c190..2067ac802 100644 --- a/agent_v0/agent_v1/requirements.txt +++ b/agent_v0/agent_v1/requirements.txt @@ -3,6 +3,7 @@ mss>=9.0.1 # Capture d'écran haute performance pynput>=1.7.7 # Clavier/Souris Cross-plateforme Pillow>=10.0.0 # Crops et processing image requests>=2.31.0 # Streaming réseau +httpx>=0.27 # Client HTTP orchestrateur Léa (POST /api/learn/start) — brique conversationnelle python-socketio[client]>=5.10,<6.0 # Bus feedback Léa 'lea:*' (compat Flask-SocketIO 5.3.x serveur) psutil>=5.9.0 # Monitoring CPU/RAM screeninfo>=0.8 # QW1 — détection des monitors physiques + offsets diff --git a/deploy/build_package_full.sh b/deploy/build_package_full.sh index 6947926bd..2c5ecc581 100755 --- a/deploy/build_package_full.sh +++ b/deploy/build_package_full.sh @@ -208,6 +208,7 @@ REQUIRED=( "Lea/python-embed/Lib/site-packages/mss" "Lea/python-embed/Lib/site-packages/win32" "Lea/python-embed/Lib/site-packages/socketio" + "Lea/python-embed/Lib/site-packages/httpx" ) MISSING=() for f in "${REQUIRED[@]}"; do diff --git a/deploy/installer/README.md b/deploy/installer/README.md index db5cf39d3..5ba0348b1 100644 --- a/deploy/installer/README.md +++ b/deploy/installer/README.md @@ -81,16 +81,29 @@ cd deploy/installer wget https://www.python.org/ftp/python/3.12.8/python-3.12.8-embed-amd64.zip mkdir python-3.12-embed unzip python-3.12.8-embed-amd64.zip -d python-3.12-embed/ + +# IMPORTANT : l'embed doit contenir TOUTES les dependances HORS LIGNE. +# Le runtime client ne fait AUCUN pip/reseau (POC clinique). On installe donc +# les dependances une fois dans l'embed, puis on le commit/reutilise tel quel : +python312._pth # decommenter 'import site' +python -m pip install --target python-3.12-embed/Lib/site-packages \ + -r ../lea_package/requirements_agent.txt +# => doit inclure httpx (+ httpcore, h11) pour l'orchestrateur Lea (POST /api/learn/start). ``` Le staging copie automatiquement ce dossier si present. Le composant "pythonembed" devient alors selectionnable dans l'installeur. -Le script `configure_embed.ps1` : +Le script `configure_embed.ps1` (execute a l'installation, sur le poste) : 1. Patche `python312._pth` pour activer `import site` -2. Installe `pip` via `get-pip.py` -3. Installe `requirements_agent.txt` -4. Reecrit `Lea.bat` pour pointer sur `python-embed\pythonw.exe` +2. VERIFIE que les dependances sont deja embarquees (offline, aucun pip/reseau) — + `socketio, tkinter, mss, pynput, pystray, plyer, requests, httpx, PIL, win32api` ; + si une dependance manque, l'installation echoue explicitement. +3. Reecrit `Lea.bat` pour pointer sur `python-embed\pythonw.exe` + +> Note : `build_installer.sh` et `build_package_full.sh` valident aussi la presence +> des paquets (dont `httpx`, `httpcore`, `h11`) dans `Lib/site-packages/` avant de +> produire le paquet — un embed incomplet interrompt le build cote Linux. ## Installation silencieuse (deploiement de masse) diff --git a/deploy/installer/build_installer.sh b/deploy/installer/build_installer.sh index 7507e8e0a..e82bff38e 100755 --- a/deploy/installer/build_installer.sh +++ b/deploy/installer/build_installer.sh @@ -154,6 +154,7 @@ REQUIRED_EMBED=( "Lib/site-packages/pystray" "Lib/site-packages/plyer" "Lib/site-packages/requests" "Lib/site-packages/PIL" "Lib/site-packages/win32" + "Lib/site-packages/httpx" "Lib/site-packages/httpcore" "Lib/site-packages/h11" ) MISSING_EMBED=() for f in "${REQUIRED_EMBED[@]}"; do diff --git a/deploy/installer/configure_embed.ps1 b/deploy/installer/configure_embed.ps1 index fffd916ef..5f6b2b6dd 100644 --- a/deploy/installer/configure_embed.ps1 +++ b/deploy/installer/configure_embed.ps1 @@ -44,7 +44,7 @@ if ($PthFile) { # L'embed DOIT contenir toutes les dependances runtime. # AUCUN pip, AUCUN reseau : si une dependance manque -> echec explicite. # --------------------------------------------------------------- -$RequiredModules = @('socketio','tkinter','mss','pynput','pystray','plyer','requests','PIL','win32api') +$RequiredModules = @('socketio','tkinter','mss','pynput','pystray','plyer','requests','httpx','PIL','win32api') $Missing = @() foreach ($m in $RequiredModules) { & $PythonExe -c "import $m" 2>$null diff --git a/deploy/lea_package/requirements_agent.txt b/deploy/lea_package/requirements_agent.txt index 5a1beefbd..ccad751b7 100644 --- a/deploy/lea_package/requirements_agent.txt +++ b/deploy/lea_package/requirements_agent.txt @@ -5,6 +5,7 @@ mss>=9.0.1 # Capture d'ecran haute performance pynput>=1.7.7 # Clavier/Souris Pillow>=10.0.0 # Traitement image (crops, compression) requests>=2.31.0 # Communication serveur +httpx>=0.27 # Client HTTP orchestrateur Lea (POST /api/learn/start) - brique conversationnelle psutil>=5.9.0 # Monitoring CPU/RAM pystray>=0.19.5 # Icone systray plyer>=2.1.0 # Notifications toast natives