How to cache pip install packages in CircleCI?

Is there any way to do this?

For example, I currently always install a specific version of docker-compose in the circle.yml file, but I would like it to be installed already through the cache:

- sudo -H pip install -U docker-compose==1.3.3

I tried adding the following to circle.yml, but it does not work (nothing related to docker-compose was saved in the .cache / pip directory after installation):

 cache_directories:
    - /home/ubuntu/.cache/pip
+4
source share
1 answer

Thanks to the help of Alexei (from Circle), I got a solution:

Use requirements.txtpip to install dependencies, i.e.:

docker-compose == 1.3.3

Modify the file circle.ymlto add python as a dependency and install pip:

machine:
  python:
    version: 2.7.6

dependencies:
  pre:
    - pip install -r requirements.txt
+3
source

Source: https://habr.com/ru/post/1606037/


All Articles