@emend-ai/utim 1.46.9 ā 1.46.12
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 -41
- 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 (_) {
|
|
@@ -127,52 +134,41 @@ function installEngine(python) {
|
|
|
127
134
|
let termuxFlags = [];
|
|
128
135
|
if (isTermux) {
|
|
129
136
|
process.stderr.write(
|
|
130
|
-
'\nš” Termux detected.
|
|
137
|
+
'\nš” Termux detected. Preparing Android-compatible dependencies...\n\n'
|
|
131
138
|
);
|
|
132
139
|
|
|
133
|
-
// Step 1:
|
|
134
|
-
spawnSync('pkg', ['
|
|
135
|
-
stdio: 'inherit',
|
|
136
|
-
shell: false,
|
|
137
|
-
});
|
|
138
|
-
|
|
139
|
-
// Step 2: upgrade pip/setuptools/wheel first
|
|
140
|
-
spawnSync(python, ['-m', 'pip', 'install', '--upgrade', '--quiet', 'pip', 'setuptools', 'wheel'], {
|
|
141
|
-
stdio: 'pipe',
|
|
142
|
-
shell: false,
|
|
143
|
-
timeout: 60000,
|
|
144
|
-
});
|
|
140
|
+
// Step 1: upgrade pkg repo list
|
|
141
|
+
spawnSync('pkg', ['update', '-y'], { stdio: 'pipe', shell: false, timeout: 30000 });
|
|
145
142
|
|
|
146
|
-
// Step
|
|
147
|
-
//
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
[
|
|
152
|
-
'-m', 'pip', 'install', '--upgrade', '--quiet',
|
|
153
|
-
'pydantic-core',
|
|
154
|
-
'--extra-index-url', 'https://eutalix.github.io/android-pydantic-core/',
|
|
155
|
-
],
|
|
143
|
+
// Step 2: install pydantic via Termux's own compiled package.
|
|
144
|
+
// This is the ONLY reliable way to get pydantic-core on Android without
|
|
145
|
+
// a Rust toolchain. pkg ships a prebuilt binary for aarch64-linux-android.
|
|
146
|
+
process.stderr.write('ā Installing pydantic via Termux package manager...\n\n');
|
|
147
|
+
const pkgResult = spawnSync(
|
|
148
|
+
'pkg', ['install', '-y', 'python-pydantic', 'python-cryptography'],
|
|
156
149
|
{ stdio: 'inherit', shell: false, timeout: 120000 }
|
|
157
150
|
);
|
|
158
151
|
|
|
159
|
-
if (
|
|
152
|
+
if (pkgResult.status !== 0) {
|
|
160
153
|
process.stderr.write(
|
|
161
|
-
'\nā
|
|
154
|
+
'\nā pkg install failed ā will try pip with prebuilt wheel index as fallback...\n\n'
|
|
162
155
|
);
|
|
163
|
-
// Fallback:
|
|
156
|
+
// Fallback: Eutalix prebuilt wheels (works for Python 3.11/3.12)
|
|
164
157
|
spawnSync(
|
|
165
158
|
python,
|
|
166
|
-
[
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
'--extra-index-url', 'https://termux-user-repository.github.io/pypi/',
|
|
170
|
-
],
|
|
159
|
+
['-m', 'pip', 'install', '--upgrade', '--quiet',
|
|
160
|
+
'pydantic-core', 'pydantic',
|
|
161
|
+
'--extra-index-url', 'https://eutalix.github.io/android-pydantic-core/'],
|
|
171
162
|
{ stdio: 'inherit', shell: false, timeout: 120000 }
|
|
172
163
|
);
|
|
173
164
|
}
|
|
174
165
|
|
|
175
|
-
//
|
|
166
|
+
// Step 3: upgrade pip/setuptools/wheel
|
|
167
|
+
spawnSync(python, ['-m', 'pip', 'install', '--upgrade', '--quiet', 'pip', 'setuptools', 'wheel'], {
|
|
168
|
+
stdio: 'pipe', shell: false, timeout: 60000,
|
|
169
|
+
});
|
|
170
|
+
|
|
171
|
+
// Extra index as safety net for any remaining Rust-based transitive deps
|
|
176
172
|
termuxFlags = [
|
|
177
173
|
'--extra-index-url', 'https://eutalix.github.io/android-pydantic-core/',
|
|
178
174
|
'--extra-index-url', 'https://termux-user-repository.github.io/pypi/',
|