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

FEATURE: --soft-force to only add new, modify changed versions #442

Open Laz4rz opened 6 months ago

Laz4rz commented 6 months ago

This flag would come in handy for example in sqlalchemy case. While installing sqlalchemy dependency psycopg2 is not installed with it and has to be installed manually through either binary or pip install psycopg2-binary.

I can obviously add psycopg2-binary to requirements manually, but then after rerunning pipreqs --force to get new requirements I have to remember to add all missing requirements.

--soft-force would only change the versions of stuff that is currently in requirements or add new libraries that are the difference of current inference vs requirements. This way any manually added entries wouldn't be modified.

Id be happy to help with implementation.