Very nice. lgtm minus the nits
This goes with stdlib imports
This goes between stdlib imports and pants imports
2 blank lines between global scope definitions
Why the replacement? Is this to guard against your own machinery picking up this example?
This is quite difficult to read and I suspect it will be difficult to maintain. At the very least, it should be commented more thoroughly.
In general, lots of continues and state dependent looping is difficult to reason about. It seems like you want a more sophisticated regular expression, or even a parser.
Any reason this isn't
AbstractTargetis just a bucket of abstraction leaks, and it needs to go away eventually.
'goal builddict' Target classes "inherit" docstrings, signatures
Review Request #1018 — Created Sept. 11, 2014 and submitted
Nowadays, our BUILD target implementations use class inheritance + some constructor idioms. But the BUILD Dictionary hasn't kept up. Thus, we have boilerplate docstrings and documented signatures like android_binary(build_type=None, *args, **kwargs)
Special-cases target handling in src/python/pants/backend/core/tasks/builddictionary.py to go up the inheritence tree, pull apart and re-assemble signatures and docstrings. Also, special-cases leaving out implementation-params we don't want in the user-facing doc (address, build_graph, payload). It doesn't have a general mechanism for leaving stuff out, though. E.g., python_binary's entry thinks it has a sources param (inherited from PythonTarget); mitigated by having a docstring for it saying "overridden: use source instead".
Removes many many redundant docstring fragments. My search wasn't scientific. Probably other removal-worthy pieces lurk.
Adds some docstrings. E.g. python_binary's "sources: overridden". Move some docstrings to superclass for easier inheriting.
Excellent feedback is excellent.
If the "clarification" to the loopy-parse code makes you think "Hmm, actually, this is less clear. Could we have the old loop back, but with more comments?" say the word; I commited a snapshot of that.
Figure I'll push this on Monday; I have a superstition against code changes on Friday afternoons.