Skip to content

fix: use serviceDir while injecting requirements to ensure compatibility with v4 Compose #854

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 17 commits into from
Feb 11, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix: Run prettier
  • Loading branch information
czubocha committed Feb 11, 2025
commit fe884de7bbd86b95446f9f7341e254cf59f1315b
70 changes: 35 additions & 35 deletions test.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
const crossSpawn = require('cross-spawn');
const glob = require('glob-all');
const JSZip = require('jszip');
// const JSZip = require('jszip');
// const sha256File = require('sha256-file');
const tape = require('tape-promise/tape');

const {
// chmodSync,
removeSync,
readFile,
copySync,
// readFile,
// copySync,
// writeFileSync,
// statSync,
// pathExistsSync,
Expand Down Expand Up @@ -128,38 +128,38 @@ const test = (desc, func, opts = {}) =>
}
});

const availablePythons = (() => {
const binaries = [];
const mapping = {};
if (process.env.USE_PYTHON) {
binaries.push(
...process.env.USE_PYTHON.split(',').map((v) => v.toString().trim())
);
} else {
// For running outside of CI
binaries.push('python');
}
const exe = process.platform === 'win32' ? '.exe' : '';
for (const bin of binaries) {
const python = `${bin}${exe}`;
const { stdout, status } = crossSpawn.sync(python, [
'-c',
'import sys; sys.stdout.write(".".join(map(str, sys.version_info[:2])))',
]);
const ver = stdout && stdout.toString().trim();
if (!status && ver) {
for (const recommend of [ver, ver.split('.')[0]]) {
if (!mapping[recommend]) {
mapping[recommend] = python;
}
}
}
}
if (!Object.entries(mapping).length) {
throw new Error('No pythons found');
}
return mapping;
})();
// const availablePythons = (() => {
// const binaries = [];
// const mapping = {};
// if (process.env.USE_PYTHON) {
// binaries.push(
// ...process.env.USE_PYTHON.split(',').map((v) => v.toString().trim())
// );
// } else {
// // For running outside of CI
// binaries.push('python3');
// }
// const exe = process.platform === 'win32' ? '.exe' : '';
// for (const bin of binaries) {
// const python = `${bin}${exe}`;
// const { stdout, status } = crossSpawn.sync(python, [
// '-c',
// 'import sys; sys.stdout.write(".".join(map(str, sys.version_info[:2])))',
// ]);
// const ver = stdout && stdout.toString().trim();
// if (!status && ver) {
// for (const recommend of [ver, ver.split('.')[0]]) {
// if (!mapping[recommend]) {
// mapping[recommend] = python;
// }
// }
// }
// }
// if (!Object.entries(mapping).length) {
// throw new Error('No pythons found');
// }
// return mapping;
// })();

// const getPythonBin = (version) => {
// const bin = availablePythons[String(version)];
Expand Down
Loading