-
Notifications
You must be signed in to change notification settings - Fork 433
Tracking ty compatibility #4168
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
Draft
behrmann
wants to merge
1
commit into
systemd:main
Choose a base branch
from
behrmann:typymctyface
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1907,7 +1907,7 @@ def from_json(cls, s: Union[str, dict[str, Any], SupportsRead[str], SupportsRead | |
| if isinstance(s, str): | ||
| j = json.loads(s) | ||
| elif isinstance(s, dict): | ||
| j = s | ||
| j = s # ty: ignore[invalid-assignment] | ||
| elif hasattr(s, "read"): | ||
| j = json.load(s) | ||
| else: | ||
|
|
@@ -2483,7 +2483,7 @@ def from_partial_json( | |
| if isinstance(s, str): | ||
| j = json.loads(s) | ||
| elif isinstance(s, dict): | ||
| j = s | ||
| j = s # ty: ignore[invalid-assignment] | ||
| elif hasattr(s, "read"): | ||
| j = json.load(s) | ||
| else: | ||
|
|
@@ -4611,7 +4611,7 @@ def create_argument_parser(chdir: bool = True) -> argparse.ArgumentParser: | |
| last_section = s.section | ||
|
|
||
| if s.short and s.const is not None: | ||
| group.add_argument( # type: ignore # needed by pyright | ||
| group.add_argument( # type: ignore # ty: ignore[unused-ignore-comment] # needed by pyright | ||
| s.short, | ||
| metavar="", | ||
| dest=s.dest, | ||
|
|
@@ -4624,7 +4624,7 @@ def create_argument_parser(chdir: bool = True) -> argparse.ArgumentParser: | |
| for long in [s.long, *s.compat_longs]: | ||
| opts = [s.short, long] if s.short and long == s.long and s.const is None else [long] | ||
|
|
||
| group.add_argument( # type: ignore # needed by pyright | ||
| group.add_argument( # type: ignore # ty: ignore[unused-ignore-comment] # needed by pyright | ||
| *opts, | ||
| dest=s.dest, | ||
| choices=s.choices, | ||
|
|
@@ -4643,7 +4643,7 @@ def resolve_deps(images: Sequence[Config], include: Sequence[str]) -> list[Confi | |
| graph = {config.image: config.dependencies for config in images} | ||
|
|
||
| if any((missing := i) not in graph for i in include): | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here |
||
| die(f"No image found with name {missing}") | ||
| die(f"No image found with name {missing}") # ty: ignore[unresolved-reference] | ||
|
|
||
| deps = set() | ||
| queue = [*include] | ||
|
|
@@ -4823,13 +4823,13 @@ def finalize_value(self, setting: ConfigSetting[T]) -> Optional[T]: | |
| # so we ignore the return-value error for it. | ||
| if isinstance(v, list): | ||
| assert isinstance(cfg_value, type(v)) | ||
| return cfg_value + v # type: ignore[return-value] # needed by mypy | ||
| return cfg_value + v # type: ignore[return-value] # ty: ignore[unused-ignore-comment] # needed by mypy | ||
| elif isinstance(v, dict): | ||
| assert isinstance(cfg_value, type(v)) | ||
| return cfg_value | v # type: ignore[return-value] # needed by mypy | ||
| return cfg_value | v # type: ignore[return-value] # ty: ignore[unused-ignore-comment] # needed by mypy | ||
| elif isinstance(v, set): | ||
| assert isinstance(cfg_value, type(v)) | ||
| return cfg_value | v # type: ignore[return-value] # needed by mypy | ||
| return cfg_value | v # type: ignore[return-value] # ty: ignore[unused-ignore-comment] # needed by mypy | ||
| else: | ||
| return v | ||
|
|
||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
You can write this as a regular for loop with a check at the beginning to continue to not have to add the comments I think
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.
That's tracked in this issue and already has a PR