@emend-ai/utim 1.46.15 → 1.46.18
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 +19 -17
- package/package.json +1 -1
package/bin/utim.js
CHANGED
|
@@ -144,10 +144,11 @@ function installEngine(python) {
|
|
|
144
144
|
shell: false,
|
|
145
145
|
});
|
|
146
146
|
|
|
147
|
-
// Step 2: Install pydantic-core using an inline python script.
|
|
148
|
-
// This is 100% reliable as it
|
|
149
|
-
//
|
|
150
|
-
|
|
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');
|
|
151
152
|
const installScript = `
|
|
152
153
|
import sys, urllib.request, json, subprocess, os, platform
|
|
153
154
|
try:
|
|
@@ -171,7 +172,20 @@ try:
|
|
|
171
172
|
subprocess.run([sys.executable, "-m", "pip", "install", "--force-reinstall", "pydantic_core_tmp.whl"], check=True)
|
|
172
173
|
if os.path.exists("pydantic_core_tmp.whl"):
|
|
173
174
|
os.remove("pydantic_core_tmp.whl")
|
|
174
|
-
|
|
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!")
|
|
175
189
|
else:
|
|
176
190
|
print("[-] No matching wheel found for", py_tag, plat)
|
|
177
191
|
sys.exit(1)
|
|
@@ -185,18 +199,6 @@ except Exception as e:
|
|
|
185
199
|
{ stdio: 'inherit', shell: false, timeout: 180000 }
|
|
186
200
|
);
|
|
187
201
|
|
|
188
|
-
// Step 3: Install pydantic v2 from the extra index (WITHOUT --upgrade, so it uses the local pre-built wheel)
|
|
189
|
-
process.stderr.write('\n⚙ Installing pydantic v2 (pre-compiled wheel)...\n\n');
|
|
190
|
-
spawnSync(
|
|
191
|
-
python,
|
|
192
|
-
[
|
|
193
|
-
'-m', 'pip', 'install',
|
|
194
|
-
'pydantic',
|
|
195
|
-
'--extra-index-url', 'https://eutalix.github.io/android-pydantic-core/',
|
|
196
|
-
],
|
|
197
|
-
{ stdio: 'inherit', shell: false, timeout: 120000 }
|
|
198
|
-
);
|
|
199
|
-
|
|
200
202
|
// Step 4: Upgrade pip/setuptools/wheel
|
|
201
203
|
spawnSync(python, ['-m', 'pip', 'install', '--upgrade', '--quiet', 'pip', 'setuptools', 'wheel'], {
|
|
202
204
|
stdio: 'pipe', shell: false, timeout: 60000,
|