vagga
vagga copied to clipboard
Automatically freeze python dependencies
The common pattern for installing packages is something like this:
vagga _build app-freezer
cat .vagga/app-freezer/../pip3-freeze.txt > app-requirements.txt
vagga _build app
Where app-freezer contains unversioned dependencies. And app contains versioned ones in app-requirements.txt. This has a number of drawbacks:
- Updating dependencies is a bit of work
- When doing update (like workflow above) all new packages are downloaded. Just adding a package without full update is cumbersome task.
Would be nice to have a PyFreeze command which does the task:
- Initial build generates
requirements.txt - Subsequent builds use the
requirements.txt requirements.txthas a header (commented out) which has a list of initial dependencies to compare. If that list changed we rebuild container as close as possible to therequirements.txt(actual rules to be determined)vagga _build --autoupdateupdatesrequirements.txtfrom scratch
It's expected that generated requirements.txt are stored in revision control just like Gemfile.lock in ruby or Cargo.lock in rust
Should look at: https://pypi.python.org/pypi/Pundler/0.0.2
Note to myself: look at pip-tools / pip-compile,