Add configuration parameter to control the requirements cache ttl

Review Request #1627 - Created Jan. 18, 2015 and submitted

Information
Ugo DG
pants
python_requirements_cache_strategies
https://github.com/pantsbuild/pants/pull/959
eb0869b...
Reviewers
pants-reviews
benjyw, jsirois, patricklaw, wickman

Add configuration parameter to control the requirements cache ttl

The new default is a really large ttl, so that we never try to
re-resolve open-ended requirement, e.g. "flask>=0.2", if a matching
distribution is available on disk

Tested with a single test that, after a first build, successive builds don't result in network access:

$ PANTS_DEV=1 ./pants test tests/python/pants_test/python:test_resolver
... downloads packages
### turn off wireless network
$ PANTS_DEV=1 ./pants test tests/python/pants_test/python:test_resolver
... runs tests fine
$ cat >> pants.ini <<!
[pants-requirements-cache]
strategy = ttl
ttl_second = 1
!
### wireless network is still off
$ PANTS_DEV=1 ./pants test tests/python/pants_test/python:test_resolver
... fails to download packages.
### turn on wireless network
$ PANTS_DEV=1 ./pants test tests/python/pants_test/python:test_resolver
... runs tests fine

Manually run a small subset of the test:

$ PANTS_DEV=1 ./pants test tests/python/pants_test/python::

with different pants.ini to test the various branches (no strategy, strategy = minimum_network_access, strategy = ttl, strategy = this_causes_an_error).

Run all tests:

$ ./pants test tests::
...

                  709 passed, 5 skipped, 5 xfailed, 1 xpassed, 1 warnings in 1124.48 seconds

11:43:01 19:11     [junit]
11:43:01 19:11     [specs]
               SUCCESS

Issues

  • 2
  • 0
  • 0
  • 2
Description From Last Updated
We're trying to avoid pulling any more config from non-new-style options. Please add Benjy to this review for further comment, ... Patrick Lawson Patrick Lawson
It's pretty unfortunate that we have to jump through a hoop like this. This should really be an option in ... Patrick Lawson Patrick Lawson
Ugo DG
Ugo DG
Ugo DG
Patrick Lawson
Ugo DG
Brian Wickman (Twitter)
Benjy Weinberger
Ugo DG
Eric Ayers
Benjy Weinberger
John Sirois
John Sirois
Ugo DG
John Sirois
John Sirois
Ugo DG
Review request changed

Status: Closed (submitted)

Loading...