@emend-ai/utim 1.46.10 ā 1.46.13
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 +42 -32
- package/package.json +1 -1
package/bin/utim.js
CHANGED
|
@@ -107,15 +107,22 @@ function runPip(python, extraFlags) {
|
|
|
107
107
|
return isUtimInstalled(python);
|
|
108
108
|
} else {
|
|
109
109
|
// Linux / Termux fallback: run in current terminal
|
|
110
|
-
const
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
110
|
+
const pipArgs = ['-m', 'pip', 'install'];
|
|
111
|
+
if (isTermux) {
|
|
112
|
+
// On Termux: do NOT use --upgrade to prevent pip from pulling newer
|
|
113
|
+
// versions of pydantic-core from PyPI and trying to compile from source.
|
|
114
|
+
// Instead, use --upgrade-strategy only-if-needed to keep the pre-compiled version.
|
|
115
|
+
pipArgs.push('--upgrade-strategy', 'only-if-needed');
|
|
116
|
+
} else {
|
|
117
|
+
pipArgs.push('--upgrade');
|
|
118
|
+
}
|
|
119
|
+
pipArgs.push(...extraFlags, 'utim-cli');
|
|
120
|
+
|
|
121
|
+
const r = spawnSync(python, pipArgs, {
|
|
122
|
+
stdio: 'inherit',
|
|
123
|
+
shell: false,
|
|
124
|
+
timeout: 300000,
|
|
125
|
+
});
|
|
119
126
|
return r.status === 0;
|
|
120
127
|
}
|
|
121
128
|
} catch (_) {
|
|
@@ -130,33 +137,36 @@ function installEngine(python) {
|
|
|
130
137
|
'\nš” Termux detected. Preparing Android-compatible dependencies...\n\n'
|
|
131
138
|
);
|
|
132
139
|
|
|
133
|
-
// Step 1:
|
|
134
|
-
|
|
140
|
+
// Step 1: Install python-cryptography via pkg to avoid heavy cryptography C/Rust compilation
|
|
141
|
+
process.stderr.write('ā Installing python-cryptography via Termux package manager...\n\n');
|
|
142
|
+
spawnSync('pkg', ['install', '-y', 'python-cryptography'], {
|
|
143
|
+
stdio: 'inherit',
|
|
144
|
+
shell: false,
|
|
145
|
+
});
|
|
135
146
|
|
|
136
|
-
// Step 2:
|
|
137
|
-
// This is the
|
|
138
|
-
//
|
|
139
|
-
process.stderr.write('ā
|
|
140
|
-
|
|
141
|
-
'
|
|
142
|
-
|
|
147
|
+
// Step 2: Install pydantic-core using the Eutalix community shell installer script.
|
|
148
|
+
// This is the only bulletproof way to download the pre-compiled Android aarch64 wheel
|
|
149
|
+
// for Python 3.13+ without triggering compiling from Rust source.
|
|
150
|
+
process.stderr.write('\nā Running precompiled pydantic-core Android wheel installer...\n\n');
|
|
151
|
+
spawnSync(
|
|
152
|
+
'sh',
|
|
153
|
+
['-c', 'curl -sL https://raw.githubusercontent.com/Eutalix/android-pydantic-core/main/install_pydantic_core.sh | bash'],
|
|
154
|
+
{ stdio: 'inherit', shell: false, timeout: 180000 }
|
|
143
155
|
);
|
|
144
156
|
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
);
|
|
157
|
-
}
|
|
157
|
+
// Step 3: Install pydantic v2 from the extra index (WITHOUT --upgrade, so it uses the local pre-built wheel)
|
|
158
|
+
process.stderr.write('\nā Installing pydantic v2 (pre-compiled wheel)...\n\n');
|
|
159
|
+
spawnSync(
|
|
160
|
+
python,
|
|
161
|
+
[
|
|
162
|
+
'-m', 'pip', 'install',
|
|
163
|
+
'pydantic',
|
|
164
|
+
'--extra-index-url', 'https://eutalix.github.io/android-pydantic-core/',
|
|
165
|
+
],
|
|
166
|
+
{ stdio: 'inherit', shell: false, timeout: 120000 }
|
|
167
|
+
);
|
|
158
168
|
|
|
159
|
-
// Step
|
|
169
|
+
// Step 4: Upgrade pip/setuptools/wheel
|
|
160
170
|
spawnSync(python, ['-m', 'pip', 'install', '--upgrade', '--quiet', 'pip', 'setuptools', 'wheel'], {
|
|
161
171
|
stdio: 'pipe', shell: false, timeout: 60000,
|
|
162
172
|
});
|