-
-
Notifications
You must be signed in to change notification settings - Fork 644
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
Improve documentation for python_test_utils
#14739
Improve documentation for python_test_utils
#14739
Conversation
# Rust tests and lints will be skipped. Delete if not intended. [ci skip-rust] # Building wheels and fs_util will be skipped. Delete if not intended. [ci skip-build-wheels]
"files vs. production files." | ||
"This target generator is intended for test utility files like `conftest.py` or " | ||
"`my_test_utils.py`. Technically, it generates `python_source` targets in the exact same " | ||
"way as the `python_sources` target generator does, only that the `sources` field has a " |
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.
Why bother explaining this technicality at all? Isn't it an implementation detail?
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.
Because our default source globs will not automatically capture my_test_utils.py
; you can name test util code anything you want, we can't set a sensible default. So you have to go out of your way to set sources
for python_test_utils
if you want to separate prod code from test util code.
This paragraph attempts to explain why you might want to do that, but how it's also not strictly necessary.
Fyi the only reason the separation really matters is that depending on a target generator is an alias for depending on all generated targets. If you still want to use the alias mechanism, but w/o the test code.
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.
looks good to me!
[ci skip-rust] [ci skip-build-wheels]
…#14748) [ci skip-rust] [ci skip-build-wheels]
@compyman helpfully pointed out that the original docs were confusing with the difference between
python_sources
vspython_test_utils
.[ci skip-rust]
[ci skip-build-wheels]