-
Notifications
You must be signed in to change notification settings - Fork 233
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
More types #881
More types #881
Conversation
Replace all mypy options with single strict = True which feels like a most reasonable level of typechecking to have (https://mypy.readthedocs.io/en/stable/existing_code.html#introduce-stricter-options) to make a baseplate for further typisation of the library. Also rather than exclude kafka-python modules from mypy checks, add basic type stubs (generated with stubgen) for kafka-python's errors and structs modules.
cafile: str = None, | ||
capath: str = None, | ||
cadata: str = None, | ||
certfile: str = None, | ||
keyfile: str = None, | ||
password: str = None, |
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.
The typing of these should look like cafile: Optional[str] = None
|
||
[mypy-aiokafka.util] | ||
ignore_missing_imports = False | ||
python_version = 3.7 |
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.
python 3.7 has already been deprecated in the latest version
replicas: list[int] | ||
isr: list[int] |
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.
This form of typing is not available in Python 3.8 which is still supported.
It should be:
from typing import List, NamedTuple
...
replicas: List[int]
isr: List[int]
# class FailedPayloadsError(KafkaError): | ||
# payload: Incomplete | ||
# def __init__(self, payload, *args) -> None: ... |
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.
cant this just be deleted if it is commented out?
Changes
Adds typings for
helpers
anderrors
modulesChecklist
CHANGES
folder<issue_id>.<type>
(e.g.588.bugfix
)issue_id
change it to the pr id after creating the PR.feature
: Signifying a new feature..bugfix
: Signifying a bug fix..doc
: Signifying a documentation improvement..removal
: Signifying a deprecation or removal of public API..misc
: A ticket has been closed, but it is not of interest to users.Fix issue with non-ascii contents in doctest text files.