Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow @rules and @console_rules to be registered as loose plugins #6652

Closed
illicitonion opened this issue Oct 18, 2018 · 8 comments
Closed

Comments

@illicitonion
Copy link
Contributor

Right now, all @rules and @console_rules must be distributed in the pants source; we don't allow them to be registered separately.

When we're slightly more stable in the API, we should fix this.

@stuhood
Copy link
Member

stuhood commented Oct 18, 2018

@cosmicexplorer : I think you had a ticket about this somewhere?

@stuhood
Copy link
Member

stuhood commented Oct 18, 2018

Oh, wait. I'm not sure that this is accurate. Any backend with a register.py can declare a def rules method, and those should all be collected.

It's only contrib plugins that don't support declaring def rules, IIRC. @cosmicexplorer should be able to confirm.

@illicitonion
Copy link
Contributor Author

Specifically, could I write this test: 9b3d18a#diff-c43b8b5f4e0613890bad998aae1f95fdR33 without adding the console_rule to pants proper?

@cosmicexplorer
Copy link
Contributor

cosmicexplorer commented Oct 18, 2018

It's only contrib plugins that don't support declaring def rules, IIRC. @cosmicexplorer should be able to confirm.

Correct, #5970 (which adds this) should be unblocked by the other PR I will have in today. Looking at the comment in fastlist.py, the "in-repo plugin" part sounds exactly like what we might need #5970 to do. #5970 is only phrased that way so that the native backend can have some rules we can use to test that loading rules from plugins works correctly. If this capability is necessary for the commit mentioned then I would probably not try to do #5970 as is, but would take the (extremely minimal) change required to enable rules in plugins (almost the exact same as for backends) and consume it for this much smaller more focused case.

@stuhood
Copy link
Member

stuhood commented Oct 18, 2018

Specifically, could I write this test: 9b3d18a#diff-c43b8b5f4e0613890bad998aae1f95fdR33 without adding the console_rule to pants proper?

Yes.

@stuhood
Copy link
Member

stuhood commented Oct 18, 2018

@cosmicexplorer : Ideally the "plugins can declare @rules" portion of #5970 would be split out and landed independently. But given that @illicitonion isn't actually blocked here, if nothing else ends up needing to declare def rules in contrib plugins anytime soon, it would be ok to land the feature in that PR I guess.

@cosmicexplorer
Copy link
Contributor

Left a comment in #5970 basically laying out the plan for that PR (which now does not involve moving a ton of code across the codebase and resolving this issue at the same time).

@cosmicexplorer
Copy link
Contributor

This was fixed!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants