Fix depmap to be able to see past a Dependencies target

Review Request #661 — Created July 10, 2014 and submitted

zundel
pants
zundel/fix-depmap
242, 336
pants-reviews
ity
Fix depmap to be able to see past a Dependencies target.  We use dependencies() liberally to create short aliases users can use to build common targets.
Added some unit tests to test_depmap.py

ci is baking at: https://travis-ci.org/pantsbuild/pants/builds/29633759

  • 3
  • 0
  • 0
  • 0
  • 3
Description From Last Updated
I really think we shouldn't be adding more of these properties. We've been trying to get rid of them and ... PA patricklaw
What do you propose instead, an isinstance() or hasattr() test? ZU zundel
I think we're trying to avoid prints left in tests? Though if you still want to keep it, fix the ... PA patricklaw
IT
  1. Ship It!
  2. 
      
ZU
Review request changed

Status: Closed (submitted)

Change Summary:

Committed at 6d45979d954d0de93ff74dacfe8c18859ba02298
PA
  1. 
      
  2. src/python/pants/base/target.py (Diff revision 1)
     
     
    I really think we shouldn't be adding more of these properties.  We've been trying to get rid of them and the super class for a while now, pending a better design for labels.
  3. I think we're trying to avoid prints left in tests?  Though if you still want to keep it, fix the extra space between print and (
  4. 
      
ZU
  1. 
      
  2. src/python/pants/base/target.py (Diff revision 1)
     
     
    What do you propose instead, an isinstance() or  hasattr() test?
    1. For now, unfortunately, isinstance.  It's especially okay here since Dependencies is such a general Target (it lives in core).  In the future I'd like to implement a pluggable flags interface where we can register attributes like this as though they were enums.  e.g. in the future I'd like it to look something like:
      
      ```
      from pants.base.flags import Flags
      
      ...
      
      if some_target.has_flag(Flags.DELEGATE):
         ...
      ```
      
      And in register.py, plugins can register more names into the Flags namespace.  I'm going to send a design doc out regarding this in the near future.
  3. 
      
Loading...