-
-
Notifications
You must be signed in to change notification settings - Fork 636
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
tailor
should skip bad requirements targets
#15755
tailor
should skip bad requirements targets
#15755
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]
# 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]
# 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]
# 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]
# 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]
# 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]
# 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]
# 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]
# 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]
tailor
should skip bad requirements targetstailor
should skip bad requirements targets
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.
Thanks!
The rule was already probably too big, and this makes it even bigger. I recommend factoring out a @rule_helper
specifically for 3rd-party requirements. Grep for rule_helper
to see examples of how it works.
f"No target generated for `{fp}`. You'll need to create " | ||
"targets for its contents manually." | ||
) | ||
logger.warning("") |
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.
Is this to have a newline? We have no precedent for this, and imo it's confusing to see WARN
twice.
If you really wanted a newline, it's better to use \n
in the call above. But again, no precedent for that.
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.
Also, probably better to combine the warning with the implementation-specific warnings. We try to have logs be self-contained
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 great, thanks! One comment.
I'll add in @stuhood's suggestions, and come back to @Eric-Arellano's as a follow-up |
Other than |
# 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]
# 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]
Yup, it's the |
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.
Thanks!
f"An error occurred when validating `{fp}`: {e}.\n\n" | ||
"You'll need to create targets for its contents manually.\n" | ||
"To silence this error in future, see " | ||
"https://www.pantsbuild.org/docs/reference-tailor#section-ignore-paths \n" |
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.
Should use from pants.util.docutil import doc_url
for this.
logger.warning( | ||
f"An error occurred when validating `{fp}`: {e}.\n\n" | ||
"You'll need to create targets for its contents manually.\n" | ||
"To silence this error in future, see " |
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 silence this error in future, see " | |
"To silence this warning in future, see " |
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.
"the future"
for _ in parse_requirements_file(contents.decode(), rel_path=path): | ||
pass |
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.
for _ in parse_requirements_file(contents.decode(), rel_path=path): | |
pass | |
parse_requirements_file(contents.decode(), rel_path=path): |
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.
It's a generator, we need to consume its output somehow
Adds basic validation for
requirements.txt
, pipfile, andpyproject.toml
by tailor so that we don't permanently start trying to ingest invalid files.Closes #15734