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.14k stars 384 forks source link

Pipreqs not idenitfying google cloud storage #362

Open DominiquePaul opened 1 year ago

DominiquePaul commented 1 year ago

I have an import that looks like this: from google.cloud import storage

the installation command with pip is: pip install google-cloud-storage

But the requirement google-cloud-stoage==2.7.0 is not added to requirements.txt

I love pipreqs, but I'm not sure how to deal with this as everytime I add it manually and want to regenerate the file the dependency is lost..

Is there a way to either:

  1. Ensure that pipreqs can find google-cloud-storage OR
  2. That I can manually add it to requirements.txt without it being overwritten (but other packages appended) and updated?

Thanks!

fled-dev commented 1 year ago

I have the same issue with bitcoinlib.

bndr commented 1 year ago

I think quite a few new packages are not identified properly, as it's been a long time since we updated the list.

Back when I first wrote it I parsed all the packages from PyPi repository to match the imports with the packages. I think a fresh parsing is needed, I'll take a look at it once I have some free time.

Michael-E-Rose commented 1 year ago

I always thought pipreqs works the other way around: Compare the list of used packages against the list of base packages? Would that not be easier to maintain? Each day there are new packages on PyPI...