vagga icon indicating copy to clipboard operation
vagga copied to clipboard

Automatically freeze python dependencies

Open tailhook opened this issue 10 years ago • 2 comments

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:

  1. Updating dependencies is a bit of work
  2. 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:

  1. Initial build generates requirements.txt
  2. Subsequent builds use the requirements.txt
  3. requirements.txt has 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 the requirements.txt (actual rules to be determined)
  4. vagga _build --autoupdate updates requirements.txt from scratch

It's expected that generated requirements.txt are stored in revision control just like Gemfile.lock in ruby or Cargo.lock in rust

tailhook avatar Nov 04 '15 16:11 tailhook

Should look at: https://pypi.python.org/pypi/Pundler/0.0.2

tailhook avatar Nov 04 '15 17:11 tailhook

Note to myself: look at pip-tools / pip-compile,

tailhook avatar Apr 14 '16 15:04 tailhook