zcatalyst-cli 1.14.0 → 1.14.1
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/lib/init/dependencies/python/pip-install.js +17 -3
- package/lib/serve/server/lib/java/lib/catalyst-cli-java-runtime-1.0.0.jar +0 -0
- package/lib/serve/server/lib/java/lib/catalyst-function-sdk-1.0.0.jar +0 -0
- package/lib/serve/server/lib/java/lib/catalyst-java-runtime-1.0.0.jar +0 -0
- package/package.json +1 -1
|
@@ -26,6 +26,7 @@ const ensure_python_1 = require("./ensure-python");
|
|
|
26
26
|
const userConfig_1 = __importDefault(require("../../../userConfig"));
|
|
27
27
|
const sdkPipOpts = (0, env_1.envOverride)('CATALYST_SDK_PIP_OPTS', 'zcatalyst-sdk');
|
|
28
28
|
const cliqSdkPipOpts = (0, env_1.envOverride)('CATALYST_CLIQ_SDK_PIP_OPTS', 'zcatalyst-cliq');
|
|
29
|
+
const testPypi = (0, env_1.envOverride)('CATALYST_TEST_PYPI', 'false');
|
|
29
30
|
exports.default = (pth, stack, isIntegFn = false, integService = false) => __awaiter(void 0, void 0, void 0, function* () {
|
|
30
31
|
const stackVersion = stack.replace('python_', '');
|
|
31
32
|
const ans = yield prompt_1.default.ask(prompt_1.default.question('pipInstall', 'Do you wish to install all dependency libraries now ? ', {
|
|
@@ -76,7 +77,14 @@ function ensurePyRuntime(pth, stack) {
|
|
|
76
77
|
}
|
|
77
78
|
yield new Promise((resolve, reject) => {
|
|
78
79
|
var _a;
|
|
79
|
-
const
|
|
80
|
+
const spawnOpts = ['-m', 'pip', 'install', runtimePkgName, '--upgrade', '-t', './python'];
|
|
81
|
+
if (testPypi === 'true') {
|
|
82
|
+
spawnOpts.push('-i', 'https://test.pypi.org/simple/', '--extra-index-url', 'https://pypi.org/simple/');
|
|
83
|
+
}
|
|
84
|
+
const child = (0, shell_1.spawn)(userConfig_1.default.get(`python${stackVersion}.bin`), spawnOpts, {
|
|
85
|
+
cwd: pth,
|
|
86
|
+
stdio: 'pipe'
|
|
87
|
+
}).RAW();
|
|
80
88
|
const errData = [];
|
|
81
89
|
(_a = child.stderr) === null || _a === void 0 ? void 0 : _a.on('data', (chunk) => {
|
|
82
90
|
errData.push(chunk);
|
|
@@ -104,16 +112,19 @@ function ensurePyRuntime(pth, stack) {
|
|
|
104
112
|
}
|
|
105
113
|
}
|
|
106
114
|
catch (err) {
|
|
107
|
-
fs_1.ASYNC.deleteDir(runtimeDir);
|
|
115
|
+
yield fs_1.ASYNC.deleteDir(runtimeDir);
|
|
108
116
|
throw new error_1.default(`Error while installing python${stackVersion.replace('_', '.')} runtime dependencies`);
|
|
109
117
|
}
|
|
110
118
|
});
|
|
111
119
|
}
|
|
112
120
|
exports.ensurePyRuntime = ensurePyRuntime;
|
|
113
121
|
const pypiRes = (pkg) => __awaiter(void 0, void 0, void 0, function* () {
|
|
122
|
+
const url = testPypi === 'true'
|
|
123
|
+
? `https://test.pypi.org/pypi/${pkg}/json`
|
|
124
|
+
: `https://pypi.org/pypi/${pkg}/json`;
|
|
114
125
|
return new Promise((res) => {
|
|
115
126
|
https_1.default
|
|
116
|
-
.get(
|
|
127
|
+
.get(url, (resp) => {
|
|
117
128
|
const resBuffer = [];
|
|
118
129
|
resp.on('data', (chunk) => {
|
|
119
130
|
resBuffer.push(chunk);
|
|
@@ -143,6 +154,9 @@ function installRequirements(reqFile, pth, stackVersion, linuxMode = false) {
|
|
|
143
154
|
'--only-binary=:all:'
|
|
144
155
|
]);
|
|
145
156
|
}
|
|
157
|
+
if (testPypi === 'true') {
|
|
158
|
+
spawnOpts.push('-i', 'https://test.pypi.org/simple/', '--extra-index-url', 'https://pypi.org/simple/');
|
|
159
|
+
}
|
|
146
160
|
return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
|
147
161
|
var _a;
|
|
148
162
|
const child = (0, shell_1.spawn)(userConfig_1.default.get(`python${stackVersion}.bin`), spawnOpts, {
|
|
Binary file
|
|
Binary file
|
|
Binary file
|