alienmind / electricdreams

MIT License
0 stars 0 forks source link

Fix typing - mypy should pass without any errors or warnings #3

Open alienmind opened 1 year ago

alienmind commented 1 year ago

make check should throw zero errors

alienmind commented 1 year ago

🚀 Static type checking: Running mypy src/electricdreams/notebook.py:7: error: Name "get_ipython" is not defined [name-defined] src/electricdreams/config.py:5: error: Unsupported left operand type for + ("None") [operator] src/electricdreams/config.py:5: note: Left operand is of type "Optional[str]" src/electricdreams/main.py:1: error: Cannot find implementation or library stub for module named "cli" [import] src/electricdreams/main.py:1: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports src/electricdreams/hasher.py:5: error: Function is missing a return type annotation [no-untyped-def] src/electricdreams/hasher.py:5: note: Use "-> None" if function does not return a value src/electricdreams/hasher.py:10: error: Function is missing a return type annotation [no-untyped-def] src/electricdreams/chatter.py:7: error: Skipping analyzing "PIL": module is installed, but missing library stubs or py.typed marker [import] src/electricdreams/chatter.py:11: error: Function is missing a type annotation [no-untyped-def] src/electricdreams/chatter.py:29: error: Function is missing a return type annotation [no-untyped-def] src/electricdreams/chatter.py:29: error: Incompatible default for argument "prompt" (default has type "None", argument has type "str") [assignment] src/electricdreams/chatter.py:72: error: Type of variable becomes "Any" due to an unfollowed import [no-any-unimported] src/electricdreams/chatter.py:83: error: Invalid type comment or annotation [valid-type] src/electricdreams/chatter.py:83: note: Suggestion: use Conversation[...] instead of Conversation(...) src/electricdreams/chatter.py:85: error: Function is missing a type annotation for one or more arguments [no-untyped-def] src/electricdreams/chatter.py:92: error: The return type of a generator function should be "Generator" or one of its supertypes [misc] src/electricdreams/chatter.py:109: error: "Chat" has no attribute "painter" [attr-defined] src/electricdreams/painter.py:3: error: Library stubs not installed for "pkg_resources" (or incompatible with Python 3.8) [import] src/electricdreams/painter.py:3: note: Hint: "python3 -m pip install types-setuptools" src/electricdreams/painter.py:3: note: (or run "mypy --install-types" to install all missing stub packages) src/electricdreams/painter.py:5: error: Skipping analyzing "diffusers": module is installed, but missing library stubs or py.typed marker [import] src/electricdreams/painter.py:14: error: Function is missing a type annotation [no-untyped-def] src/electricdreams/painter.py:39: error: Function is missing a return type annotation [no-untyped-def] src/electricdreams/painter.py:40: error: Incompatible types in assignment (expression has type "None", variable has type "str") [assignment] src/electricdreams/cli.py:7: error: Function is missing a return type annotation [no-untyped-def] src/electricdreams/cli.py:7: error: Incompatible default for argument "prompt" (default has type "None", argument has type "str") [assignment] src/electricdreams/cli.py:14: error: Incompatible types in assignment (expression has type "None", variable has type "str") [assignment] src/electricdreams/cli.py:15: error: Incompatible types in assignment (expression has type "None", variable has type "ArgumentParser") [assignment] src/electricdreams/cli.py:16: error: Incompatible types in assignment (expression has type "None", variable has type "Chat") [assignment] src/electricdreams/cli.py:17: error: Incompatible types in assignment (expression has type "None", variable has type "ChatResponse") [assignment] src/electricdreams/cli.py:27: error: Incompatible types in assignment (expression has type "Namespace", variable has type "str") [assignment] src/electricdreams/cli.py:29: error: Incompatible types in assignment (expression has type "Namespace", variable has type "str") [assignment] src/electricdreams/cli.py:30: error: "str" has no attribute "prompt" [attr-defined] src/electricdreams/cli.py:31: error: "str" has no attribute "interactive" [attr-defined] src/electricdreams/cli.py:37: error: "ChatResponse" has no attribute "iter" (not iterable) [attr-defined] src/electricdreams/adventure.py:9: error: Function is missing a return type annotation [no-untyped-def] src/electricdreams/api.py:17: error: Function is missing a return type annotation [no-untyped-def] src/electricdreams/api.py:17: note: Use "-> None" if function does not return a value Found 32 errors in 9 files (checked 10 source files) make: *** [Makefile:15: check] Error 1