Package management

Structure

There are 3 types of files that can be located in config/ directory which are used to install packages.

  • requirements.txt - used for installing packages to all environments
  • devel-requirements.txt - used for installing packages only to development environment in addition to requirements.txt
  • prod-requirements.txt - used for installing packages only to production environment in addition to requirements.txt (by default not present but can be created)

Syntax of requirements files is pip requirement file syntax (http://www.pip-installer.org/en/latest/requirements.html)

Commands

To install packages from requirements file run the following command (it skips already installed packages):

make requirements

You can also update all packages to latest version:

make upgrade

Overriding

You can manage packages by hand in environments by running pip from environment (you may also use prod-env):

devel-env/bin/pip install django

Speedup

Sometimes you have many projects and you don’t want to download all packages every time. You can use pip download cache by setting environment variable PIP_DOWNLOAD_CACHE. It should point to directory that you would like to store downloaded files. You may want to set it in your shell rc script.