Skip to content

Commit 4a8db46

Browse files
committed
Extend support for typing
1 parent e1c7275 commit 4a8db46

File tree

4 files changed

+77
-89
lines changed

4 files changed

+77
-89
lines changed

glances_api/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ async def get_data(self, endpoint: str) -> None:
4040
"""Retrieve the data."""
4141
url = f"{self.url}/{endpoint}"
4242

43-
httpx_client = (
43+
httpx_client: Any = (
4444
self.httpx_client
4545
if self.httpx_client
4646
else httpx.AsyncClient(verify=self.verify_ssl)

poetry.lock

Lines changed: 53 additions & 88 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

py.typed

Whitespace-only changes.

pyproject.toml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,29 @@ pytest = "^6.2.5"
2727
pytest-httpx = ">0.15,<1"
2828
pytest-asyncio = "^0.16.0"
2929
isort = "^5.10.0"
30+
mypy = "^0.971"
31+
32+
[tool.mypy]
33+
check_untyped_defs = true
34+
disallow_any_generics = true
35+
disallow_incomplete_defs = true
36+
disallow_untyped_defs = true
37+
mypy_path = "glances_api/"
38+
no_implicit_optional = true
39+
show_error_codes = true
40+
warn_unreachable = true
41+
warn_unused_ignores = true
42+
exclude = [
43+
'pyproject.toml',
44+
]
45+
46+
[[tool.mypy.overrides]]
47+
module = "tests.*"
48+
allow_untyped_defs = true
49+
50+
[[tool.mypy.overrides]]
51+
module = "docs.*"
52+
ignore_errors = true
3053

3154
[build-system]
3255
requires = ["poetry-core>=1.0.0"]

0 commit comments

Comments
 (0)