Skip to content

@W-22895723 - exclude local modules from scan command#27

Open
diksha-sf wants to merge 3 commits into
salesforcecli:mainfrom
diksha-sf:main
Open

@W-22895723 - exclude local modules from scan command#27
diksha-sf wants to merge 3 commits into
salesforcecli:mainfrom
diksha-sf:main

Conversation

@diksha-sf

Copy link
Copy Markdown

No description provided.

Comment thread src/utils/nativeScan.ts Outdated
Comment thread src/utils/nativeScan.ts
* would break installs on the runtime).
*/
const PYTHON_STDLIB_MODULES = new Set<string>([
'__future__',

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need to maintain stdlib modules list now as pipreqs lib scan takes care of this.

Comment thread src/utils/nativeScan.ts
if (!name) continue;
addTopLevelImport(name, imports);
try {
const { stdout } = await execFileAsync('pipreqs', ['--print', '--mode', 'no-pin', fileDir]);

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Running the python command here as a child process.

Comment thread src/utils/nativeScan.ts Outdated
async function isLocalModule(pkg: string, fileDir: string): Promise<boolean> {
const [isModuleFile, isPackageDir] = await Promise.all([
pathExists(path.join(fileDir, `${pkg}.py`)),
(async (): Promise<boolean> => {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens if you add import statement in utility.py or utils/utility.py?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants