(venv_path: Path, required_pkgs)
| 46 | return False |
| 47 | |
| 48 | def _create_venv(venv_path: Path, required_pkgs): |
| 49 | py = _venv_python_path(venv_path) |
| 50 | print("[*] Creazione ambiente virtuale...") |
| 51 | subprocess.run([sys.executable, "-m", "venv", str(venv_path)], check=True) |
| 52 | subprocess.run([str(py), "-m", "pip", "install", "--upgrade", "pip"], check=True) |
| 53 | print("[*] Installazione dipendenze Python (incluso Playwright)...") |
| 54 | subprocess.run([str(py), "-m", "pip", "install", *required_pkgs], check=True) |
| 55 | print("[*] Installazione browser invisibile...") |
| 56 | subprocess.run([str(py), "-m", "playwright", "install", "chromium"], check=True) |
| 57 | return py |
| 58 | |
| 59 | def _sync_venv_packages(py_path: Path, required_pkgs): |
| 60 | print("[*] Verifica/allineamento dipendenze nella .venv...") |
no test coverage detected