From 4df6a0f703b0ceef05a84de602f7402d9f6778e4 Mon Sep 17 00:00:00 2001 From: Anastasiia Sliusar Date: Fri, 27 Sep 2024 13:54:15 +0200 Subject: [PATCH 1/2] Allowing to use a package url --- include/pyjs/pre_js/load_pkg.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/pyjs/pre_js/load_pkg.js b/include/pyjs/pre_js/load_pkg.js index d8e573a..d807f19 100644 --- a/include/pyjs/pre_js/load_pkg.js +++ b/include/pyjs/pre_js/load_pkg.js @@ -108,7 +108,7 @@ Module["bootstrap_from_empack_packed_environment"] = async function pkg, verbose ) { - let package_url = `${package_tarballs_root_url}/${pkg.filename}` + let package_url = pkg?.url ? pkg.url :`${package_tarballs_root_url}/${pkg.filename}` if (verbose) { console.log(`!!fetching pkg ${pkg.name} from ${package_url}`) } @@ -126,7 +126,7 @@ Module["bootstrap_from_empack_packed_environment"] = async function async function bootstrap_python(prefix, package_tarballs_root_url, python_package, verbose) { // fetch python package - let python_package_url = `${package_tarballs_root_url}/${python_package.filename}` + let python_package_url = python_package?.url ? python_package.url : `${package_tarballs_root_url}/${python_package.filename}` if (verbose) { console.log(`fetching python package from ${python_package_url}`) From ce55e79ebc3942f5e2e34c67563186806f52799e Mon Sep 17 00:00:00 2001 From: Anastasiia Sliusar Date: Mon, 30 Sep 2024 10:32:40 +0200 Subject: [PATCH 2/2] Refactoring --- include/pyjs/pre_js/load_pkg.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/pyjs/pre_js/load_pkg.js b/include/pyjs/pre_js/load_pkg.js index d807f19..52091f0 100644 --- a/include/pyjs/pre_js/load_pkg.js +++ b/include/pyjs/pre_js/load_pkg.js @@ -108,7 +108,7 @@ Module["bootstrap_from_empack_packed_environment"] = async function pkg, verbose ) { - let package_url = pkg?.url ? pkg.url :`${package_tarballs_root_url}/${pkg.filename}` + const package_url = pkg?.url ?? `${package_tarballs_root_url}/${pkg.filename}`; if (verbose) { console.log(`!!fetching pkg ${pkg.name} from ${package_url}`) } @@ -126,7 +126,7 @@ Module["bootstrap_from_empack_packed_environment"] = async function async function bootstrap_python(prefix, package_tarballs_root_url, python_package, verbose) { // fetch python package - let python_package_url = python_package?.url ? python_package.url : `${package_tarballs_root_url}/${python_package.filename}` + const python_package_url = python_package?.url ?? `${package_tarballs_root_url}/${python_package.filename}`; if (verbose) { console.log(`fetching python package from ${python_package_url}`)