|
1 | 1 | const crossSpawn = require('cross-spawn');
|
2 | 2 | const glob = require('glob-all');
|
3 |
| -const JSZip = require('jszip'); |
| 3 | +// const JSZip = require('jszip'); |
4 | 4 | // const sha256File = require('sha256-file');
|
5 | 5 | const tape = require('tape-promise/tape');
|
6 | 6 |
|
7 | 7 | const {
|
8 | 8 | // chmodSync,
|
9 | 9 | removeSync,
|
10 |
| - readFile, |
11 |
| - copySync, |
| 10 | + // readFile, |
| 11 | + // copySync, |
12 | 12 | // writeFileSync,
|
13 | 13 | // statSync,
|
14 | 14 | // pathExistsSync,
|
@@ -128,38 +128,38 @@ const test = (desc, func, opts = {}) =>
|
128 | 128 | }
|
129 | 129 | });
|
130 | 130 |
|
131 |
| -const availablePythons = (() => { |
132 |
| - const binaries = []; |
133 |
| - const mapping = {}; |
134 |
| - if (process.env.USE_PYTHON) { |
135 |
| - binaries.push( |
136 |
| - ...process.env.USE_PYTHON.split(',').map((v) => v.toString().trim()) |
137 |
| - ); |
138 |
| - } else { |
139 |
| - // For running outside of CI |
140 |
| - binaries.push('python'); |
141 |
| - } |
142 |
| - const exe = process.platform === 'win32' ? '.exe' : ''; |
143 |
| - for (const bin of binaries) { |
144 |
| - const python = `${bin}${exe}`; |
145 |
| - const { stdout, status } = crossSpawn.sync(python, [ |
146 |
| - '-c', |
147 |
| - 'import sys; sys.stdout.write(".".join(map(str, sys.version_info[:2])))', |
148 |
| - ]); |
149 |
| - const ver = stdout && stdout.toString().trim(); |
150 |
| - if (!status && ver) { |
151 |
| - for (const recommend of [ver, ver.split('.')[0]]) { |
152 |
| - if (!mapping[recommend]) { |
153 |
| - mapping[recommend] = python; |
154 |
| - } |
155 |
| - } |
156 |
| - } |
157 |
| - } |
158 |
| - if (!Object.entries(mapping).length) { |
159 |
| - throw new Error('No pythons found'); |
160 |
| - } |
161 |
| - return mapping; |
162 |
| -})(); |
| 131 | +// const availablePythons = (() => { |
| 132 | +// const binaries = []; |
| 133 | +// const mapping = {}; |
| 134 | +// if (process.env.USE_PYTHON) { |
| 135 | +// binaries.push( |
| 136 | +// ...process.env.USE_PYTHON.split(',').map((v) => v.toString().trim()) |
| 137 | +// ); |
| 138 | +// } else { |
| 139 | +// // For running outside of CI |
| 140 | +// binaries.push('python3'); |
| 141 | +// } |
| 142 | +// const exe = process.platform === 'win32' ? '.exe' : ''; |
| 143 | +// for (const bin of binaries) { |
| 144 | +// const python = `${bin}${exe}`; |
| 145 | +// const { stdout, status } = crossSpawn.sync(python, [ |
| 146 | +// '-c', |
| 147 | +// 'import sys; sys.stdout.write(".".join(map(str, sys.version_info[:2])))', |
| 148 | +// ]); |
| 149 | +// const ver = stdout && stdout.toString().trim(); |
| 150 | +// if (!status && ver) { |
| 151 | +// for (const recommend of [ver, ver.split('.')[0]]) { |
| 152 | +// if (!mapping[recommend]) { |
| 153 | +// mapping[recommend] = python; |
| 154 | +// } |
| 155 | +// } |
| 156 | +// } |
| 157 | +// } |
| 158 | +// if (!Object.entries(mapping).length) { |
| 159 | +// throw new Error('No pythons found'); |
| 160 | +// } |
| 161 | +// return mapping; |
| 162 | +// })(); |
163 | 163 |
|
164 | 164 | // const getPythonBin = (version) => {
|
165 | 165 | // const bin = availablePythons[String(version)];
|
|
0 commit comments