Skip to content
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

mypy ain't happy. make it so. #8

Open
sitzz opened this issue Oct 19, 2024 · 0 comments
Open

mypy ain't happy. make it so. #8

sitzz opened this issue Oct 19, 2024 · 0 comments

Comments

@sitzz
Copy link
Owner

sitzz commented Oct 19, 2024

Currently mypy is downright unhappy with this code, as of this writing these are the results:

couchbase_helper/couch.py:6: error: Cannot find implementation or library stub for module named "couchbase.auth"  [import-not-found]
couchbase_helper/couch.py:6: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports
couchbase_helper/couch.py:7: error: Cannot find implementation or library stub for module named "couchbase.cluster"  [import-not-found]
couchbase_helper/couch.py:8: error: Cannot find implementation or library stub for module named "couchbase.diagnostics"  [import-not-found]
couchbase_helper/couch.py:9: error: Cannot find implementation or library stub for module named "couchbase.exceptions"  [import-not-found]
couchbase_helper/couch.py:10: error: Cannot find implementation or library stub for module named "couchbase.n1ql"  [import-not-found]
couchbase_helper/couch.py:11: error: Cannot find implementation or library stub for module named "couchbase.options"  [import-not-found]
couchbase_helper/couch.py:26: error: Cannot find implementation or library stub for module named "couchbase.result"  [import-not-found]
couchbase_helper/couch.py:42: error: Incompatible default for argument "logger" (default has type "None", argument has type "Logger")  [assignment]
couchbase_helper/couch.py:42: note: PEP 484 prohibits implicit Optional. Accordingly, mypy has changed its default to no_implicit_optional=True
couchbase_helper/couch.py:42: note: Use https://github.com/hauntsaninja/no_implicit_optional to automatically upgrade your codebase
couchbase_helper/couch.py:95: error: Incompatible default for argument "opts" (default has type "None", argument has type "dict[Any, Any]")  [assignment]
couchbase_helper/couch.py:95: note: PEP 484 prohibits implicit Optional. Accordingly, mypy has changed its default to no_implicit_optional=True
couchbase_helper/couch.py:95: note: Use https://github.com/hauntsaninja/no_implicit_optional to automatically upgrade your codebase
couchbase_helper/couch.py:117: error: Incompatible default for argument "opts" (default has type "None", argument has type "dict[Any, Any]")  [assignment]
couchbase_helper/couch.py:117: note: PEP 484 prohibits implicit Optional. Accordingly, mypy has changed its default to no_implicit_optional=True
couchbase_helper/couch.py:117: note: Use https://github.com/hauntsaninja/no_implicit_optional to automatically upgrade your codebase
couchbase_helper/couch.py:117: error: Incompatible default for argument "per_key_opts" (default has type "None", argument has type "dict[Any, Any]")  [assignment]
couchbase_helper/couch.py:157: error: Incompatible default for argument "opts" (default has type "None", argument has type "dict[Any, Any]")  [assignment]
couchbase_helper/couch.py:157: note: PEP 484 prohibits implicit Optional. Accordingly, mypy has changed its default to no_implicit_optional=True
couchbase_helper/couch.py:157: note: Use https://github.com/hauntsaninja/no_implicit_optional to automatically upgrade your codebase
couchbase_helper/couch.py:179: error: Incompatible default for argument "opts" (default has type "None", argument has type "dict[Any, Any]")  [assignment]
couchbase_helper/couch.py:179: note: PEP 484 prohibits implicit Optional. Accordingly, mypy has changed its default to no_implicit_optional=True
couchbase_helper/couch.py:179: note: Use https://github.com/hauntsaninja/no_implicit_optional to automatically upgrade your codebase
couchbase_helper/couch.py:179: error: Incompatible default for argument "per_key_opts" (default has type "None", argument has type "dict[Any, Any]")  [assignment]
couchbase_helper/couch.py:219: error: Incompatible default for argument "opts" (default has type "None", argument has type "dict[Any, Any]")  [assignment]
couchbase_helper/couch.py:219: note: PEP 484 prohibits implicit Optional. Accordingly, mypy has changed its default to no_implicit_optional=True
couchbase_helper/couch.py:219: note: Use https://github.com/hauntsaninja/no_implicit_optional to automatically upgrade your codebase
couchbase_helper/couch.py:232: error: Incompatible default for argument "opts" (default has type "None", argument has type "dict[Any, Any]")  [assignment]
couchbase_helper/couch.py:232: note: PEP 484 prohibits implicit Optional. Accordingly, mypy has changed its default to no_implicit_optional=True
couchbase_helper/couch.py:232: note: Use https://github.com/hauntsaninja/no_implicit_optional to automatically upgrade your codebase
couchbase_helper/couch.py:249: error: Incompatible default for argument "opts" (default has type "None", argument has type "dict[Any, Any]")  [assignment]
couchbase_helper/couch.py:249: note: PEP 484 prohibits implicit Optional. Accordingly, mypy has changed its default to no_implicit_optional=True
couchbase_helper/couch.py:249: note: Use https://github.com/hauntsaninja/no_implicit_optional to automatically upgrade your codebase
couchbase_helper/couch.py:262: error: Incompatible default for argument "opts" (default has type "None", argument has type "dict[Any, Any]")  [assignment]
couchbase_helper/couch.py:262: note: PEP 484 prohibits implicit Optional. Accordingly, mypy has changed its default to no_implicit_optional=True
couchbase_helper/couch.py:262: note: Use https://github.com/hauntsaninja/no_implicit_optional to automatically upgrade your codebase
couchbase_helper/couch.py:311: error: Unsupported operand types for < ("int" and "None")  [operator]
couchbase_helper/couch.py:311: note: Right operand is of type "int | None"
couchbase_helper/couch.py:343: error: Item "None" of "dict[str, Any] | None" has no attribute "items"  [union-attr]
couchbase_helper/couch.py:370: error: Incompatible default for argument "opts" (default has type "None", argument has type "dict[Any, Any]")  [assignment]
couchbase_helper/couch.py:370: note: PEP 484 prohibits implicit Optional. Accordingly, mypy has changed its default to no_implicit_optional=True
couchbase_helper/couch.py:370: note: Use https://github.com/hauntsaninja/no_implicit_optional to automatically upgrade your codebase
couchbase_helper/couch.py:370: error: Incompatible default for argument "expiry" (default has type "None", argument has type "int")  [assignment]
Found 22 errors in 1 file (checked 2 source files)

Some errors are "repeat offenses" so fixing shouldn't bee too difficult.

Could be solved together with #5 and/or #7.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant