microsoft / pyright

Static Type Checker for Python
Other
13.48k stars 1.48k forks source link

Dynamically import smol-toml package #9463

Closed heejaechang closed 1 week ago

heejaechang commented 1 week ago

module change in tsconfig.json in https://github.com/microsoft/pyright/commit/6be5f8cfb989d0c77c313a1fd1a0286cc1b26c1e#diff-ac3a7b49798141e77c54e96bca892a082469cc83bb335322b35c01e020b060c8R1142 is causing issues in pylance due to it supporting multiple environments such as webpack, ts-node, browser and etc.

this is another approach to use smol-toml. confirmed it works as expected with webpack, ts-node and etc.

github-actions[bot] commented 1 week ago

Diff from mypy_primer, showing the effect of this PR on open source code:


more-itertools (https://github.com/more-itertools/more-itertools)
+ Pyproject file parse attempt 1 error: {}
+ Pyproject file parse attempt 2 error: {}
+ Pyproject file parse attempt 3 error: {}
+ Pyproject file parse attempt 4 error: {}
+ Pyproject file parse attempt 5 error: {}
+ Pyproject file parse attempt 6 error: {}
+ Config file "/tmp/mypy_primer/projects/more-itertools/pyproject.toml" could not be parsed. Verify that format is correct.

kornia (https://github.com/kornia/kornia)
+ Pyproject file parse attempt 1 error: {}
+ Pyproject file parse attempt 2 error: {}
+ Pyproject file parse attempt 3 error: {}
+ Pyproject file parse attempt 4 error: {}
+ Pyproject file parse attempt 5 error: {}
+ Pyproject file parse attempt 6 error: {}
+ Config file "/tmp/mypy_primer/projects/kornia/pyproject.toml" could not be parsed. Verify that format is correct.

paasta (https://github.com/yelp/paasta)
+ Pyproject file parse attempt 1 error: {}
+ Pyproject file parse attempt 2 error: {}
+ Pyproject file parse attempt 3 error: {}
+ Pyproject file parse attempt 4 error: {}
+ Pyproject file parse attempt 5 error: {}
+ Pyproject file parse attempt 6 error: {}
+ Config file "/tmp/mypy_primer/projects/paasta/pyproject.toml" could not be parsed. Verify that format is correct.

psycopg (https://github.com/psycopg/psycopg)
+ Pyproject file parse attempt 1 error: {}
+ Pyproject file parse attempt 2 error: {}
+ Pyproject file parse attempt 3 error: {}
+ Pyproject file parse attempt 4 error: {}
+ Pyproject file parse attempt 5 error: {}
+ Pyproject file parse attempt 6 error: {}
+ Config file "/tmp/mypy_primer/projects/psycopg/pyproject.toml" could not be parsed. Verify that format is correct.

starlette (https://github.com/encode/starlette)
+ Pyproject file parse attempt 1 error: {}
+ Pyproject file parse attempt 2 error: {}
+ Pyproject file parse attempt 3 error: {}
+ Pyproject file parse attempt 4 error: {}
+ Pyproject file parse attempt 5 error: {}
+ Pyproject file parse attempt 6 error: {}
+ Config file "/tmp/mypy_primer/projects/starlette/pyproject.toml" could not be parsed. Verify that format is correct.

openlibrary (https://github.com/internetarchive/openlibrary)
+ Pyproject file parse attempt 1 error: {}
+ Pyproject file parse attempt 2 error: {}
+ Pyproject file parse attempt 3 error: {}
+ Pyproject file parse attempt 4 error: {}
+ Pyproject file parse attempt 5 error: {}
+ Pyproject file parse attempt 6 error: {}
+ Config file "/tmp/mypy_primer/projects/openlibrary/pyproject.toml" could not be parsed. Verify that format is correct.

mkosi (https://github.com/systemd/mkosi)
+ Pyproject file parse attempt 1 error: {}
+ Pyproject file parse attempt 2 error: {}
+ Pyproject file parse attempt 3 error: {}
+ Pyproject file parse attempt 4 error: {}
+ Pyproject file parse attempt 5 error: {}
+ Pyproject file parse attempt 6 error: {}
+ Config file "/tmp/mypy_primer/projects/mkosi/pyproject.toml" could not be parsed. Verify that format is correct.

steam.py (https://github.com/Gobot1234/steam.py)
+ Pyproject file parse attempt 1 error: {}
+ Pyproject file parse attempt 2 error: {}
+ Pyproject file parse attempt 3 error: {}
+ Pyproject file parse attempt 4 error: {}
+ Pyproject file parse attempt 5 error: {}
+ Pyproject file parse attempt 6 error: {}
+ Config file "/tmp/mypy_primer/projects/steam.py/pyproject.toml" could not be parsed. Verify that format is correct.
-   /tmp/mypy_primer/projects/steam.py/poetry_build.py:14:13 - error: Type of "loads" is partially unknown
-     Type of "loads" is "((s: str, /, *, parse_float: ((str) -> Any) = ...) -> dict[str, Any]) | Unknown" (reportUnknownMemberType)
-   /tmp/mypy_primer/projects/steam.py/poetry_build.py:46:23 - error: Type of "split" is partially unknown
-     Type of "split" is "((sep: str | None = None, maxsplit: SupportsIndex = -1) -> list[str]) | Unknown" (reportUnknownMemberType)
-   /tmp/mypy_primer/projects/steam.py/poetry_build.py:47:9 - error: Type of "split" is partially unknown
-     Type of "split" is "((sep: str | None = None, maxsplit: SupportsIndex = -1) -> list[str]) | Unknown" (reportUnknownMemberType)
+ /tmp/mypy_primer/projects/steam.py/docs/conf.py
+   /tmp/mypy_primer/projects/steam.py/docs/conf.py:15:8 - error: Import "sphinx.util.inspect" could not be resolved (reportMissingImports)
+   /tmp/mypy_primer/projects/steam.py/docs/conf.py:18:25 - error: "__version__" is unknown import symbol (reportAttributeAccessIssue)
+   /tmp/mypy_primer/projects/steam.py/docs/conf.py:18:49 - error: "__version__" is unknown import symbol (reportAttributeAccessIssue)
+   /tmp/mypy_primer/projects/steam.py/docs/conf.py:18:73 - error: "version_info" is unknown import symbol (reportAttributeAccessIssue)
+ /tmp/mypy_primer/projects/steam.py/docs/extensions/__init__.py
+   /tmp/mypy_primer/projects/steam.py/docs/extensions/__init__.py:6:6 - error: Import "sphinx.environment" could not be resolved (reportMissingImports)
+ /tmp/mypy_primer/projects/steam.py/docs/extensions/annotations.py
+   /tmp/mypy_primer/projects/steam.py/docs/extensions/annotations.py:17:8 - error: Import "mypy" could not be resolved (reportMissingImports)
+   /tmp/mypy_primer/projects/steam.py/docs/extensions/annotations.py:24:6 - error: Import "mypy" could not be resolved (reportMissingImports)
+   /tmp/mypy_primer/projects/steam.py/docs/extensions/annotations.py:25:6 - error: Import "mypy.build" could not be resolved (reportMissingImports)
+   /tmp/mypy_primer/projects/steam.py/docs/extensions/annotations.py:26:6 - error: Import "mypy.options" could not be resolved (reportMissingImports)
+   /tmp/mypy_primer/projects/steam.py/docs/extensions/annotations.py:27:6 - error: Import "mypy.type_visitor" could not be resolved (reportMissingImports)
+   /tmp/mypy_primer/projects/steam.py/docs/extensions/annotations.py:28:6 - error: Import "sphinx.util.inspect" could not be resolved (reportMissingImports)
+   /tmp/mypy_primer/projects/steam.py/docs/extensions/annotations.py:35:10 - error: Import "sphinx.application" could not be resolved (reportMissingImports)
+   /tmp/mypy_primer/projects/steam.py/docs/extensions/annotations.py:58:16 - error: "__getitem__" method not defined on type "type" (reportIndexIssue)
+   /tmp/mypy_primer/projects/steam.py/docs/extensions/annotations.py:83:16 - error: Type "UnionType" is not assignable to return type "GenericAlias"
+     "UnionType" is not assignable to "GenericAlias" (reportReturnType)
+   /tmp/mypy_primer/projects/steam.py/docs/extensions/annotations.py:86:16 - error: Type "Callable" is not assignable to return type "GenericAlias"
+     "Callable" is not assignable to "GenericAlias" (reportReturnType)
+   /tmp/mypy_primer/projects/steam.py/docs/extensions/annotations.py:86:25 - error: Expected parameter type list or "..." (reportInvalidTypeForm)
+   /tmp/mypy_primer/projects/steam.py/docs/extensions/annotations.py:91:20 - error: Type "Literal" is not assignable to return type "GenericAlias"
+     "Literal" is not assignable to "GenericAlias" (reportReturnType)
+   /tmp/mypy_primer/projects/steam.py/docs/extensions/annotations.py:93:20 - error: Type "Literal" is not assignable to return type "GenericAlias"
+     "Literal" is not assignable to "GenericAlias" (reportReturnType)
+   /tmp/mypy_primer/projects/steam.py/docs/extensions/annotations.py:175:64 - error: "fullname" is possibly unbound (reportPossiblyUnboundVariable)
+ /tmp/mypy_primer/projects/steam.py/docs/extensions/attributetable.py
+   /tmp/mypy_primer/projects/steam.py/docs/extensions/attributetable.py:34:8 - error: Import "sphinxcontrib_trio" could not be resolved (reportMissingImports)
+   /tmp/mypy_primer/projects/steam.py/docs/extensions/attributetable.py:35:6 - warning: Import "docutils" could not be resolved from source (reportMissingModuleSource)
+   /tmp/mypy_primer/projects/steam.py/docs/extensions/attributetable.py:35:22 - warning: Import "docutils.nodes" could not be resolved from source (reportMissingModuleSource)
+   /tmp/mypy_primer/projects/steam.py/docs/extensions/attributetable.py:36:6 - error: Import "sphinx" could not be resolved (reportMissingImports)
+   /tmp/mypy_primer/projects/steam.py/docs/extensions/attributetable.py:37:6 - error: Import "sphinx.locale" could not be resolved (reportMissingImports)
+   /tmp/mypy_primer/projects/steam.py/docs/extensions/attributetable.py:38:6 - error: Import "sphinx.util.docutils" could not be resolved (reportMissingImports)
+   /tmp/mypy_primer/projects/steam.py/docs/extensions/attributetable.py:43:10 - error: Import "sphinx.application" could not be resolved (reportMissingImports)
+   /tmp/mypy_primer/projects/steam.py/docs/extensions/attributetable.py:44:10 - error: Import "sphinx.environment" could not be resolved (reportMissingImports)
+   /tmp/mypy_primer/projects/steam.py/docs/extensions/attributetable.py:45:10 - error: Import "sphinx.util.typing" could not be resolved (reportMissingImports)
+   /tmp/mypy_primer/projects/steam.py/docs/extensions/attributetable.py:46:10 - error: Import "sphinx.writers.html" could not be resolved (reportMissingImports)
+   /tmp/mypy_primer/projects/steam.py/docs/extensions/attributetable.py:215:32 - error: Argument of type "type[Any]" cannot be assigned to parameter "func" of type "(**_P@asynccontextmanager) -> AsyncIterator[_T_co@asynccontextmanager]" in function "asynccontextmanager"
+     Type "type[Any]" is not assignable to type "() -> AsyncIterator[_T_co@asynccontextmanager]"
+       Function return type "Any" is incompatible with type "AsyncIterator[_T_co@asynccontextmanager]"
+         "Any" is incompatible with protocol "AsyncIterator[_T_co@asynccontextmanager]"
+           "__anext__" is not present
+           "__aiter__" is not present (reportArgumentType)
+ /tmp/mypy_primer/projects/steam.py/docs/extensions/exception_hierarchy.py
+   /tmp/mypy_primer/projects/steam.py/docs/extensions/exception_hierarchy.py:29:6 - warning: Import "docutils" could not be resolved from source (reportMissingModuleSource)
+   /tmp/mypy_primer/projects/steam.py/docs/extensions/exception_hierarchy.py:29:22 - warning: Import "docutils.nodes" could not be resolved from source (reportMissingModuleSource)
+   /tmp/mypy_primer/projects/steam.py/docs/extensions/exception_hierarchy.py:30:6 - warning: Import "docutils.parsers.rst" could not be resolved from source (reportMissingModuleSource)
+   /tmp/mypy_primer/projects/steam.py/docs/extensions/exception_hierarchy.py:33:10 - error: Import "sphinx.application" could not be resolved (reportMissingImports)
+ /tmp/mypy_primer/projects/steam.py/docs/extensions/minimizer.py
+   /tmp/mypy_primer/projects/steam.py/docs/extensions/minimizer.py:8:8 - error: Import "csscompressor" could not be resolved (reportMissingImports)
+   /tmp/mypy_primer/projects/steam.py/docs/extensions/minimizer.py:9:8 - error: Import "htmlmin" could not be resolved (reportMissingImports)
+   /tmp/mypy_primer/projects/steam.py/docs/extensions/minimizer.py:10:8 - error: Import "rjsmin" could not be resolved (reportMissingImports)
+   /tmp/mypy_primer/projects/steam.py/docs/extensions/minimizer.py:15:10 - error: Import "sphinx.application" could not be resolved (reportMissingImports)
+ /tmp/mypy_primer/projects/steam.py/docs/extensions/resolve.py
+   /tmp/mypy_primer/projects/steam.py/docs/extensions/resolve.py:5:6 - error: Import "sphinx.ext" could not be resolved (reportMissingImports)
+   /tmp/mypy_primer/projects/steam.py/docs/extensions/resolve.py:10:10 - error: Import "sphinx.application" could not be resolved (reportMissingImports)
+ /tmp/mypy_primer/projects/steam.py/docs/extensions/resourcelinks.py
+   /tmp/mypy_primer/projects/steam.py/docs/extensions/resourcelinks.py:33:8 - error: Import "sphinx" could not be resolved (reportMissingImports)
+   /tmp/mypy_primer/projects/steam.py/docs/extensions/resourcelinks.py:34:6 - warning: Import "docutils" could not be resolved from source (reportMissingModuleSource)
+   /tmp/mypy_primer/projects/steam.py/docs/extensions/resourcelinks.py:34:22 - warning: Import "docutils.nodes" could not be resolved from source (reportMissingModuleSource)
+   /tmp/mypy_primer/projects/steam.py/docs/extensions/resourcelinks.py:34:29 - warning: Import "docutils.utils" could not be resolved from source (reportMissingModuleSource)
+   /tmp/mypy_primer/projects/steam.py/docs/extensions/resourcelinks.py:35:6 - error: Import "sphinx.util.nodes" could not be resolved (reportMissingImports)
+   /tmp/mypy_primer/projects/steam.py/docs/extensions/resourcelinks.py:38:10 - warning: Import "docutils.nodes" could not be resolved from source (reportMissingModuleSource)
+   /tmp/mypy_primer/projects/steam.py/docs/extensions/resourcelinks.py:39:10 - warning: Import "docutils.parsers.rst.states" could not be resolved from source (reportMissingModuleSource)
+   /tmp/mypy_primer/projects/steam.py/docs/extensions/resourcelinks.py:40:10 - error: Import "sphinx.application" could not be resolved (reportMissingImports)

... (truncated 8466 lines) ...

yarl (https://github.com/aio-libs/yarl)
+ Pyproject file parse attempt 1 error: {}
+ Pyproject file parse attempt 2 error: {}
+ Pyproject file parse attempt 3 error: {}
+ Pyproject file parse attempt 4 error: {}
+ Pyproject file parse attempt 5 error: {}
+ Pyproject file parse attempt 6 error: {}
+ Config file "/tmp/mypy_primer/projects/yarl/pyproject.toml" could not be parsed. Verify that format is correct.

rich (https://github.com/Textualize/rich)
+ Pyproject file parse attempt 1 error: {}
+ Pyproject file parse attempt 2 error: {}
+ Pyproject file parse attempt 3 error: {}
+ Pyproject file parse attempt 4 error: {}
+ Pyproject file parse attempt 5 error: {}
+ Pyproject file parse attempt 6 error: {}
+ Config file "/tmp/mypy_primer/projects/rich/pyproject.toml" could not be parsed. Verify that format is correct.

downforeveryone (https://github.com/rpdelaney/downforeveryone)
+ Pyproject file parse attempt 1 error: {}
+ Pyproject file parse attempt 2 error: {}
+ Pyproject file parse attempt 3 error: {}
+ Pyproject file parse attempt 4 error: {}
+ Pyproject file parse attempt 5 error: {}
+ Pyproject file parse attempt 6 error: {}
+ Config file "/tmp/mypy_primer/projects/downforeveryone/pyproject.toml" could not be parsed. Verify that format is correct.

pyodide (https://github.com/pyodide/pyodide)
+ Pyproject file parse attempt 1 error: {}
+ Pyproject file parse attempt 2 error: {}
+ Pyproject file parse attempt 3 error: {}
+ Pyproject file parse attempt 4 error: {}
+ Pyproject file parse attempt 5 error: {}
+ Pyproject file parse attempt 6 error: {}
+ Config file "/tmp/mypy_primer/projects/pyodide/pyproject.toml" could not be parsed. Verify that format is correct.

ibis (https://github.com/ibis-project/ibis)
+ Pyproject file parse attempt 1 error: {}
+ Pyproject file parse attempt 2 error: {}
+ Pyproject file parse attempt 3 error: {}
+ Pyproject file parse attempt 4 error: {}
+ Pyproject file parse attempt 5 error: {}
+ Pyproject file parse attempt 6 error: {}
+ Config file "/tmp/mypy_primer/projects/ibis/pyproject.toml" could not be parsed. Verify that format is correct.

pytest (https://github.com/pytest-dev/pytest)
+ Pyproject file parse attempt 1 error: {}
+ Pyproject file parse attempt 2 error: {}
+ Pyproject file parse attempt 3 error: {}
+ Pyproject file parse attempt 4 error: {}
+ Pyproject file parse attempt 5 error: {}
+ Pyproject file parse attempt 6 error: {}
+ Config file "/tmp/mypy_primer/projects/pytest/pyproject.toml" could not be parsed. Verify that format is correct.

jinja (https://github.com/pallets/jinja)
+ Pyproject file parse attempt 1 error: {}
+ Pyproject file parse attempt 2 error: {}
+ Pyproject file parse attempt 3 error: {}
+ Pyproject file parse attempt 4 error: {}
+ Pyproject file parse attempt 5 error: {}
+ Pyproject file parse attempt 6 error: {}
+ Config file "/tmp/mypy_primer/projects/jinja/pyproject.toml" could not be parsed. Verify that format is correct.
+ /tmp/mypy_primer/projects/jinja/docs/conf.py
+   /tmp/mypy_primer/projects/jinja/docs/conf.py:1:6 - error: Import "pallets_sphinx_themes" could not be resolved (reportMissingImports)
+   /tmp/mypy_primer/projects/jinja/docs/conf.py:2:6 - error: Import "pallets_sphinx_themes" could not be resolved (reportMissingImports)
+ /tmp/mypy_primer/projects/jinja/docs/examples/cache_extension.py
+   /tmp/mypy_primer/projects/jinja/docs/examples/cache_extension.py:34:40 - error: Argument of type "list[str]" cannot be assigned to parameter "end_tokens" of type "Tuple[str, ...]" in function "parse_statements"
+     "list[str]" is not assignable to "Tuple[str, ...]" (reportArgumentType)
+   /tmp/mypy_primer/projects/jinja/docs/examples/cache_extension.py:44:32 - error: Cannot access attribute "fragment_cache_prefix" for class "Environment"
+     Attribute "fragment_cache_prefix" is unknown (reportAttributeAccessIssue)
+   /tmp/mypy_primer/projects/jinja/docs/examples/cache_extension.py:49:31 - error: Cannot access attribute "fragment_cache" for class "Environment"
+     Attribute "fragment_cache" is unknown (reportAttributeAccessIssue)
+   /tmp/mypy_primer/projects/jinja/docs/examples/cache_extension.py:53:26 - error: Cannot access attribute "fragment_cache" for class "Environment"
+     Attribute "fragment_cache" is unknown (reportAttributeAccessIssue)
+ /tmp/mypy_primer/projects/jinja/docs/examples/inline_gettext_extension.py
+   /tmp/mypy_primer/projects/jinja/docs/examples/inline_gettext_extension.py:48:56 - error: Argument of type "None" cannot be assigned to parameter "value" of type "str" in function "__new__"
+     "None" is not assignable to "str" (reportArgumentType)
+   /tmp/mypy_primer/projects/jinja/docs/examples/inline_gettext_extension.py:50:54 - error: Argument of type "None" cannot be assigned to parameter "value" of type "str" in function "__new__"
+     "None" is not assignable to "str" (reportArgumentType)
+   /tmp/mypy_primer/projects/jinja/docs/examples/inline_gettext_extension.py:57:60 - error: Argument of type "None" cannot be assigned to parameter "value" of type "str" in function "__new__"
+     "None" is not assignable to "str" (reportArgumentType)
+   /tmp/mypy_primer/projects/jinja/docs/examples/inline_gettext_extension.py:59:58 - error: Argument of type "None" cannot be assigned to parameter "value" of type "str" in function "__new__"
+     "None" is not assignable to "str" (reportArgumentType)
+   /tmp/mypy_primer/projects/jinja/docs/examples/inline_gettext_extension.py:68:17 - error: "token" is possibly unbound (reportPossiblyUnboundVariable)
+   /tmp/mypy_primer/projects/jinja/src/jinja2/compiler.py:1258:27 - error: "loop_filter_func" is possibly unbound (reportPossiblyUnboundVariable)
+   /tmp/mypy_primer/projects/jinja/src/jinja2/compiler.py:1281:31 - error: "iteration_indicator" is possibly unbound (reportPossiblyUnboundVariable)
+   /tmp/mypy_primer/projects/jinja/src/jinja2/compiler.py:1288:34 - error: "iteration_indicator" is possibly unbound (reportPossiblyUnboundVariable)
+   /tmp/mypy_primer/projects/jinja/src/jinja2/environment.py:711:9 - error: Overload 1 for "compile" overlaps overload 2 and returns an incompatible type (reportOverlappingOverload)
+   /tmp/mypy_primer/projects/jinja/src/jinja2/environment.py:894:17 - error: "zip_file" is possibly unbound (reportPossiblyUnboundVariable)
+ /tmp/mypy_primer/projects/jinja/src/jinja2/exceptions.py
+   /tmp/mypy_primer/projects/jinja/src/jinja2/exceptions.py:45:14 - error: "message" incorrectly overrides property of same name in class "TemplateError" (reportIncompatibleMethodOverride)
+   /tmp/mypy_primer/projects/jinja/src/jinja2/filters.py:721:34 - error: "unit" is possibly unbound (reportPossiblyUnboundVariable)
+   /tmp/mypy_primer/projects/jinja/src/jinja2/filters.py:721:45 - error: "prefix" is possibly unbound (reportPossiblyUnboundVariable)
+   /tmp/mypy_primer/projects/jinja/src/jinja2/loaders.py:143:32 - error: "bucket" is possibly unbound (reportPossiblyUnboundVariable)
+   /tmp/mypy_primer/projects/jinja/src/jinja2/loaders.py:144:13 - error: "bucket" is possibly unbound (reportPossiblyUnboundVariable)
+   /tmp/mypy_primer/projects/jinja/src/jinja2/loaders.py:145:28 - error: "bucket" is possibly unbound (reportPossiblyUnboundVariable)
+   /tmp/mypy_primer/projects/jinja/src/jinja2/runtime.py:280:41 - error: Cannot access attribute "__call__" for class "function"
+     Attribute "__call__" is unknown (reportFunctionMemberAccess)
+   /tmp/mypy_primer/projects/jinja/src/jinja2/runtime.py:282:27 - error: Cannot access attribute "__call__" for class "function"
+     Attribute "__call__" is unknown (reportFunctionMemberAccess)
+ /tmp/mypy_primer/projects/jinja/tests/conftest.py
+   /tmp/mypy_primer/projects/jinja/tests/conftest.py:4:8 - error: Import "pytest" could not be resolved (reportMissingImports)
+   /tmp/mypy_primer/projects/jinja/tests/conftest.py:5:8 - error: Import "trio" could not be resolved (reportMissingImports)
+ /tmp/mypy_primer/projects/jinja/tests/test_api.py
+   /tmp/mypy_primer/projects/jinja/tests/test_api.py:5:8 - error: Import "pytest" could not be resolved (reportMissingImports)
+   /tmp/mypy_primer/projects/jinja/tests/test_api.py:277:17 - error: "__class__" incorrectly overrides property of same name in class "object"
+     Property method "fset" is missing in override (reportIncompatibleMethodOverride)
+   /tmp/mypy_primer/projects/jinja/tests/test_api.py:295:52 - error: Argument of type "DebugLogger" cannot be assigned to parameter "logger" of type "Logger | None" in function "make_logging_undefined"
+     Type "DebugLogger" is not assignable to type "Logger | None"
+       "DebugLogger" is not assignable to "Logger"
+       "DebugLogger" is not assignable to "None" (reportArgumentType)
+ /tmp/mypy_primer/projects/jinja/tests/test_async.py
+   /tmp/mypy_primer/projects/jinja/tests/test_async.py:1:8 - error: Import "pytest" could not be resolved (reportMissingImports)
+ /tmp/mypy_primer/projects/jinja/tests/test_async_filters.py
+   /tmp/mypy_primer/projects/jinja/tests/test_async_filters.py:4:8 - error: Import "pytest" could not be resolved (reportMissingImports)
+   /tmp/mypy_primer/projects/jinja/tests/test_async_filters.py:5:6 - error: Import "markupsafe" could not be resolved (reportMissingImports)
+   /tmp/mypy_primer/projects/jinja/tests/test_async_filters.py:152:5 - error: Function declaration "make_users" is obscured by a declaration of the same name (reportRedeclaration)
+ /tmp/mypy_primer/projects/jinja/tests/test_bytecode_cache.py
+   /tmp/mypy_primer/projects/jinja/tests/test_bytecode_cache.py:1:8 - error: Import "pytest" could not be resolved (reportMissingImports)
+   /tmp/mypy_primer/projects/jinja/tests/test_bytecode_cache.py:49:36 - error: Argument of type "MockMemcached" cannot be assigned to parameter "client" of type "_MemcachedClient" in function "__init__"
+     "MockMemcached" is incompatible with protocol "_MemcachedClient"
+       "get" is an incompatible type
+         Type "(key: Unknown) -> (Unknown | None)" is not assignable to type "(key: str) -> bytes"
+           Function return type "Unknown | None" is incompatible with type "bytes"
+             Type "Unknown | None" is not assignable to type "bytes" (reportArgumentType)
+   /tmp/mypy_primer/projects/jinja/tests/test_bytecode_cache.py:51:20 - error: Argument of type "None" cannot be assigned to parameter "environment" of type "Environment" in function "__init__"
+     "None" is not assignable to "Environment" (reportArgumentType)
+   /tmp/mypy_primer/projects/jinja/tests/test_bytecode_cache.py:52:18 - error: Cannot assign to attribute "code" for class "Bucket"
+     Type "Literal['code']" is not assignable to type "CodeType | None"
+       "Literal['code']" is not assignable to "CodeType"
+       "Literal['code']" is not assignable to "None" (reportAttributeAccessIssue)
+   /tmp/mypy_primer/projects/jinja/tests/test_bytecode_cache.py:56:20 - error: Argument of type "None" cannot be assigned to parameter "environment" of type "Environment" in function "__init__"
+     "None" is not assignable to "Environment" (reportArgumentType)
+   /tmp/mypy_primer/projects/jinja/tests/test_bytecode_cache.py:63:25 - error: Cannot assign to attribute "set" for class "MockMemcached"
+     Type "(*args: Unknown) -> NoReturn" is not assignable to type "(key: Unknown, value: Unknown, timeout: Unknown | None = None) -> None"
+       Missing keyword parameter "key"
+       Missing keyword parameter "value"
+       Missing keyword parameter "timeout" (reportAttributeAccessIssue)
+   /tmp/mypy_primer/projects/jinja/tests/test_bytecode_cache.py:64:36 - error: Argument of type "MockMemcached" cannot be assigned to parameter "client" of type "_MemcachedClient" in function "__init__"
+     "MockMemcached" is incompatible with protocol "_MemcachedClient"
+       "get" is an incompatible type
+         Type "(key: Unknown) -> (Unknown | None)" is not assignable to type "(key: str) -> bytes"
+           Function return type "Unknown | None" is incompatible with type "bytes"
+             Type "Unknown | None" is not assignable to type "bytes" (reportArgumentType)
+   /tmp/mypy_primer/projects/jinja/tests/test_bytecode_cache.py:65:20 - error: Argument of type "None" cannot be assigned to parameter "environment" of type "Environment" in function "__init__"
+     "None" is not assignable to "Environment" (reportArgumentType)

... (truncated 117 lines) ...

sympy (https://github.com/sympy/sympy)
+ Pyproject file parse attempt 1 error: {}
+ Pyproject file parse attempt 2 error: {}
+ Pyproject file parse attempt 3 error: {}
+ Pyproject file parse attempt 4 error: {}
+ Pyproject file parse attempt 5 error: {}
+ Pyproject file parse attempt 6 error: {}
+ Config file "/tmp/mypy_primer/projects/sympy/pyproject.toml" could not be parsed. Verify that format is correct.
+   /tmp/mypy_primer/projects/sympy/sympy/combinatorics/free_groups.py:172:21 - warning: Instance methods should take a "self" parameter (reportSelfClsParameterName)
+   /tmp/mypy_primer/projects/sympy/sympy/combinatorics/graycode.py:289:16 - warning: Class methods should take a "cls" parameter (reportSelfClsParameterName)
+   /tmp/mypy_primer/projects/sympy/sympy/combinatorics/partitions.py:270:18 - warning: Class methods should take a "cls" parameter (reportSelfClsParameterName)
+   /tmp/mypy_primer/projects/sympy/sympy/combinatorics/perm_groups.py:4636:17 - warning: Instance methods should take a "self" parameter (reportSelfClsParameterName)
+   /tmp/mypy_primer/projects/sympy/sympy/combinatorics/permutations.py:1568:23 - warning: Class methods should take a "cls" parameter (reportSelfClsParameterName)
+   /tmp/mypy_primer/projects/sympy/sympy/combinatorics/permutations.py:1777:23 - warning: Class methods should take a "cls" parameter (reportSelfClsParameterName)
+   /tmp/mypy_primer/projects/sympy/sympy/combinatorics/prufer.py:318:16 - warning: Class methods should take a "cls" parameter (reportSelfClsParameterName)
+   /tmp/mypy_primer/projects/sympy/sympy/combinatorics/subsets.py:476:29 - warning: Class methods should take a "cls" parameter (reportSelfClsParameterName)
+   /tmp/mypy_primer/projects/sympy/sympy/combinatorics/subsets.py:501:29 - warning: Class methods should take a "cls" parameter (reportSelfClsParameterName)
+   /tmp/mypy_primer/projects/sympy/sympy/combinatorics/subsets.py:525:23 - warning: Class methods should take a "cls" parameter (reportSelfClsParameterName)
+   /tmp/mypy_primer/projects/sympy/sympy/combinatorics/subsets.py:545:21 - warning: Class methods should take a "cls" parameter (reportSelfClsParameterName)
+   /tmp/mypy_primer/projects/sympy/sympy/combinatorics/subsets.py:567:24 - warning: Class methods should take a "cls" parameter (reportSelfClsParameterName)
+   /tmp/mypy_primer/projects/sympy/sympy/concrete/expr_with_intlimits.py:145:15 - warning: Instance methods should take a "self" parameter (reportSelfClsParameterName)
+   /tmp/mypy_primer/projects/sympy/sympy/concrete/expr_with_intlimits.py:183:17 - warning: Instance methods should take a "self" parameter (reportSelfClsParameterName)
+   /tmp/mypy_primer/projects/sympy/sympy/concrete/expr_with_intlimits.py:248:23 - warning: Instance methods should take a "self" parameter (reportSelfClsParameterName)
+   /tmp/mypy_primer/projects/sympy/sympy/concrete/products.py:481:23 - warning: Instance methods should take a "self" parameter (reportSelfClsParameterName)
+   /tmp/mypy_primer/projects/sympy/sympy/core/basic.py:2131:17 - warning: Instance methods should take a "self" parameter (reportSelfClsParameterName)
+   /tmp/mypy_primer/projects/sympy/sympy/core/function.py:885:17 - warning: __new__ override should take a "cls" parameter (reportSelfClsParameterName)
+   /tmp/mypy_primer/projects/sympy/sympy/core/function.py:999:18 - warning: Instance methods should take a "self" parameter (reportSelfClsParameterName)
+   /tmp/mypy_primer/projects/sympy/sympy/core/logic.py:239:16 - warning: Instance methods should take a "self" parameter (reportSelfClsParameterName)
+   /tmp/mypy_primer/projects/sympy/sympy/core/logic.py:245:16 - warning: Instance methods should take a "self" parameter (reportSelfClsParameterName)
+   /tmp/mypy_primer/projects/sympy/sympy/core/symbol.py:354:18 - warning: Static methods should not take a "self" or "cls" parameter (reportSelfClsParameterName)
+   /tmp/mypy_primer/projects/sympy/sympy/core/symbol.py:389:24 - warning: Static methods should not take a "self" or "cls" parameter (reportSelfClsParameterName)
+   /tmp/mypy_primer/projects/sympy/sympy/core/symbol.py:623:18 - warning: Static methods should not take a "self" or "cls" parameter (reportSelfClsParameterName)
+   /tmp/mypy_primer/projects/sympy/sympy/core/tests/test_relational.py:1177:22 - warning: Instance methods should take a "self" parameter (reportSelfClsParameterName)

... (truncated 2638 lines) ...```
heejaechang commented 1 week ago

@erictraut can you take a look again?

github-actions[bot] commented 1 week ago

According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅

github-actions[bot] commented 1 week ago

According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅