@emend-ai/utim 1.46.14 → 1.46.16
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 +51 -18
- package/package.json +1 -1
package/bin/utim.js
CHANGED
|
@@ -144,26 +144,59 @@ function installEngine(python) {
|
|
|
144
144
|
shell: false,
|
|
145
145
|
});
|
|
146
146
|
|
|
147
|
-
// Step 2: Install pydantic-core
|
|
148
|
-
// This is
|
|
149
|
-
//
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
147
|
+
// Step 2: Install pydantic-core and matching pydantic v2 using an inline python script.
|
|
148
|
+
// This is 100% reliable as it first installs the precompiled Eutalix wheel, and then tells pip
|
|
149
|
+
// to install pydantic pinned to that exact pydantic-core version. This forces pip's backtracking resolver
|
|
150
|
+
// to download the compatible pydantic version from PyPI without upgrading pydantic-core and triggering compiling from source.
|
|
151
|
+
process.stderr.write('\n⚙ Downloading and installing pre-compiled pydantic-core wheel and pydantic...\n\n');
|
|
152
|
+
const installScript = `
|
|
153
|
+
import sys, urllib.request, json, subprocess, os, platform
|
|
154
|
+
try:
|
|
155
|
+
arch = platform.machine().lower()
|
|
156
|
+
plat_map = {'aarch64': 'aarch64', 'armv7l': 'armv7l', 'armv8l': 'armv7l', 'x86_64': 'x86_64', 'i686': 'i686', 'i386': 'i686', 'amd64': 'x86_64'}
|
|
157
|
+
plat = plat_map.get(arch, arch)
|
|
158
|
+
py_tag = f"cp{sys.version_info.major}{sys.version_info.minor}"
|
|
159
|
+
url = "https://api.github.com/repos/Eutalix/android-pydantic-core/releases/latest"
|
|
160
|
+
req = urllib.request.Request(url, headers={'User-Agent': 'Mozilla/5.0'})
|
|
161
|
+
with urllib.request.urlopen(req) as r:
|
|
162
|
+
data = json.loads(r.read().decode())
|
|
163
|
+
wheel_url = None
|
|
164
|
+
for asset in data.get('assets', []):
|
|
165
|
+
name = asset.get('name', '')
|
|
166
|
+
if name.endswith('.whl') and py_tag in name and plat in name:
|
|
167
|
+
wheel_url = asset.get('browser_download_url')
|
|
168
|
+
break
|
|
169
|
+
if wheel_url:
|
|
170
|
+
print("[+] Found wheel:", wheel_url)
|
|
171
|
+
urllib.request.urlretrieve(wheel_url, "pydantic_core_tmp.whl")
|
|
172
|
+
subprocess.run([sys.executable, "-m", "pip", "install", "--force-reinstall", "pydantic_core_tmp.whl"], check=True)
|
|
173
|
+
if os.path.exists("pydantic_core_tmp.whl"):
|
|
174
|
+
os.remove("pydantic_core_tmp.whl")
|
|
175
|
+
|
|
176
|
+
# Determine the installed pydantic-core version dynamically
|
|
177
|
+
import pydantic_core
|
|
178
|
+
ver = pydantic_core.__version__
|
|
179
|
+
print(f"[+] Installed pydantic-core version: {ver}")
|
|
180
|
+
print("[+] Installing compatible pydantic version...")
|
|
181
|
+
|
|
182
|
+
# Install pydantic pinned to the exact installed pydantic-core version to prevent upgrading
|
|
183
|
+
subprocess.run([
|
|
184
|
+
sys.executable, "-m", "pip", "install",
|
|
185
|
+
f"pydantic-core=={ver}", "pydantic",
|
|
186
|
+
"--extra-index-url", "https://eutalix.github.io/android-pydantic-core/"
|
|
187
|
+
], check=True)
|
|
188
|
+
print("[+] Successfully installed pydantic-core and matching pydantic!")
|
|
189
|
+
else:
|
|
190
|
+
print("[-] No matching wheel found for", py_tag, plat)
|
|
191
|
+
sys.exit(1)
|
|
192
|
+
except Exception as e:
|
|
193
|
+
print("[-] Failed to download/install pydantic-core wheel:", e)
|
|
194
|
+
sys.exit(1)
|
|
195
|
+
`;
|
|
159
196
|
spawnSync(
|
|
160
197
|
python,
|
|
161
|
-
[
|
|
162
|
-
|
|
163
|
-
'pydantic',
|
|
164
|
-
'--extra-index-url', 'https://eutalix.github.io/android-pydantic-core/',
|
|
165
|
-
],
|
|
166
|
-
{ stdio: 'inherit', shell: false, timeout: 120000 }
|
|
198
|
+
['-c', installScript],
|
|
199
|
+
{ stdio: 'inherit', shell: false, timeout: 180000 }
|
|
167
200
|
);
|
|
168
201
|
|
|
169
202
|
// Step 4: Upgrade pip/setuptools/wheel
|