-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Migrate mypy config to pyproject.toml #3936
Changes from 3 commits
15af178
0727532
ae481ed
7258712
6aca347
346dd8d
7575ae9
a8c3be5
41a5cd9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ | |
_build | ||
.DS_Store | ||
.vscode | ||
.python-version | ||
docs/_static/pypi.svg | ||
.tox | ||
__pycache__ | ||
|
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -74,7 +74,7 @@ def main(bind_host: str, bind_port: int) -> None: | |
app = make_app() | ||
ver = black.__version__ | ||
black.out(f"blackd version {ver} listening on {bind_host} port {bind_port}") | ||
web.run_app(app, host=bind_host, port=bind_port, handle_signals=True, print=None) | ||
web.run_app(app, host=bind_host, port=bind_port, handle_signals=True, print=None) # type: ignore[arg-type] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What was the issue here? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
src/blackd/__init__.py:77:81: error: Argument "print" to "run_app" has incompatible type "None"; expected "Callable[..., None]" [arg-type]
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Seems like this is fixed on master: https://github.com/aio-libs/aiohttp/blob/30850babb43a8e28dd2df036776c62fd613d3d89/aiohttp/web.py#L453C5-L453C5. Can you add a comment saying that aiohttp had an incorrect annotation and that it will be fixed once aiohttp releases that code? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added, thanks |
||
|
||
|
||
def make_app() -> web.Application: | ||
|
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.
We shouldn't ignore errors in scripts. It's fine to have a looser config apply to scripts though, like ignore missing imports
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.
Good point, I thought about it but then skipped as it'll add few extra ignores in repo.
type: ignore
where necessary inscripts.*
types-commonmark
,urllib3
,hypothesmith
asadditional_dependencies
in mypy hook to avoid addingtype: ignore
(let me know if its not the right way)