-
-
Notifications
You must be signed in to change notification settings - Fork 613
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
Extracts backend.adhoc
package and backend.experimental.adhoc
backend for adhoc_tool
#18237
Extracts backend.adhoc
package and backend.experimental.adhoc
backend for adhoc_tool
#18237
Conversation
It's definitely worth inspecting commits individually, there's a lot of moving parts, particularly in tests and |
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.
A first pass of things I've noticed. I haven't reviewed everything yet.
src/python/pants/backend/experimental/adhoc/adhoc_tool_backend_integration_test.py
Show resolved
Hide resolved
execution_dependencies: tuple[str, ...] | None | ||
dependencies: tuple[str, ...] | None # can go away after 2.17.0.dev0 per deprecation |
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 these be the fields instead of the field values?
That would allow using request.execution_dependencies.alias
in the _descr
string below.
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.
My goal here was to make adhoc_process_support
not depend on any custom field types. Happy to discuss the stylistic merits of it, but you're right, not being able to use .alias
is a downside here.
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.
(this is another request type that will go away when we support scoped dependencies; sigh :))
Co-authored-by: Jacob Floyd <cognifloyd@gmail.com>
Co-authored-by: Jacob Floyd <cognifloyd@gmail.com>
…ackend # Conflicts: # src/python/pants/backend/shell/target_types.py
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.
Good stuff!
…kend for `adhoc_tool` (pantsbuild#18237) Per discussion in pantsbuild#18082, this extracts the target formerly known as `experimental_run_in_sandbox`, which is newly named `adhoc_tool`, into a new package at `pants.backend.adhoc`. Registration for `adhoc_tool` is in `pants.backend.experimental.adhoc`, to reflect the non-stable nature of this target type. `adhoc_process_support.py` has been moved to `core.util_rules`: to facilitate this, this file no longer depends on field/target types from the `shell` or `adhoc` backends. This makes for some slightly duplicative code in `adhoc_tool.py` and `shell_command.py`, which should become simpler after we branch for 2.16 (there's some deprecations in there). With this change, we would be in a position to stabilise `shell_command` as-is. --------- Co-authored-by: Jacob Floyd <cognifloyd@gmail.com>
{AdhocToolArgumentsField.alias}=[""], | ||
{AdhocToolExecutionDependenciesField.alias}=[":scripts"], | ||
{AdhocToolOutputDirectoriesField.alias}=["logs/my-script.log"], | ||
{AdhocToolOutputFilesField.alias}=["results/"], |
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.
When looking at the rendered docs it was much easier to spot that the example field values here are swapped (files vs directories). 👀
Per discussion in #18082, this extracts the target formerly known as
experimental_run_in_sandbox
, which is newly namedadhoc_tool
, into a new package atpants.backend.adhoc
.Registration for
adhoc_tool
is inpants.backend.experimental.adhoc
, to reflect the non-stable nature of this target type.adhoc_process_support.py
has been moved tocore.util_rules
: to facilitate this, this file no longer depends on field/target types from theshell
oradhoc
backends. This makes for some slightly duplicative code inadhoc_tool.py
andshell_command.py
, which should become simpler after we branch for 2.16 (there's some deprecations in there).With this change, we would be in a position to stabilise
shell_command
as-is.