@emend-ai/utim 1.46.13 → 1.46.15
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/bin/utim.js +37 -6
- package/package.json +1 -1
package/bin/utim.js
CHANGED
|
@@ -144,13 +144,44 @@ function installEngine(python) {
|
|
|
144
144
|
shell: false,
|
|
145
145
|
});
|
|
146
146
|
|
|
147
|
-
// Step 2: Install pydantic-core using
|
|
148
|
-
// This is
|
|
149
|
-
//
|
|
150
|
-
process.stderr.write('\n⚙
|
|
147
|
+
// Step 2: Install pydantic-core using an inline python script.
|
|
148
|
+
// This is 100% reliable as it uses pure python to fetch the latest eutalix release wheel and install it,
|
|
149
|
+
// avoiding dependencies on curl/wget/bash which might not be installed by default on Termux.
|
|
150
|
+
process.stderr.write('\n⚙ Downloading and installing pre-compiled pydantic-core wheel...\n\n');
|
|
151
|
+
const installScript = `
|
|
152
|
+
import sys, urllib.request, json, subprocess, os, platform
|
|
153
|
+
try:
|
|
154
|
+
arch = platform.machine().lower()
|
|
155
|
+
plat_map = {'aarch64': 'aarch64', 'armv7l': 'armv7l', 'armv8l': 'armv7l', 'x86_64': 'x86_64', 'i686': 'i686', 'i386': 'i686', 'amd64': 'x86_64'}
|
|
156
|
+
plat = plat_map.get(arch, arch)
|
|
157
|
+
py_tag = f"cp{sys.version_info.major}{sys.version_info.minor}"
|
|
158
|
+
url = "https://api.github.com/repos/Eutalix/android-pydantic-core/releases/latest"
|
|
159
|
+
req = urllib.request.Request(url, headers={'User-Agent': 'Mozilla/5.0'})
|
|
160
|
+
with urllib.request.urlopen(req) as r:
|
|
161
|
+
data = json.loads(r.read().decode())
|
|
162
|
+
wheel_url = None
|
|
163
|
+
for asset in data.get('assets', []):
|
|
164
|
+
name = asset.get('name', '')
|
|
165
|
+
if name.endswith('.whl') and py_tag in name and plat in name:
|
|
166
|
+
wheel_url = asset.get('browser_download_url')
|
|
167
|
+
break
|
|
168
|
+
if wheel_url:
|
|
169
|
+
print("[+] Found wheel:", wheel_url)
|
|
170
|
+
urllib.request.urlretrieve(wheel_url, "pydantic_core_tmp.whl")
|
|
171
|
+
subprocess.run([sys.executable, "-m", "pip", "install", "--force-reinstall", "pydantic_core_tmp.whl"], check=True)
|
|
172
|
+
if os.path.exists("pydantic_core_tmp.whl"):
|
|
173
|
+
os.remove("pydantic_core_tmp.whl")
|
|
174
|
+
print("[+] Successfully installed pydantic-core!")
|
|
175
|
+
else:
|
|
176
|
+
print("[-] No matching wheel found for", py_tag, plat)
|
|
177
|
+
sys.exit(1)
|
|
178
|
+
except Exception as e:
|
|
179
|
+
print("[-] Failed to download/install pydantic-core wheel:", e)
|
|
180
|
+
sys.exit(1)
|
|
181
|
+
`;
|
|
151
182
|
spawnSync(
|
|
152
|
-
|
|
153
|
-
['-c',
|
|
183
|
+
python,
|
|
184
|
+
['-c', installScript],
|
|
154
185
|
{ stdio: 'inherit', shell: false, timeout: 180000 }
|
|
155
186
|
);
|
|
156
187
|
|