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: