@danhachuel/thunderbolt 0.5.44 → 0.5.45
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/scripts/install.mjs +6 -2
package/package.json
CHANGED
package/scripts/install.mjs
CHANGED
|
@@ -433,13 +433,17 @@ function installRequirementIfNeeded(requirementsPath, stateKey, modules, label)
|
|
|
433
433
|
const state = readDependencyState();
|
|
434
434
|
const importsOk = importsAvailable(modules);
|
|
435
435
|
const hashMatches = state[stateKey] === currentHash;
|
|
436
|
-
|
|
436
|
+
const markerPath = join(venvPath, `.${stateKey}.sha256`);
|
|
437
|
+
const markerHash = existsSync(markerPath) ? readFileSync(markerPath, "utf8").trim() : "";
|
|
438
|
+
const persistedHashMatches = hashMatches || markerHash === currentHash;
|
|
439
|
+
if (!forceDeps && importsOk && persistedHashMatches) {
|
|
437
440
|
console.log(`${label}: dependências detectadas e reutilizadas; nenhuma reinstalação necessária.`);
|
|
438
441
|
writeDependencyState({ [stateKey]: currentHash });
|
|
439
442
|
return;
|
|
440
443
|
}
|
|
441
444
|
console.log(`${label}: dependências ausentes, incompletas ou alteradas; a instalar agora.`);
|
|
442
445
|
run(pythonBin, ["-m", "pip", "install", "-r", requirementsPath]);
|
|
446
|
+
writeFileSync(markerPath, `${currentHash}\n`, "utf8");
|
|
443
447
|
writeDependencyState({ [stateKey]: currentHash });
|
|
444
448
|
}
|
|
445
449
|
|
|
@@ -461,7 +465,7 @@ function writeSettings(moneyprinterPath) {
|
|
|
461
465
|
|
|
462
466
|
function installThunderboltDependencies(python) {
|
|
463
467
|
if (!existsSync(pythonBin)) run(python.command, [...python.args, "-m", "venv", venvPath]);
|
|
464
|
-
installRequirementIfNeeded(join(root, "requirements.txt"), "thunderbolt_requirements_sha256", ["streamlit", "requests", "pandas", "toml", "imageio_ffmpeg", "edge_tts", "google.auth", "google_auth_oauthlib", "googleapiclient"], "Thunderbolt");
|
|
468
|
+
installRequirementIfNeeded(join(root, "requirements.txt"), "thunderbolt_requirements_sha256", ["streamlit", "requests", "pandas", "toml", "imageio_ffmpeg", "edge_tts", "google.auth", "google_auth_oauthlib", "googleapiclient", "yt_dlp", "youtube_transcript_api"], "Thunderbolt");
|
|
465
469
|
}
|
|
466
470
|
|
|
467
471
|
function installMoneyPrinterDependencies(moneyprinterPath) {
|