linkedin / pygradle

Using Gradle to build Python projects
https://github.com/linkedin/pygradle
Apache License 2.0
586 stars 147 forks source link

Travis CI caching #180

Open jaredsburrows opened 6 years ago

jaredsburrows commented 6 years ago

How to prevent Travis CI from downloading setup dependencies each time?

After Gradle clean:

$ gradlew :python:build

> Task :python:createVirtualEnvironment 
New python executable in /<>/python/build/venv/bin/python
Installing setuptools, pip, wheel...done.
Running virtualenv with interpreter /usr/bin/python2.7

> Task :python:installSetupRequirements 
Install setuptools-33.1.1 ........................................... [STARTING]
Install (0:01.522 s) ................................................ [FINISHED]
Install wheel-0.29.0 ................................................ [SKIPPING]
Install pip-9.0.1 ................................................... [SKIPPING]
Install setuptools-git-1.2 .......................................... [STARTING]
Install (0:00.883 s) ................................................ [FINISHED]
Install argparse-1.4.0 .............................................. [STARTING]
Install (0:00.929 s) ................................................ [FINISHED]

> Task :python:installBuildRequirements 
Install pyflakes-1.2.3 .............................................. [STARTING]
Install (0:00.975 s) ................................................ [FINISHED]
Install pycodestyle-2.0.0 ........................................... [STARTING]
Install (0:00.997 s) ................................................ [FINISHED]
Install mccabe-0.5.2 ................................................ [STARTING]
Install (0:01.898 s) ................................................ [FINISHED]
Install flake8-2.6.2 ................................................ [STARTING]
Install (0:00.996 s) ................................................ [FINISHED]
Install six-1.11.0 .................................................. [STARTING]
Install (0:00.906 s) ................................................ [FINISHED]
Install MarkupSafe-1.0 .............................................. [STARTING]
Install (0:01.591 s) ................................................ [FINISHED]
Install Jinja2-2.9.6 ................................................ [STARTING]
Install (0:01.140 s) ................................................ [FINISHED]
Install Pygments-2.2.0 .............................................. [STARTING]
Install (0:02.071 s) ................................................ [FINISHED]
Install docutils-0.13.1 ............................................. [STARTING]
Install (0:01.851 s) ................................................ [FINISHED]
Install snowballstemmer-1.2.1 ....................................... [STARTING]
Install (0:01.117 s) ................................................ [FINISHED]
Install pytz-2017.2 ................................................. [STARTING]
Install (0:02.071 s) ................................................ [FINISHED]
Install Babel-2.4.0 ................................................. [STARTING]
Install (0:03.854 s) ................................................ [FINISHED]
Install alabaster-0.7.10 ............................................ [STARTING]
Install (0:01.029 s) ................................................ [FINISHED]
Install imagesize-0.7.1 ............................................. [STARTING]
Install (0:00.969 s) ................................................ [FINISHED]
Install colorama-0.3.9 .............................................. [STARTING]
Install (0:00.992 s) ................................................ [FINISHED]
Install Sphinx-1.4.9 ................................................ [STARTING]
Install (0:02.756 s) ................................................ [FINISHED]

> Task :python:installTestRequirements 
Install py-1.4.34 ................................................... [STARTING]
Install (0:01.171 s) ................................................ [FINISHED]
Install setuptools-33.1.1 ........................................... [SKIPPING]
Install argparse-1.4.0 .............................................. [SKIPPING]
Install colorama-0.3.9 .............................................. [SKIPPING]
Install pytest-3.1.2 ................................................ [STARTING]
Install (0:01.837 s) ................................................ [FINISHED]
Install coverage-4.4.1 .............................................. [STARTING]
Install (0:02.086 s) ................................................ [FINISHED]
Install pytest-cov-2.5.1 ............................................ [STARTING]
Install (0:01.082 s) ................................................ [FINISHED]
Install apipkg-1.4 .................................................. [STARTING]
Install (0:01.116 s) ................................................ [FINISHED]
Install execnet-1.4.1 ............................................... [STARTING]
Install (0:01.675 s) ................................................ [FINISHED]
Install pytest-xdist-1.17.1 ......................................... [STARTING]
Install (0:01.639 s) ................................................ [FINISHED]

> Task :python:installProject 
Install python ...................................................... [STARTING]
Install (0:01.038 s) ................................................ [FINISHED]

> Task :python:packageSdist 

Possibly?

cache:
  directories:
    - $HOME/python/build/venv
jaredsburrows commented 5 years ago

Any idea on this?

umayrh commented 5 years ago

@jaredsburrows I'm curious - did that work for you? It seems hard in my case since I've multiple Python packages, and Travis doesn't support wildcards in cache directory names.

jaredsburrows commented 5 years ago

Based on their cache page: https://docs.travis-ci.com/user/caching/, I believe it just does folders.