-
-
Notifications
You must be signed in to change notification settings - Fork 646
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
Integrate the new Rust ArgSplitter. #21824
Conversation
@@ -188,73 +114,25 @@ def add_goal(scope: str) -> str: | |||
f"The {si.deprecated_scope} goal was renamed to {si.subsystem_cls.options_scope}", | |||
) | |||
|
|||
if (si.is_builtin or si.is_auxiliary) 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.
The Rust side doesn't (yet) know about builtin or auxiliary goals, so we need this logic here. Note that it's copied directly from the deleted block above.
@@ -65,49 +64,6 @@ def assert_unknown_goal(splitter: ArgSplitter, args_str: str, unknown_goals: lis | |||
assert set(unknown_goals) == set(split_args.unknown_goals) | |||
|
|||
|
|||
def test_is_spec(tmp_path: Path, splitter: ArgSplitter, known_scope_infos: list[ScopeInfo]) -> None: |
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 test was ported to Rust, and since we no longer need a Python likely_a_spec()
method, we also don't need to test it separately.
builtin_or_auxiliary_goal: str | None = None | ||
canonical_goals = [] | ||
for goal in native_split_args.goals(): |
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.
Rust returns a string-valued goal name, here we get a ScopeInfo instance for it.
Replaces the implementation of the Python ArgSplitter
with a call to the Rust one.
But the Python ArgSplitter class still exists (for now)
as a thin wrapper, primarily to show that its tests
still pass.
A future change may rip it out entirely and call
ArgSplitter exclusively from other Rust code.