Add `pants_requirement()` for plugin authors.

Review Request #3112 - Created Nov. 13, 2015 and submitted

Information
John Sirois
pants
jsirois/issues/2545
2545, 2551
Reviewers
pants-reviews
kwlzn, stuhood, Yasumoto
When writing a plugin outside the `pantsbuild/pants` repo, if you want
to use pants itself to build the plugin or test it, you need to express
a BUILD dependency on pants itself.  This should always match the
running pants and for users of the `pantsbuild.pants` official sdists,
this is awkward.  The `pants_requirement()` macro provides a clean way
to express the plugin's dependency on the correct pants distribution.

 src/python/pants/backend/python/BUILD                            | 12 ++++++++++++
 src/python/pants/backend/python/pants_requirement.py             | 29 +++++++++++++++++++++++++++++
 src/python/pants/backend/python/register.py                      |  2 ++
 tests/python/pants_test/backend/python/BUILD                     | 12 ++++++++++++
 tests/python/pants_test/backend/python/test_pants_requirement.py | 43 +++++++++++++++++++++++++++++++++++++++++++
 5 files changed, 98 insertions(+)

Locally green: ./pants test-changed.

CI went green here:
https://travis-ci.org/pantsbuild/pants/builds/90867348

John Sirois
Kris Wilson
John Sirois
John Sirois
John Sirois
Review request changed

Status: Closed (submitted)

Loading...