-
-
Notifications
You must be signed in to change notification settings - Fork 774
Pants: add python_distribution BUILD metadata for runners
#5907
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
Conversation
| stevedore_namespace("st2common.runners.runner"): { | ||
| "action-chain": "action_chain_runner.action_chain_runner", | ||
| }, |
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.
st2/contrib/runners/action_chain_runner/setup.py
Lines 54 to 56 in 9d311c5
| "st2common.runners.runner": [ | |
| "action-chain = action_chain_runner.action_chain_runner", | |
| ], |
| stevedore_namespace("st2common.runners.runner"): { | ||
| "announcement": "announcement_runner.announcement_runner", | ||
| }, |
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.
st2/contrib/runners/announcement_runner/setup.py
Lines 53 to 55 in 9d311c5
| "st2common.runners.runner": [ | |
| "announcement = announcement_runner.announcement_runner", | |
| ], |
| stevedore_namespace("st2common.runners.runner"): { | ||
| "http-request": "http_runner.http_runner", | ||
| }, |
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.
st2/contrib/runners/http_runner/setup.py
Lines 53 to 55 in 9d311c5
| "st2common.runners.runner": [ | |
| "http-request = http_runner.http_runner", | |
| ], |
| stevedore_namespace("st2common.runners.runner"): { | ||
| "inquirer": "inquirer_runner.inquirer_runner", | ||
| }, |
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.
st2/contrib/runners/inquirer_runner/setup.py
Lines 53 to 55 in 9d311c5
| "st2common.runners.runner": [ | |
| "inquirer = inquirer_runner.inquirer_runner", | |
| ], |
| stevedore_namespace("st2common.runners.runner"): { | ||
| "local-shell-cmd": "local_runner.local_shell_command_runner", | ||
| "local-shell-script": "local_runner.local_shell_script_runner", | ||
| }, |
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.
st2/contrib/runners/local_runner/setup.py
Lines 54 to 57 in 9d311c5
| "st2common.runners.runner": [ | |
| "local-shell-cmd = local_runner.local_shell_command_runner", | |
| "local-shell-script = local_runner.local_shell_script_runner", | |
| ], |
| stevedore_namespace("st2common.runners.runner"): { | ||
| "noop": "noop_runner.noop_runner", | ||
| }, |
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.
st2/contrib/runners/noop_runner/setup.py
Lines 51 to 53 in 9d311c5
| "st2common.runners.runner": [ | |
| "noop = noop_runner.noop_runner", | |
| ], |
| stevedore_namespace("st2common.runners.runner"): { | ||
| "orquesta": "orquesta_runner.orquesta_runner", | ||
| }, | ||
| stevedore_namespace("orquesta.expressions.functions"): { | ||
| "st2kv": "orquesta_functions.st2kv:st2kv_", | ||
| "task": "orquesta_functions.runtime:task", | ||
| "basename": "st2common.expressions.functions.path:basename", | ||
| "dirname": "st2common.expressions.functions.path:dirname", | ||
| "from_json_string": "st2common.expressions.functions.data:from_json_string", | ||
| "from_yaml_string": "st2common.expressions.functions.data:from_yaml_string", | ||
| "json_dump": "st2common.expressions.functions.data:to_json_string", | ||
| "json_parse": "st2common.expressions.functions.data:from_json_string", | ||
| "json_escape": "st2common.expressions.functions.data:json_escape", | ||
| "jsonpath_query": "st2common.expressions.functions.data:jsonpath_query", | ||
| "regex_match": "st2common.expressions.functions.regex:regex_match", | ||
| "regex_replace": "st2common.expressions.functions.regex:regex_replace", | ||
| "regex_search": "st2common.expressions.functions.regex:regex_search", | ||
| "regex_substring": "st2common.expressions.functions.regex:regex_substring", | ||
| "to_human_time_from_seconds": "st2common.expressions.functions.time:to_human_time_from_seconds", | ||
| "to_json_string": "st2common.expressions.functions.data:to_json_string", | ||
| "to_yaml_string": "st2common.expressions.functions.data:to_yaml_string", | ||
| "use_none": "st2common.expressions.functions.data:use_none", | ||
| "version_compare": "st2common.expressions.functions.version:version_compare", | ||
| "version_more_than": "st2common.expressions.functions.version:version_more_than", | ||
| "version_less_than": "st2common.expressions.functions.version:version_less_than", | ||
| "version_equal": "st2common.expressions.functions.version:version_equal", | ||
| "version_match": "st2common.expressions.functions.version:version_match", | ||
| "version_bump_major": "st2common.expressions.functions.version:version_bump_major", | ||
| "version_bump_minor": "st2common.expressions.functions.version:version_bump_minor", | ||
| "version_bump_patch": "st2common.expressions.functions.version:version_bump_patch", | ||
| "version_strip_patch": "st2common.expressions.functions.version:version_strip_patch", | ||
| "yaml_dump": "st2common.expressions.functions.data:to_yaml_string", | ||
| "yaml_parse": "st2common.expressions.functions.data:from_yaml_string", | ||
| }, |
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.
st2/contrib/runners/orquesta_runner/setup.py
Lines 51 to 87 in 9d311c5
| "st2common.runners.runner": [ | |
| "orquesta = orquesta_runner.orquesta_runner", | |
| ], | |
| "orquesta.expressions.functions": [ | |
| "st2kv = orquesta_functions.st2kv:st2kv_", | |
| "task = orquesta_functions.runtime:task", | |
| "basename = st2common.expressions.functions.path:basename", | |
| "dirname = st2common.expressions.functions.path:dirname", | |
| "from_json_string = st2common.expressions.functions.data:from_json_string", | |
| "from_yaml_string = st2common.expressions.functions.data:from_yaml_string", | |
| "json_dump = st2common.expressions.functions.data:to_json_string", | |
| "json_parse = st2common.expressions.functions.data:from_json_string", | |
| "json_escape = st2common.expressions.functions.data:json_escape", | |
| "jsonpath_query = st2common.expressions.functions.data:jsonpath_query", | |
| "regex_match = st2common.expressions.functions.regex:regex_match", | |
| "regex_replace = st2common.expressions.functions.regex:regex_replace", | |
| "regex_search = st2common.expressions.functions.regex:regex_search", | |
| "regex_substring = st2common.expressions.functions.regex:regex_substring", | |
| ( | |
| "to_human_time_from_seconds = " | |
| "st2common.expressions.functions.time:to_human_time_from_seconds" | |
| ), | |
| "to_json_string = st2common.expressions.functions.data:to_json_string", | |
| "to_yaml_string = st2common.expressions.functions.data:to_yaml_string", | |
| "use_none = st2common.expressions.functions.data:use_none", | |
| "version_compare = st2common.expressions.functions.version:version_compare", | |
| "version_more_than = st2common.expressions.functions.version:version_more_than", | |
| "version_less_than = st2common.expressions.functions.version:version_less_than", | |
| "version_equal = st2common.expressions.functions.version:version_equal", | |
| "version_match = st2common.expressions.functions.version:version_match", | |
| "version_bump_major = st2common.expressions.functions.version:version_bump_major", | |
| "version_bump_minor = st2common.expressions.functions.version:version_bump_minor", | |
| "version_bump_patch = st2common.expressions.functions.version:version_bump_patch", | |
| "version_strip_patch = st2common.expressions.functions.version:version_strip_patch", | |
| "yaml_dump = st2common.expressions.functions.data:to_yaml_string", | |
| "yaml_parse = st2common.expressions.functions.data:from_yaml_string", | |
| ], |
| stevedore_namespace("st2common.runners.runner"): { | ||
| "python-script": "python_runner.python_runner", | ||
| }, |
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.
st2/contrib/runners/python_runner/setup.py
Lines 51 to 53 in 9d311c5
| "st2common.runners.runner": [ | |
| "python-script = python_runner.python_runner", | |
| ], |
| stevedore_namespace("st2common.runners.runner"): { | ||
| "remote-shell-cmd": "remote_runner.remote_command_runner", | ||
| "remote-shell-script": "remote_runner.remote_script_runner", | ||
| }, |
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.
st2/contrib/runners/remote_runner/setup.py
Lines 54 to 57 in 9d311c5
| "st2common.runners.runner": [ | |
| "remote-shell-cmd = remote_runner.remote_command_runner", | |
| "remote-shell-script = remote_runner.remote_script_runner", | |
| ], |
| stevedore_namespace("st2common.runners.runner"): { | ||
| "winrm-cmd": "winrm_runner.winrm_command_runner", | ||
| "winrm-ps-cmd": "winrm_runner.winrm_ps_command_runner", | ||
| "winrm-ps-script": "winrm_runner.winrm_ps_script_runner", | ||
| }, |
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.
st2/contrib/runners/winrm_runner/setup.py
Lines 54 to 58 in 9d311c5
| "st2common.runners.runner": [ | |
| "winrm-cmd = winrm_runner.winrm_command_runner", | |
| "winrm-ps-cmd = winrm_runner.winrm_ps_command_runner", | |
| "winrm-ps-script = winrm_runner.winrm_ps_script_runner", | |
| ], |
3166126 to
46ceea5
Compare
This comment was marked as resolved.
This comment was marked as resolved.
db7f769 to
14fb366
Compare
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.
Minor suggested on description as the winrm is 3 runners...
a1b35f1 to
cc74cc5
Compare
tag with stevedore_namespace so that once we enable the pants-plugin for stevedore, pants can install things appropriately for tests to access the setuptools metadata.
…metdata Co-authored-by: Amanda McGuinness <[email protected]>
cc74cc5 to
69c32d7
Compare
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 PR adds the
st2_runner_python_distribution()macro to the BUILD metadata for all of our runners.Thanks to the macro, we only have to define 3 (or 4) parameters for each runner:
runner_name,description,entry_points, and (for the python runner)zip_safe=False. I copied each of these from thesetup.pyfile, which will become obsolete once pants can generate the setup.py file for us. For the description, I tried to keep the spacing fairly consistent, but there was enough variation in the wording that I did not delegate creating the description to the macro.Under
entry_points, I have "tagged" thest2common.runners.runnerand theorquesta.expressions.functionscategories asstevedore_namespaces. Once we switch to 2.16 and enable thepants.backend.experimental.python.framework.stevedoreplugin, thestevedoreplugin will, for tests, use this "tag" to look up which wheels implement a plugin in that stevedore namespace.To facilitate comparison, I will add a comment to each of the files that shows the current
setup.pyentry_points.