FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

test ENOBUF workaround by AnqiHuangQiQi · Pull Request #190 · sourcegraph/scip-python · GitHub

Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .ts  (1) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
25 changes: 19 additions & 6 deletions packages/pyright-scip/src/virtualenv/environment.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,28 @@ let getPipCommand = () => {
};

function pipList(): PipInformation[] {
return JSON.parse(child_process.execSync(`${getPipCommand()} list --format=json`).toString()) as PipInformation[];
console.log(`Executing pip list.`);
return JSON.parse(
child_process.execSync(`${getPipCommand()} list --format=json`, { maxBuffer: 1024 * 1024 * 100 }).toString()
) as PipInformation[];
}

function pipBulkShow(names: string[]): string[] {
// TODO: This probably breaks with enough names. Should batch them into 512 or whatever the max for bash would be
return child_process
.execSync(`${getPipCommand()} show -f ${names.join(' ')}`)
.toString()
.split('\n---');
const BATCH_SIZE = 10;
const results: string[] = [];
console.log(names.length + ' packages to show');

for (let i = 0; i < names.length; i += BATCH_SIZE) {
const batch = names.slice(i, i + BATCH_SIZE);
console.log(`Executing pip show for the following packages: ${batch.join(', ')}`);
console.log(`${getPipCommand()} show -f ${batch.join(' ')}`);t
const output = child_process
.execSync(`${getPipCommand()} show -f ${batch.join(' ')}`, { maxBuffer: 1024 * 1024 * 5 })
.toString()
results.push(...output.split('\n---'));
}

return results;
}

export default function getEnvironment(
Expand Down

Back | FazBrowse Home | New Git URL