Skip to content

Commit

Permalink
Merge pull request #50 from public/mypy-pyproject
Browse files Browse the repository at this point in the history
Move MyPy config to pyproject.toml
  • Loading branch information
public authored Dec 27, 2021
2 parents 73f56ee + 7322292 commit 7478641
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 18 deletions.
16 changes: 0 additions & 16 deletions mypy.ini

This file was deleted.

14 changes: 14 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,17 @@ black = {version = "^21.12b0", allow-prereleases = true}
[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"

[tool.mypy]
exclude = ".*_pb2.py$|echotest.py$"

[[tool.mypy.overrides]]
module = [
"grpc.*",
"urllib3.*",
"uvicorn.*",
"daphne.*",
"bjoern.*"

]
ignore_missing_imports = true
2 changes: 1 addition & 1 deletion sonora/protocol.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ def encode_headers(metadata):


class WebRpcError(grpc.RpcError):
_code_to_enum = {code.value[0]: code for code in grpc.StatusCode}
_code_to_enum = {code.value[0]: code for code in grpc.StatusCode} # type: ignore

def __init__(self, code, details, *args, **kwargs):
super(WebRpcError, self).__init__(*args, **kwargs)
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ commands =
--grpc_python_out=. \
tests/protos/tests/helloworld.proto \
tests/protos/tests/benchmark.proto
{envpython} -m mypy .
{envpython} -m mypy sonora tests
{envpython} -m pytest --benchmark-sort=name {posargs}

[testenv:black]
Expand Down

0 comments on commit 7478641

Please sign in to comment.