Refactor DEFAULT_LOGGING_CONF_PATH
calculation to allow fine-grained pants dep inference
#5858
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Background
This is another part of introducing pants, as discussed in various TSC meetings.
Related PRs can be found in:
Overview of this PR
This is primarily a follow-up to:
Unlike the simple BUILD config added in #5846, this PR refactors one constant so that pants can better use python imports to precisely detect who needs
st2common/st2common/conf/base.logging.conf
.Before this PR, anything that uses any of the constants had a hard-coded dependency on
base.logging.conf
:st2/st2common/st2common/constants/BUILD
Lines 1 to 3 in 63f66b9
After this PR, each file will only get an inferred dependency if it actually imports the
DEFAULT_LOGGING_CONF_PATH
constant that refers to that file.This also has the benefit of moving the constant calculation closer to the file it references. But, it still maintains backwards compatibility by also making the constant available in the old location.