Extract Config as Configuration to its own module.

Review Request #2924 - Created Oct. 2, 2015 and submitted

Information
John Sirois
pants
jsirois/engine/exp/inputs
2307, 2308
2920
18ba59e...
Reviewers
pants-reviews
patricklaw, stuhood, zundel
This moves the types built up from it for use in planner sample inputs
off to their own targets module.

 src/python/pants/engine/exp/BUILD                                             |  11 ++-
 src/python/pants/engine/exp/{targets.py => configuration.py}                  |  66 +------------
 src/python/pants/engine/exp/targets.py                                        | 257 ++++----------------------------------------------
 tests/python/pants_test/engine/exp/BUILD                                      |   8 +-
 tests/python/pants_test/engine/exp/{test_targets.py => test_configuration.py} |  43 +++++----
 tests/python/pants_test/engine/exp/test_graph.py                              |  27 +++---
 6 files changed, 79 insertions(+), 333 deletions(-)
CI went green here:
  https://travis-ci.org/pantsbuild/pants/builds/83342667
John Sirois
John Sirois
John Sirois
John Sirois
Review request changed

Status: Closed (submitted)

Benjy Weinberger

   

Again, I'm naively wondering if this can be a brain-dead-simple JSON-y object consisting of only dict, list and basic types, instead of messing around with Serializable etc?

  1. I feel like you're missing something or I am.  That is _exactly_ what's going on here!  We need some way of marking which of those basic string values define edges.  That could be done in 3 ways afaict:
    1. post parsing all string values - ie JSON runs, gets us a dict, we walk it and for every string looking like an address spec, we treat it as one and follow that edge later in Graph.resolve.  We'd need escaping or other string clues to be able to override this and not have plain old path values that are strings not interpreted as graph edges.
    2. define a schem off to the side for all objects keyed on a top-level typename field, use the schema to control which fields contain edge strings.
    3. like I've done here - provide the simplest possible wrapper type - holds 1 field, the dict it wraps, and explicitly mark the schema with adressables and friends wrappers.
    
    I could spike on a quick unit-test contained perf test that can tell us how much memory and time overhead the wrappers give as compared to using 1 or 2.
    My main thrust though was to provide a goo-Target basis for experiments, which this gives.
Loading...