FEATURE: --soft-force to only add new, modify changed versions
- Dominant language
- Python
- Stars
- 7.5k
- Forks
- 424
- PR merge metrics
- No merged PRs in 30d
Description
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.
Contributor guide
Research direction
Start by tracing how pipreqs handles the existing --force option and compares inferred dependencies with requirements.txt. Define the --soft-force behavior from the issue: preserve manually added entries, update versions already present, and add newly inferred libraries such as psycopg2-binary. Done means rerunning pipreqs updates or adds only those entries without modifying unrelated manual entries.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- cli, tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100