is there an easy way to make that happen?
# general
h
is there an easy way to make that happen?
e
Perhaps the easiest is to call the plugin API
rules()
functions:
Copy code
$ find . -name "register.py" | xargs grep "def rules()"
./src/python/pants/rules/core/register.py:def rules():
./src/python/pants/backend/native/register.py:def rules():
./src/python/pants/backend/project_info/register.py:def rules():
./src/python/pants/backend/python/register.py:def rules():
./pants-plugins/src/python/internal_backend/rules_for_testing/register.py:def rules():
w
@hundreds-breakfast-49010: that would essentially be an integration test... are you sure you want that?
h
@witty-crayon-22786 nope, I worked around it
w
cool
a
@hundreds-breakfast-49010 i would like it to be feasible to use
def rules()
from individual `register.py`s for this purpose as @enough-analyst-54434 describes -- if that is more annoying than it needs to be, let's consider how those could be rearranged to make them more useful imho!
h
which ultimately I was able to write without using the actual rule graph
👍 1
a
ah amazing!
thank you!
h
I'm not sure how much effort I would've had to put into making a self-consistent rule graph if I had gone with john's suggestion
a
hopefully we can eventually make it consistent
i think your approach is actually what we would prefer in most cases if it doesn't require too many mocks/hacks
h
yeah for this specific test using mock rules works, but your point is still valid
👍 1
a
in my head this is an open problem to be resolved eventually
there's still a lot of fun stuff we can do with testing rules