GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — Adding stubs for `ruamel.yaml` by stevenlele · Pull Request #12584 · python/typeshed Conversation
|
| Repository | SourceForge | GitHub mirror |
|---|---|---|
| ruamel.yaml | https://sourceforge.net/p/ruamel-yaml/ | https://github.com/commx/ruamel-yaml |
| ruamel.yaml.clib | https://sourceforge.net/p/ruamel-yaml-clib/ | https://github.com/ruamel/yaml.clib |
| Test data | https://sourceforge.net/p/ruamel-yaml-data/ |
Although the package ships a py.typed file, almost every type hint is Any, which makes coding experience terrible. This falls into the situation mentioned in #11955, which might need some discussion.
The typing information in the package seems to originate from https://sourceforge.net/p/ruamel-yaml/tickets/42/ (from https://github.com/common-workflow-language/schema_salad) in 2016 when things were still in Python 2. Then it was never properly maintained and became a pile of Anys.
This package doesn't follow the best practice of prefixing private properties and methods with underscore(s), which makes writing stubs a lot more complex due to the large number of "public" properties and methods.
It's also worth noting that the documentation isn't well-structured, nor does it cover necessary information like every format option, which makes it even harder to use this library. Adding proper typing information might provide some help.
Since there are already stubs for PyYAML, many modules of They turned out to be not very helpful.ruamel.yaml can be added by referring to the corresponding ones in PyYAML.
A special case in this library is the YAML class, which you need to pass a typ argument to select its parsing mode. Depending on the typ, the methods of YAML behave differently. For example, YAML(typ='rt').seq() returns a CommentedSeq with round-trip-specific methods, while YAML(typ='safe') returns a plain list. To make coding easier, I added pseudo-subclasses of YAML (like _RoundTripYAML) and converted the __init__() method into multiple @overload def __new__() methods which returns different variants based on the typ parameter.
There's also an undocumented rtsc (round-trip split comments) type in the library, but the parsers seem to be very experimental and less-maintained, so I intentionally omitted it in the main module. I found the only usage at https://github.com/SoulMelody/LibreSVIP/blob/main/libresvip/utils/yamlutils/__init__.py#L15 which doesn't seem to be intentional or necessary. Edit: The parser doesn't seem to be working at all on a YAML document with comments.
Just for reference, I found the one and only ruamel.yaml plug-in code example at https://github.com/dstl/Stone-Soup/blob/main/stonesoup/serialise.py which might help understanding how that plug_in parameter works.
MonkeyType provides great help.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
ruamel.yamlruamel.yaml
|
Currently stubtest fails to run: error: not checking stubs due to mypy build errors: /tmp/tmps3q1g0pn/lib/python3.11/site-packages/ruamel/yaml/main.py:47: error: Cannot assign to a type [misc] /tmp/tmps3q1g0pn/lib/python3.11/site-packages/ruamel/yaml/main.py:47: error: Incompatible types in assignment (expression has type "None", variable has type "type[CParser]") [assignment] /tmp/tmps3q1g0pn/lib/python3.11/site-packages/ruamel/yaml/main.py:47: error: Incompatible types in assignment (expression has type "None", variable has type "type[CEmitter]") [assignment] /tmp/tmps3q1g0pn/lib/python3.11/site-packages/ruamel/yaml/main.py:223: error: Unexpected keyword argument "loader" [call-arg] stubs/ruamel.yaml/_ruamel_yaml.pyi:22: note: Called function defined here /tmp/tmps3q1g0pn/lib/python3.11/site-packages/ruamel/yaml/main.py:223: error: Unexpected keyword argument "loader" [call-arg] stubs/ruamel.yaml/_ruamel_yaml.pyi:22: note: Called function defined here For the latter one, Not sure how to fix those. Stubsabot dry run also fails to run: Help needed! |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Remarks on PyYAML is using the typeshed/stubs/PyYAML/yaml/nodes.pyi Lines 5 to 13 in dbe4d32
Sadly, the same trick can't be fully effective here. As you see, typeshed/stubs/ruamel.yaml/ruamel/yaml/error.pyi Lines 22 to 37 in 1f10574
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Thanks! While I didn't check the types in depth, this looks very good to me. A few remarks below.
Also: We now require a comment explaining the use of Anys (or an appropriate type alias). This can either list the allowed types, how the value is used, or any other reason why Any is required.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Hey @srittau, I've updated this two-year-old PR. I replaced |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Hey @srittau, could you please review this PR? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Hey @JelleZijlstra, could you review this PR? It seems @srittau didn't get my @-mentions. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
| pure: bool = False, | ||
| output: Path | _WriteStream | None = None, | ||
| plug_ins: list[str] | None = None, | ||
| ) -> _RoundTripYAML: ... |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
This makes it so constructing a subclass infers _RoundTripYAML instead of the subclass.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Subclassing is a real use case, including in the upstream documentation. However, replacing these return types with Self removes the mode-specific typing that these overloads are intended to provide.
With the current pseudo-subclass approach, I haven't found a standard typing solution that preserves both mode specialization and arbitrary user subclasses automatically. Annotating cls as type[YAML] does not distinguish YAML itself from its subclasses. I'd therefore prefer to retain the specialized return types and document this limitation rather than lose mode-specific typing for all callers.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
You could put perhaps put __new__ definitions on the subclasses? At least the subclasses within this package.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
You could put perhaps put
__new__definitions on the subclasses? At least the subclasses within this package.
The runtime package doesn't define any YAML subclasses, and the subclasses in the stubs are all @type_check_only helpers. So it seems there isn't much we can do here for user-defined subclasses.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Diff from mypy_primer, showing the effect of this PR on open source code: mitmproxy (https://github.com/mitmproxy/mitmproxy) + mitmproxy/optmanager.py:486: error: Need type annotation for "s" [var-annotated] + mitmproxy/tools/console/keymap.py:239: error: Item "StreamMark" of "Mark | StreamMark | None" has no attribute "get_snippet" [union-attr] + mitmproxy/tools/console/keymap.py:239: error: Item "None" of "Mark | StreamMark | None" has no attribute "get_snippet" [union-attr] + mitmproxy/tools/console/keymap.py:242: error: Item "None" of "Mark | StreamMark | None" has no attribute "line" [union-attr] pyodide (https://github.com/pyodide/pyodide) + pyodide-build/pyodide_build/recipe/spec.py:238: error: Cannot assign to a method [method-assign] + pyodide-build/pyodide_build/recipe/skeleton.py:314: error: Cannot assign to a method [method-assign] cwltool (https://github.com/common-workflow-language/cwltool) + cwltool/validate_js.py: note: In function "get_expressions": + cwltool/validate_js.py:53:11: error: Missing type arguments for generic type "CommentedMap" [type-arg] + cwltool/validate_js.py:53:32: error: Missing type arguments for generic type "CommentedSeq" [type-arg] + cwltool/validate_js.py: note: In function "validate_js_expressions": + cwltool/validate_js.py:197:11: error: Missing type arguments for generic type "CommentedMap" [type-arg] + cwltool/update.py: note: In function "v1_2to1_3dev1": + cwltool/update.py:16:24: error: Missing type arguments for generic type "CommentedMap" [type-arg] + cwltool/update.py: note: In function "v1_1to1_2": + cwltool/update.py:73:10: error: Missing type arguments for generic type "CommentedMap" [type-arg] + cwltool/update.py:74:12: error: Missing type arguments for generic type "CommentedMap" [type-arg] + cwltool/update.py:78:10: error: Missing type arguments for generic type "CommentedSeq" [type-arg] + cwltool/update.py:78:25: error: Missing type arguments for generic type "CommentedMap" [type-arg] + cwltool/update.py: note: In function "v1_0to1_1": + cwltool/update.py:89:10: error: Missing type arguments for generic type "CommentedMap" [type-arg] + cwltool/update.py:90:12: error: Missing type arguments for generic type "CommentedMap" [type-arg] + cwltool/update.py:136:19: error: Need type annotation for "seq" [var-annotated] + cwltool/update.py:144:48: error: List item 0 has incompatible type "tuple[str, str | int | float | CWLFileType | CWLDirectoryType | None]"; expected "tuple[str, str]" [list-item] + cwltool/update.py:146:34: error: List item 0 has incompatible type "tuple[str, str | int | float | CWLFileType | CWLDirectoryType | None]"; expected "tuple[str, str]" [list-item] + cwltool/update.py:166:10: error: Missing type arguments for generic type "CommentedMap" [type-arg] + cwltool/update.py:166:25: error: Missing type arguments for generic type "CommentedSeq" [type-arg] + cwltool/update.py:177:9: error: "LineCol" has no attribute "filename" [attr-defined] + cwltool/update.py:182:9: error: "LineCol" has no attribute "filename" [attr-defined] + cwltool/update.py: note: In function "v1_1_0dev1to1_1": + cwltool/update.py:194:10: error: Missing type arguments for generic type "CommentedMap" [type-arg] + cwltool/update.py:195:12: error: Missing type arguments for generic type "CommentedMap" [type-arg] + cwltool/update.py: note: In function "v1_2_0dev1todev2": + cwltool/update.py:201:10: error: Missing type arguments for generic type "CommentedMap" [type-arg] + cwltool/update.py:202:12: error: Missing type arguments for generic type "CommentedMap" [type-arg] + cwltool/update.py: note: In function "v1_2_0dev2todev3": + cwltool/update.py:208:10: error: Missing type arguments for generic type "CommentedMap" [type-arg] + cwltool/update.py:209:12: error: Missing type arguments for generic type "CommentedMap" [type-arg] + cwltool/update.py:221:10: error: Missing type arguments for generic type "CommentedSeq" [type-arg] + cwltool/update.py:221:25: error: Missing type arguments for generic type "CommentedMap" [type-arg] + cwltool/update.py: note: In function "v1_2_0dev3todev4": + cwltool/update.py:231:10: error: Missing type arguments for generic type "CommentedMap" [type-arg] + cwltool/update.py:232:12: error: Missing type arguments for generic type "CommentedMap" [type-arg] + cwltool/update.py: note: In function "v1_2_0dev4todev5": + cwltool/update.py:238:10: error: Missing type arguments for generic type "CommentedMap" [type-arg] + cwltool/update.py:239:12: error: Missing type arguments for generic type "CommentedMap" [type-arg] + cwltool/update.py: note: In function "v1_2_0dev5to1_2": + cwltool/update.py:245:10: error: Missing type arguments for generic type "CommentedMap" [type-arg] + cwltool/update.py:246:12: error: Missing type arguments for generic type "CommentedMap" [type-arg] + cwltool/update.py: note: At top level: + cwltool/update.py:264:30: error: Missing type arguments for generic type "CommentedMap" [type-arg] + cwltool/update.py:270:33: error: Missing type arguments for generic type "CommentedMap" [type-arg] + cwltool/update.py: note: In function "identity": + cwltool/update.py:290:10: error: Missing type arguments for generic type "CommentedMap" [type-arg] + cwltool/update.py:291:12: error: Missing type arguments for generic type "CommentedMap" [type-arg] + cwltool/update.py: note: In function "checkversion": + cwltool/update.py:297:10: error: Missing type arguments for generic type "CommentedSeq" [type-arg] + cwltool/update.py:297:25: error: Missing type arguments for generic type "CommentedMap" [type-arg] + cwltool/update.py:298:15: error: Missing type arguments for generic type "CommentedMap" [type-arg] + cwltool/update.py:300:12: error: Missing type arguments for generic type "CommentedMap" [type-arg] + cwltool/update.py:305:11: error: Missing type arguments for generic type "CommentedMap" [type-arg] + cwltool/update.py:312:9: error: "LineCol" has no attribute "filename" [attr-defined] + cwltool/update.py: note: In function "update": + cwltool/update.py:351:10: error: Missing type arguments for generic type "CommentedSeq" [type-arg] + cwltool/update.py:351:25: error: Missing type arguments for generic type "CommentedMap" [type-arg] + cwltool/update.py:355:15: error: Missing type arguments for generic type "CommentedMap" [type-arg] + cwltool/update.py:357:6: error: Missing type arguments for generic type "CommentedMap" [type-arg] + cwltool/update.py:365:27: error: Missing type arguments for generic type "CommentedMap" [type-arg] + cwltool/builder.py: note: In member "bind_input" of class "Builder": + cwltool/builder.py:196:57: error: Missing type arguments for generic type "CommentedMap" [type-arg] + cwltool/context.py: note: In function "make_tool_notimpl": + cwltool/context.py:47:40: error: Missing type arguments for generic type "CommentedMap" [type-arg] + cwltool/context.py: note: In member "__init__" of class "LoadingContext": + cwltool/context.py:104:27: error: Missing type arguments for generic type "CommentedMap" [type-arg] + cwltool/process.py: note: In member "__init__" of class "Process": + cwltool/process.py:569:26: error: Missing type arguments for generic type "CommentedMap" [type-arg] + cwltool/process.py: note: In member "_init_job" of class "Process": + cwltool/process.py:860:20: error: Need type annotation for "bindings" [var-annotated] + cwltool/process.py:994:21: error: "LineCol" has no attribute "filename" [attr-defined] + cwltool/process.py:999:21: error: "LineCol" has no attribute "filename" [attr-defined] + cwltool/process.py: note: In member "visit" of class "Process": + cwltool/process.py:1142:35: error: Missing type arguments for generic type "CommentedMap" [type-arg] + cwltool/process.py: note: In function "scandeps": + cwltool/process.py:1235:35: error: Missing type arguments for generic type "CommentedMap" [type-arg] + cwltool/process.py:1235:50: error: Missing type arguments for generic type "CommentedSeq" [type-arg] + cwltool/load_tool.py: note: In function "fetch_document": + cwltool/load_tool.py:114:28: error: Missing type arguments for generic type "CommentedMap" [type-arg] + cwltool/load_tool.py:135:13: error: Missing type arguments for generic type "CommentedMap" [type-arg] + cwltool/load_tool.py:141:28: error: Missing type arguments for generic type "CommentedMap" [type-arg] + cwltool/load_tool.py: note: In function "update_index": + cwltool/load_tool.py:294:47: error: Missing type arguments for generic type "CommentedMap" [type-arg] + cwltool/load_tool.py: note: In function "fast_parser": + cwltool/load_tool.py:300:18: error: Missing type arguments for generic type "CommentedMap" [type-arg] + cwltool/load_tool.py:300:33: error: Missing type arguments for generic type "CommentedSeq" [type-arg] + cwltool/load_tool.py:305:12: error: Missing type arguments for generic type "CommentedMap" [type-arg] + cwltool/load_tool.py:305:27: error: Missing type arguments for generic type "CommentedSeq" [type-arg] + cwltool/load_tool.py:368:15: error: Missing type arguments for generic type "CommentedMap" [type-arg] + cwltool/load_tool.py:368:29: error: Missing type arguments for generic type "CommentedSeq" [type-arg] + cwltool/load_tool.py:370:13: error: Missing type arguments for generic type "CommentedMap" [type-arg] + cwltool/load_tool.py: note: In function "resolve_and_validate_document": + cwltool/load_tool.py:375:18: error: Missing type arguments for generic type "CommentedMap" [type-arg] + cwltool/load_tool.py:375:33: error: Missing type arguments for generic type "CommentedSeq" [type-arg] + cwltool/load_tool.py:511:9: error: "LineCol" has no attribute "filename" [attr-defined] + cwltool/load_tool.py: note: In function "make_tool": + cwltool/load_tool.py:560:26: error: Missing type arguments for generic type "CommentedMap" [type-arg] + cwltool/load_tool.py:560:41: error: Missing type arguments for generic type "CommentedSeq" [type-arg] + cwltool/load_tool.py:565:32: error: Missing type arguments for generic type "CommentedMap" [type-arg] + cwltool/load_tool.py:565:47: error: Missing type arguments for generic type "CommentedSeq" [type-arg] + cwltool/load_tool.py: note: In function "recursive_resolve_and_validate_document": + cwltool/load_tool.py:643:18: error: Missing type arguments for generic type "CommentedMap" [type-arg] + cwltool/load_tool.py:643:33: error: Missing type arguments for generic type "CommentedSeq" [type-arg] + cwltool/procgenerator.py: note: In member "__init__" of class "ProcessGenerator": + cwltool/procgenerator.py:68:26: error: Missing type arguments for generic type "CommentedMap" [type-arg] + cwltool/command_line_tool.py: note: In member "__init__" of class "CommandLineTool": + cwltool/command_line_tool.py:425:26: error: Missing type arguments for generic type "CommentedMap" [type-arg] + cwltool/command_line_tool.py: note: In member "collect_output_ports" of class "CommandLineTool": + cwltool/command_line_tool.py:1249:16: error: Missing type arguments for generic type "CommentedSeq" [type-arg] + cwltool/workflow.py: note: In function "default_make_tool": + cwltool/workflow.py:29:40: error: Missing type arguments for generic type "CommentedMap" [type-arg] + cwltool/workflow.py: note: In member "__init__" of class "Workflow": + cwltool/workflow.py:59:26: error: Missing type arguments for generic type "CommentedMap" [type-arg] + cwltool/workflow.py: note: In member "make_workflow_step" of class "Workflow": + cwltool/workflow.py:133:26: error: Missing type arguments for generic type "CommentedMap" [type-arg] + cwltool/workflow.py: note: In member "visit" of class "Workflow": + cwltool/workflow.py:163:35: error: Missing type arguments for generic type "CommentedMap" [type-arg] + cwltool/workflow.py: note: In member "__init__" of class "WorkflowStep": + cwltool/workflow.py:183:26: error: Missing type arguments for generic type "CommentedMap" [type-arg] + cwltool/workflow.py:252:28: error: Missing type arguments for generic type "CommentedMap" [type-arg] + cwltool/workflow.py:310:17: error: "LineCol" has no attribute "filename" [attr-defined] + cwltool/workflow.py: note: In member "visit" of class "WorkflowStep": + cwltool/workflow.py:449:35: error: Missing type arguments for generic type "CommentedMap" [type-arg] + tests/test_path_mapper_extension.py: note: In function "_make_clt": + tests/test_path_mapper_extension.py:39:13: error: Missing type arguments for generic type "CommentedMap" [type-arg] + tests/test_anon_types.py:11:5: error: Missing type arguments for generic type "CommentedMap" [type-arg] + tests/test_anon_types.py: note: In function "test_anon_types": + tests/test_anon_types.py:118:30: error: Missing type arguments for generic type "CommentedMap" [type-arg] + cwltool/subgraph.py: note: In function "get_subgraph": + cwltool/subgraph.py:112:6: error: Missing type arguments for generic type "CommentedMap" [type-arg] + cwltool/subgraph.py:184:17: error: Need type annotation for "extracted" [var-annotated] + cwltool/subgraph.py: note: In function "get_step": + cwltool/subgraph.py:210:80: error: Missing type arguments for generic type "CommentedMap" [type-arg] + cwltool/subgraph.py:212:17: error: Need type annotation for "extracted" [var-annotated] + cwltool/pack.py: note: In function "pack": + cwltool/pack.py:232:24: error: Missing type arguments for generic type "CommentedMap" [type-arg] + cwltool/pack.py:266:9: error: "Sequence[str]" has no attribute "append" [attr-defined] + cwltool/pack.py:273:20: error: "str" has no attribute "pop" [attr-defined] + cwltool/pack.py:278:18: error: Argument 1 to "import_embed" has incompatible type "CommentedMap[str, Sequence[str]]"; expected "MutableSequence[MutableMapping[str, CWLOutputType | None]] | MutableMapping[str, CWLOutputType | None] | CWLOutputType | None" [arg-type] + cwltool/pack.py:280:5: error: Unsupported target for indexed assignment ("str") [index] + cwltool/pack.py:284:13: error: No overload variant of "__getitem__" of "str" matches argument type "str" [call-overload] + cwltool/pack.py:284:13: note: Possible overload variants: + cwltool/pack.py:284:13: note: def __getitem__(self, SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> str + cwltool/pack.py:298:9: error: Unsupported target for indexed assignment ("str") [index] + cwltool/pack.py:300:13: error: Unsupported target for indexed assignment ("str") [index] + cwltool/pack.py:302:13: error: Unsupported target for indexed assignment ("str") [index] + cwltool/pack.py:308:12: error: Incompatible return value type (got "CommentedMap[str, Sequence[str]]", expected "MutableMapping[str, CWLOutputType | None]") [return-value] + cwltool/executors.py: note: In member "run_jobs" of class "SingleJobExecutor": + cwltool/executors.py:240:36: error: "LineCol" has no attribute "filename" [attr-defined] + cwltool/cwlrdf.py: note: In function "gather": + cwltool/cwlrdf.py:19:20: error: Missing type arguments for generic type "CommentedMap" [type-arg] + cwltool/main.py: note: In function "generate_input_template": + cwltool/main.py:332:16: error: Need type annotation for "template" [var-annotated] + cwltool/main.py: note: In function "find_deps": + cwltool/main.py:609:41: error: Missing type arguments for generic type "CommentedMap" [type-arg] + cwltool/main.py:609:56: error: Missing type arguments for generic type "CommentedSeq" [type-arg] + cwltool/main.py: note: In function "choose_step": + cwltool/main.py:853:19: error: Missing type arguments for generic type "CommentedMap" [type-arg] + cwltool/main.py:853:33: error: Missing type arguments for generic type "CommentedSeq" [type-arg] + cwltool/main.py: note: In function "print_targets": + cwltool/main.py:949:42: error: Missing type arguments for generic type "CommentedMap" [type-arg] + cwltool/main.py: note: In function "main": + cwltool/main.py:1125:37: error: Missing type arguments for generic type "CommentedMap" [type-arg] + cwltool/main.py:1125:51: error: Missing type arguments for generic type "CommentedSeq" [type-arg] + tests/test_tmpdir.py: note: In function "test_docker_commandLineTool_job_tmpdir_prefix": + tests/test_tmpdir.py:53:13: error: Missing type arguments for generic type "CommentedMap" [type-arg] + tests/test_tmpdir.py: note: In function "test_commandLineTool_job_tmpdir_prefix": + tests/test_tmpdir.py:98:13: error: Missing type arguments for generic type "CommentedMap" [type-arg] + tests/test_subclass_mypyc.py: note: In function "test_subclass_CLT": + tests/test_subclass_mypyc.py:28:32: error: Missing type arguments for generic type "CommentedMap" [type-arg] + tests/test_subclass_mypyc.py: note: In function "test_subclass_exprtool": + tests/test_subclass_mypyc.py:51:37: error: Missing type arguments for generic type "CommentedMap" [type-arg] + tests/test_subclass_mypyc.py: note: In function "test_pickle_unpickle_workflow": + tests/test_subclass_mypyc.py:67:44: error: Missing type arguments for generic type "CommentedMap" [type-arg] + tests/test_streaming.py:21:5: error: Missing type arguments for generic type "CommentedMap" [type-arg] + tests/test_path_checks.py: note: In function "test_clt_returns_specialchar_names": + tests/test_path_checks.py:145:13: error: Missing type arguments for generic type "CommentedMap" [type-arg] + tests/test_mpi.py: note: In function "mk_tool": + tests/test_mpi.py:308:16: error: Missing type arguments for generic type "CommentedMap" [type-arg] + tests/test_mpi.py:309:17: error: Missing type arguments for generic type "CommentedMap" [type-arg] + tests/test_mpi.py:314:45: error: Argument 1 to "CommentedSeq" has incompatible type "list[CommentedMap[Any, Any]]"; expected "Iterable[str]" [arg-type] + tests/test_mpi.py:316:38: error: Argument 1 to "CommentedSeq" has incompatible type "list[CommentedMap[Any, Any]]"; expected "Iterable[str]" [arg-type] + tests/test_mpi.py:326:19: error: Invalid index type "Sequence[str]" for "dict[str, CommentedMap[Any, Any] | CommentedSeq[Any] | str | None]"; expected type "str" [index] + tests/test_mpi.py:327:66: error: Argument 1 to "load_tool" has incompatible type "CommentedMap[str, Sequence[str]]"; expected "str | MutableMapping[str, CWLOutputType | None]" [arg-type] + tests/test_examples.py: note: In function "test_scandeps": + tests/test_examples.py:428:23: error: Missing type arguments for generic type "CommentedMap" [type-arg] + tests/test_examples.py:428:38: error: Missing type arguments for generic type "CommentedSeq" [type-arg] + tests/test_examples.py:429:10: error: Missing type arguments for generic type "CommentedMap" [type-arg] + tests/test_examples.py:429:25: error: Missing type arguments for generic type "CommentedSeq" [type-arg] + tests/test_examples.py: note: In function "test_scandeps_samedirname": + tests/test_examples.py:533:23: error: Missing type arguments for generic type "CommentedMap" [type-arg] + tests/test_examples.py:533:38: error: Missing type arguments for generic type "CommentedSeq" [type-arg] + tests/test_examples.py:534:10: error: Missing type arguments for generic type "CommentedMap" [type-arg] + tests/test_examples.py:534:25: error: Missing type arguments for generic type "CommentedSeq" [type-arg] paasta (https://github.com/yelp/paasta) + paasta_tools/setup_tron_namespace.py:186: error: Need type annotation for "k8s_enabled_for_cluster" [var-annotated] materialize (https://github.com/MaterializeInc/materialize) - misc/python/materialize/cli/helm_chart_version_bump.py:14: error: Cannot find implementation or library stub for module named "ruamel.yaml" [import-not-found] schema_salad (https://github.com/common-workflow-language/schema_salad) + src/schema_salad/sourceline.py: note: In function "_add_lc_filename": + src/schema_salad/sourceline.py:14:9: error: "LineCol" has no attribute "filename" [attr-defined] + src/schema_salad/sourceline.py: note: In function "cmap": + src/schema_salad/sourceline.py:169:26: error: Missing type arguments for generic type "CommentedMap" [type-arg] + src/schema_salad/sourceline.py:169:41: error: Missing type arguments for generic type "CommentedSeq" [type-arg] + src/schema_salad/sourceline.py:202:21: error: Need type annotation for "cm" [var-annotated] + src/schema_salad/sourceline.py:209:25: error: Incompatible types in assignment (expression has type "list[int]", variable has type "list[int | None]") [assignment] + src/schema_salad/sourceline.py:209:25: note: "list" is invariant -- see https://mypy.readthedocs.io/en/stable/common_issues.html#variance + src/schema_salad/sourceline.py:209:25: note: Consider using "Sequence" instead, which is covariant + src/schema_salad/sourceline.py:211:32: error: Argument "lc" to "cmap" has incompatible type "list[int | None]"; expected "list[int] | None" [arg-type] + src/schema_salad/sourceline.py:212:38: error: Argument 2 to "add_kv_line_col" of "LineCol" has incompatible type "list[int | None]"; expected "list[int]" [arg-type] + src/schema_salad/sourceline.py:213:13: error: "LineCol" has no attribute "filename" [attr-defined] + src/schema_salad/sourceline.py:216:21: error: Need type annotation for "cs" [var-annotated] + src/schema_salad/sourceline.py:222:25: error: Incompatible types in assignment (expression has type "list[int]", variable has type "list[int | None]") [assignment] + src/schema_salad/sourceline.py:222:25: note: "list" is invariant -- see https://mypy.readthedocs.io/en/stable/common_issues.html#variance + src/schema_salad/sourceline.py:222:25: note: Consider using "Sequence" instead, which is covariant + src/schema_salad/sourceline.py:224:35: error: Argument "lc" to "cmap" has incompatible type "list[int | None]"; expected "list[int] | None" [arg-type] + src/schema_salad/sourceline.py:225:39: error: Argument 2 to "add_kv_line_col" of "LineCol" has incompatible type "list[int | None]"; expected "list[int]" [arg-type] + src/schema_salad/sourceline.py:226:13: error: "LineCol" has no attribute "filename" [attr-defined] + src/schema_salad/utils.py:25:40: error: Missing type arguments for generic type "CommentedSeq" [type-arg] + src/schema_salad/utils.py:25:54: error: Missing type arguments for generic type "CommentedMap" [type-arg] + src/schema_salad/utils.py:26:50: error: Missing type arguments for generic type "CommentedSeq" [type-arg] + src/schema_salad/utils.py:26:64: error: Missing type arguments for generic type "CommentedMap" [type-arg] + src/schema_salad/utils.py:27:39: error: Missing type arguments for generic type "CommentedSeq" [type-arg] + src/schema_salad/utils.py:27:53: error: Missing type arguments for generic type "CommentedMap" [type-arg] + src/schema_salad/utils.py:28:58: error: Missing type arguments for generic type "CommentedMap" [type-arg] + src/schema_salad/utils.py:28:72: error: Missing type arguments for generic type "CommentedSeq" [type-arg] + src/schema_salad/utils.py:30:49: error: Missing type arguments for generic type "CommentedMap" [type-arg] + src/schema_salad/utils.py:31:34: error: Missing type arguments for generic type "CommentedMap" [type-arg] + src/schema_salad/utils.py:31:48: error: Missing type arguments for generic type "CommentedSeq" [type-arg] + src/schema_salad/utils.py:35:46: error: Missing type arguments for generic type "CommentedMap" [type-arg] + src/schema_salad/utils.py:35:60: error: Missing type arguments for generic type "CommentedSeq" [type-arg] + src/schema_salad/jsonld_context.py: note: In function "fix_jsonld_ids": + src/schema_salad/jsonld_context.py:206:25: error: Missing type arguments for generic type "CommentedMap" [type-arg] + src/schema_salad/jsonld_context.py:206:54: error: Missing type arguments for generic type "CommentedSeq" [type-arg] + src/schema_salad/jsonld_context.py: note: In function "makerdf": + src/schema_salad/jsonld_context.py:221:9: error: Missing type arguments for generic type "CommentedMap" [type-arg] + src/schema_salad/jsonld_context.py:221:38: error: Missing type arguments for generic type "CommentedSeq" [type-arg] + src/schema_salad/ref_resolver.py: note: In function "to_validation_exception": + src/schema_salad/ref_resolver.py:78:38: error: Argument 1 to "ValidationException" has incompatible type "str | None"; expected "str" [arg-type] + src/schema_salad/ref_resolver.py:80:40: error: Item "None" of "Mark | StreamMark | None" has no attribute "name" [union-attr] + src/schema_salad/ref_resolver.py:80:40: error: Argument 3 to "sub" has incompatible type "str | Any | None"; expected "str" [arg-type] + src/schema_salad/ref_resolver.py:81:18: error: Item "None" of "Mark | StreamMark | None" has no attribute "line" [union-attr] + src/schema_salad/ref_resolver.py:81:33: error: Item "None" of "Mark | StreamMark | None" has no attribute "column" [union-attr] + src/schema_salad/ref_resolver.py:88:51: error: Argument 3 to "sub" has incompatible type "str | None"; expected "str" [arg-type] + src/schema_salad/ref_resolver.py: note: At top level: + src/schema_salad/ref_resolver.py:96:26: error: Missing type arguments for generic type "CommentedMap" [type-arg] + src/schema_salad/ref_resolver.py:96:41: error: Missing type arguments for generic type "CommentedSeq" [type-arg] + src/schema_salad/ref_resolver.py: note: In member "resolve_ref" of class "Loader": + src/schema_salad/ref_resolver.py:428:14: error: Missing type arguments for generic type "CommentedMap" [type-arg] + src/schema_salad/ref_resolver.py:490:27: error: Missing type arguments for generic type "CommentedMap" [type-arg] + src/schema_salad/ref_resolver.py:490:42: error: Missing type arguments for generic type "CommentedSeq" [type-arg] + src/schema_salad/ref_resolver.py: note: In member "_resolve_idmap" of class "Loader": + src/schema_salad/ref_resolver.py:586:19: error: Missing type arguments for generic type "CommentedMap" [type-arg] + src/schema_salad/ref_resolver.py:599:26: error: Need type annotation for "ls" [var-annotated] + src/schema_salad/ref_resolver.py:602:28: error: Missing type arguments for generic type "CommentedMap" [type-arg] + src/schema_salad/ref_resolver.py:610:33: error: "LineCol" has no attribute "filename" [attr-defined] + src/schema_salad/ref_resolver.py:624:25: error: "LineCol" has no attribute "filename" [attr-defined] + src/schema_salad/ref_resolver.py:628:25: error: "LineCol" has no attribute "filename" [attr-defined] + src/schema_salad/ref_resolver.py: note: In member "_type_dsl" of class "Loader": + src/schema_salad/ref_resolver.py:635:18: error: Missing type arguments for generic type "CommentedMap" [type-arg] + src/schema_salad/ref_resolver.py:635:33: error: Missing type arguments for generic type "CommentedSeq" [type-arg] + src/schema_salad/ref_resolver.py:638:16: error: Missing type arguments for generic type "CommentedMap" [type-arg] + src/schema_salad/ref_resolver.py:638:31: error: Missing type arguments for generic type "CommentedSeq" [type-arg] + src/schema_salad/ref_resolver.py:659:37: error: Argument 1 to "CommentedMap" has incompatible type "tuple[tuple[str, str], tuple[str, str | CommentedMap[Any, Any] | CommentedSeq[Any]]]"; expected "Iterable[tuple[str, str]]" [arg-type] + src/schema_salad/ref_resolver.py:660:45: error: Argument 2 to "add_kv_line_col" of "LineCol" has incompatible type "LineCol"; expected "list[int]" [arg-type] + src/schema_salad/ref_resolver.py:661:46: error: Argument 2 to "add_kv_line_col" of "LineCol" has incompatible type "LineCol"; expected "list[int]" [arg-type] + src/schema_salad/ref_resolver.py:662:13: error: "LineCol" has no attribute "filename" [attr-defined] + src/schema_salad/ref_resolver.py:663:29: error: Missing type arguments for generic type "CommentedMap" [type-arg] + src/schema_salad/ref_resolver.py:663:44: error: Missing type arguments for generic type "CommentedSeq" [type-arg] + src/schema_salad/ref_resolver.py:669:38: error: Argument 2 to "add_kv_line_col" of "LineCol" has incompatible type "LineCol"; expected "list[int]" [arg-type] + src/schema_salad/ref_resolver.py:670:38: error: Argument 2 to "add_kv_line_col" of "LineCol" has incompatible type "LineCol"; expected "list[int]" [arg-type] + src/schema_salad/ref_resolver.py:671:13: error: "LineCol" has no attribute "filename" [attr-defined] + src/schema_salad/ref_resolver.py:672:24: error: Missing type arguments for generic type "CommentedMap" [type-arg] + src/schema_salad/ref_resolver.py:672:39: error: Missing type arguments for generic type "CommentedSeq" [type-arg] + src/schema_salad/ref_resolver.py: note: In member "_secondaryFile_dsl" of class "Loader": + src/schema_salad/ref_resolver.py:680:18: error: Missing type arguments for generic type "CommentedMap" [type-arg] + src/schema_salad/ref_resolver.py:680:33: error: Missing type arguments for generic type "CommentedSeq" [type-arg] + src/schema_salad/ref_resolver.py:683:16: error: Missing type arguments for generic type "CommentedMap" [type-arg] + src/schema_salad/ref_resolver.py:683:31: error: Missing type arguments for generic type "CommentedSeq" [type-arg] + src/schema_salad/ref_resolver.py:690:46: error: Argument 2 to "add_kv_line_col" of "LineCol" has incompatible type "LineCol"; expected "list[int]" [arg-type] + src/schema_salad/ref_resolver.py:691:47: error: Argument 2 to "add_kv_line_col" of "LineCol" has incompatible type "LineCol"; expected "list[int]" [arg-type] + src/schema_salad/ref_resolver.py:692:9: error: "LineCol" has no attribute "filename" [attr-defined] + src/schema_salad/ref_resolver.py: note: In member "_apply_dsl" of class "Loader": + src/schema_salad/ref_resolver.py:697:22: error: Missing type arguments for generic type "CommentedMap" [type-arg] + src/schema_salad/ref_resolver.py:697:37: error: Missing type arguments for generic type "CommentedSeq" [type-arg] + src/schema_salad/ref_resolver.py:702:16: error: Missing type arguments for generic type "CommentedMap" [type-arg] + src/schema_salad/ref_resolver.py:702:31: error: Missing type arguments for generic type "CommentedSeq" [type-arg] + src/schema_salad/ref_resolver.py: note: In member "_resolve_dsl" of class "Loader": + src/schema_salad/ref_resolver.py:711:19: error: Missing type arguments for generic type "CommentedMap" [type-arg] + src/schema_salad/ref_resolver.py:725:25: error: Argument 4 to "_apply_dsl" of "Loader" has incompatible type "list[int] | LineCol"; expected "LineCol" [arg-type] + src/schema_salad/ref_resolver.py:735:51: error: Argument 4 to "_apply_dsl" of "Loader" has incompatible type "list[int]"; expected "LineCol" [arg-type] + src/schema_salad/ref_resolver.py:735:69: error: "LineCol" has no attribute "filename" [attr-defined] + src/schema_salad/ref_resolver.py:741:30: error: Need type annotation for "datum3" [var-annotated] + src/schema_salad/ref_resolver.py:747:76: error: Value of type "dict[Hashable, list[int]] | None" is not indexable [index] + src/schema_salad/ref_resolver.py: note: In member "_resolve_identifier" of class "Loader": + src/schema_salad/ref_resolver.py:760:45: error: Missing type arguments for generic type "CommentedMap" [type-arg] + src/schema_salad/ref_resolver.py: note: In member "_resolve_identity" of class "Loader": + src/schema_salad/ref_resolver.py:781:57: error: Missing type arguments for generic type "CommentedMap" [type-arg] + src/schema_salad/ref_resolver.py: note: In member "_normalize_fields" of class "Loader": + src/schema_salad/ref_resolver.py:797:43: error: Missing type arguments for generic type "CommentedMap" [type-arg] + src/schema_salad/ref_resolver.py:804:53: error: Value of type "dict[Hashable, list[int]] | None" is not indexable [index] + src/schema_salad/ref_resolver.py: note: In member "_resolve_uris" of class "Loader": + src/schema_salad/ref_resolver.py:809:57: error: Missing type arguments for generic type "CommentedMap" [type-arg] + src/schema_salad/ref_resolver.py: note: In member "resolve_all" of class "Loader": + src/schema_salad/ref_resolver.py:845:20: error: Need type annotation for "metadata" [var-annotated] + src/schema_salad/ref_resolver.py:965:34: error: Value of type "dict[Hashable, list[int]] | None" is not indexable [index] + src/schema_salad/ref_resolver.py:969:33: error: Unsupported target for indexed assignment ("dict[Hashable, list[int]] | None") [index] + src/schema_salad/ref_resolver.py:969:59: error: Value of type "dict[Hashable, list[int]] | None" is not indexable [index] + src/schema_salad/ref_resolver.py:972:33: error: Unsupported target for indexed assignment ("dict[Hashable, list[int]] | None") [index] + src/schema_salad/ref_resolver.py: note: In member "fetch" of class "Loader": + src/schema_salad/ref_resolver.py:1015:34: error: Missing type arguments for generic type "CommentedSeq" [type-arg] + src/schema_salad/ref_resolver.py:1015:49: error: Missing type arguments for generic type "CommentedMap" [type-arg] + src/schema_salad/ref_resolver.py: note: In member "validate_link" of class "Loader": + src/schema_salad/ref_resolver.py:1065:21: error: Missing type arguments for generic type "CommentedSeq" [type-arg] + src/schema_salad/ref_resolver.py:1065:36: error: Missing type arguments for generic type "CommentedMap" [type-arg] + src/schema_salad/ref_resolver.py:1070:16: error: Missing type arguments for generic type "CommentedSeq" [type-arg] + src/schema_salad/ref_resolver.py:1070:31: error: Missing type arguments for generic type "CommentedMap" [type-arg] + src/schema_salad/ref_resolver.py: note: In function "_copy_dict_without_key": + src/schema_salad/ref_resolver.py:1204:16: error: Missing type arguments for generic type "CommentedMap" [type-arg] + src/schema_salad/ref_resolver.py:1205:6: error: Missing type arguments for generic type "CommentedMap" [type-arg] + src/schema_salad/ref_resolver.py:1211:9: error: "LineCol" has no attribute "filename" [attr-defined] + src/schema_salad/python_codegen_support.py: note: In member "load" of class "_IdMapLoader": + src/schema_salad/python_codegen_support.py:589:21: error: "LineCol" has no attribute "filename" [attr-defined] + src/schema_salad/metaschema.py: note: In member "load" of class "_IdMapLoader": + src/schema_salad/metaschema.py:611:21: error: "LineCol" has no attribute "filename" [attr-defined] + src/schema_salad/schema.py: note: In function "get_metaschema": + src/schema_salad/schema.py:199:26: error: Argument 1 to "load" of "YAML" has incompatible type "str | Graph | bool"; expected "Path | str | bytes | SupportsRead[str] | SupportsRead[bytes]" [arg-type] + src/schema_salad/schema.py: note: In function "load_and_validate": + src/schema_salad/schema.py:285:15: error: Missing type arguments for generic type "CommentedMap" [type-arg] + src/schema_salad/schema.py: note: In function "validate_doc": + src/schema_salad/schema.py:343:37: error: List item 0 has incompatible type "int | None"; expected "int" [list-item] + src/schema_salad/schema.py:343:50: error: List item 1 has incompatible type "int | None"; expected "int" [list-item] + src/schema_salad/schema.py:344:9: error: "LineCol" has no attribute "filename" [attr-defined] + src/schema_salad/main.py: note: In function "printrdf": + src/schema_salad/main.py:43:9: error: Missing type arguments for generic type "CommentedMap" [type-arg] + src/schema_salad/main.py:43:24: error: Missing type arguments for generic type "CommentedSeq" [type-arg] + src/schema_salad/tests/test_ref_resolver.py: note: In function "test_attachments": + src/schema_salad/tests/test_ref_resolver.py:221:19: error: Missing type arguments for generic type "CommentedMap" [type-arg] + src/schema_salad/tests/test_ref_resolver.py:221:34: error: Missing type arguments for generic type "CommentedSeq" [type-arg] + src/schema_salad/tests/test_ref_resolver.py:222:21: error: No overload variant of "__getitem__" of "MutableSliceableSequence" matches argument type "str" [call-overload] + src/schema_salad/tests/test_ref_resolver.py:222:21: note: Possible overload variants: + src/schema_salad/tests/test_ref_resolver.py:222:21: note: def __getitem__(self, int, /) -> Any + src/schema_salad/tests/test_ref_resolver.py:222:21: note: def __getitem__(self, slice[Any, Any, Any], /) -> CommentedSeq[Any] + src/schema_salad/tests/test_ref_resolver.py:232:19: error: Missing type arguments for generic type "CommentedMap" [type-arg] + src/schema_salad/tests/test_ref_resolver.py:232:34: error: Missing type arguments for generic type "CommentedSeq" [type-arg] + src/schema_salad/tests/test_ref_resolver.py:233:21: error: No overload variant of "__getitem__" of "MutableSliceableSequence" matches argument type "str" [call-overload] + src/schema_salad/tests/test_ref_resolver.py:233:21: note: Possible overload variants: + src/schema_salad/tests/test_ref_resolver.py:233:21: note: def __getitem__(self, int, /) -> Any + src/schema_salad/tests/test_ref_resolver.py:233:21: note: def __getitem__(self, slice[Any, Any, Any], /) -> CommentedSeq[Any] + src/schema_salad/tests/test_examples.py: note: In function "test_rdf_datetime": + src/schema_salad/tests/test_examples.py:452:9: error: Missing type arguments for generic type "CommentedMap" [type-arg] + src/schema_salad/tests/test_examples.py:453:9: error: Missing type arguments for generic type "CommentedMap" [type-arg] scipy-stubs (https://github.com/scipy/scipy-stubs) - tests/misc/test_submodules_empty.pyi:3: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Hey @JelleZijlstra, could you review the changes? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Requested changes must be addressed to merge this pull request.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.