-
-
Notifications
You must be signed in to change notification settings - Fork 652
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
WIP internals: allow Pants sources to depend only on certain 3rd-party requirements #19512
base: main
Are you sure you want to change the base?
WIP internals: allow Pants sources to depend only on certain 3rd-party requirements #19512
Conversation
With this rule set, there are some warnings e.g. as Lines 36 to 49 in eb0e836
seems to be overridden by the new rule set I added. Using the I wonder if we shall exclude the |
# can depend on any 3rd party requirement as they aren't included in the final artifact | ||
( | ||
{"type": python_sources}, | ||
PANTS_ARTIFACT_DEPENDENCIES, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would prefer to have the "rule" (deciding fact) of what we may depend on (or not) closer to where it is declared.
Imagine I were to add a new 3rd party dependency, I would look at the others already there and do the same, most definitely overlooking to modify this allow list here.
I think an alternative could be to instead use tags to mark which 3rd party deps are allowed to be used where/how. That way the rules may be enforced here and else where as applicable, but the properties for each dep would be declared along with the BUILD file for the 3rd parties where they belong.
With the current ruleset, I get some violations, unexpectedly:
|
e77e47b
to
b1f2895
Compare
# published Pants artifact will require; test modules do not have any restrictions and | ||
# can depend on any 3rd party requirement as they aren't included in the final artifact | ||
( | ||
{"type": python_sources}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to follow the style of the previous rule set.
{"type": python_sources}, | |
(python_sources, python_source), |
Not overridden, as it is dependencies rules vs dependents rules so there's no overlap. And
Perhaps place the exception for the dependencies rules in |
a) This (and all other ../explorer/ warnings) was expected according to the above, right.. ?
b) I think this is a regular
Same as (b).
Same as (a).
Same as (b).
Same as (a).
Same as (a).
Same as (a).
Same as (b).
Same as (b).
Same as (a).
Same as (a).
Same as (a).
Same as (a).
Same as (b). So there are two root issues. The missing exception from the default rules for the explorer (issue a), and not treating test util code as test code (issue b). The latter is trickier as it is in fact |
Work towards #19458