Replace eval use with a parse_literal util.

Review Request #2787 - Created Sept. 9, 2015 and submitted

Information
John Sirois
pants
jsirois/eval/tighten_use
1803, 2158
3724156...
Reviewers
pants-reviews
benjyw
This locks down and centralizes all of pants uses of eval outside BUILD
file parsing in a central utility.  Config and custom_types are updated
to use this and tests adjusted.  In particular, test_options is ported
to use a real Config instead of a FakeConfig - which behaved differently
than real Config and was causing fake - aka test code induced - issues
with the new parser.

 src/python/pants/base/BUILD                         |  1 +
 src/python/pants/base/config.py                     | 48 ++++++++++---------------------
 src/python/pants/option/BUILD                       |  1 +
 src/python/pants/option/custom_types.py             | 39 ++++----------------------
 src/python/pants/util/BUILD                         | 18 ++++++++----
 src/python/pants/util/eval.py                       | 76 ++++++++++++++++++++++++++++++++++++++++++++++++++
 tests/python/pants_test/base/test_config.py         |  4 +--
 tests/python/pants_test/option/BUILD                | 20 +------------
 tests/python/pants_test/option/fake_config.py       | 21 --------------
 tests/python/pants_test/option/test_custom_types.py | 20 ++++++-------
 tests/python/pants_test/option/test_options.py      | 39 +++++++++++++++++++++-----
 tests/python/pants_test/util/BUILD                  | 10 +++++++
 tests/python/pants_test/util/test_eval.py           | 44 +++++++++++++++++++++++++++++
 13 files changed, 210 insertions(+), 131 deletions(-)
CI went green here:
  https://travis-ci.org/pantsbuild/pants/builds/79556447

Issues

  • 0
  • 1
  • 0
  • 1
Description From Last Updated
Benjy Weinberger
John Sirois
Benjy Weinberger
John Sirois
John Sirois
John Sirois
Review request changed

Status: Closed (submitted)

Loading...