bndr / pipreqs

pipreqs - Generate pip requirements.txt file based on imports of any project. Looking for maintainers to move this project forward.
Apache License 2.0
6.38k stars 388 forks source link

rename variables in get_all_imports? #427

Open alan-barzilay opened 10 months ago

alan-barzilay commented 10 months ago

files is parsed and processed to get the list of imported packages, but this list will be contaminated by stdlib packages and local imports which will be removed in other processing steps (lines 165 and 171).

The candidates list is simply a list of local files that could be imported (like an utils.py file) but shouldnt be a part of the requirements file.

If my description is correct, candidates is an awful name. What are they candidates of? also, this would explain why we are adding dir by dir to the list, as I raised in issue #424. Maybe we should rename those objects to something more intuitive.

maybe py_files -> local_files candidates -> local_modules (pretty sure thats the correct nomenclature but we could use a double check)