A CLI tool to quickly regenerate Python requirements.txt files using pipreqs across a project tree.
I find myself in this situation often with clients:
├── util_1
│ └── requirements.txt
├── util_2
│ └── requirements.txt
└── util_n
└── requirements.txt
Dependabot and Renovate often will get hung up on similar-sounding dependencies (e.g. boto and botocore getting stuck on noncompatible version) and I don't want to
fuss over resolving merge conflicts. Ergo this utility walks a directory and refreshes each of the requirements.txt files. No fuss, no muss.
go install github.com/bevelwork/quick_pipreqs@latest
brew tap bevelwork/homebrew-tap
brew install quick-pipreqsPrerequisites: Python environment with pipreqs installed (install pipreqs)
quick-pipreqs [options] <path>--dry-run- Preview changes without executing--max-depth <int>- Maximum recursion depth (default: 2)--concurrency <n>- Max concurrent updates (default: 12)--version- Show version--verbose- Print discovered directories
# Update requirements.txt files in a project
quick-pipreqs /path/to/project
# Preview changes without writing files
quick-pipreqs --dry-run /path/to/project
# Only check root directory
quick-pipreqs --max-depth 0 /path/to/project- Scans for directories containing
requirements.txtfiles - Backs up existing files to
requirements.txt.bak - Runs
pipreqsin each directory to regenerate requirements with a progress spinner and colored summary output viaquick_color - Processes directories concurrently for speed
Apache 2.0.