Skip to content

Commit

Permalink
Extend support for typing
Browse files Browse the repository at this point in the history
  • Loading branch information
fabaff committed Aug 19, 2022
1 parent e1c7275 commit 4a8db46
Show file tree
Hide file tree
Showing 4 changed files with 77 additions and 89 deletions.
2 changes: 1 addition & 1 deletion glances_api/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ async def get_data(self, endpoint: str) -> None:
"""Retrieve the data."""
url = f"{self.url}/{endpoint}"

httpx_client = (
httpx_client: Any = (
self.httpx_client
if self.httpx_client
else httpx.AsyncClient(verify=self.verify_ssl)
Expand Down
141 changes: 53 additions & 88 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Empty file added py.typed
Empty file.
23 changes: 23 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,29 @@ pytest = "^6.2.5"
pytest-httpx = ">0.15,<1"
pytest-asyncio = "^0.16.0"
isort = "^5.10.0"
mypy = "^0.971"

[tool.mypy]
check_untyped_defs = true
disallow_any_generics = true
disallow_incomplete_defs = true
disallow_untyped_defs = true
mypy_path = "glances_api/"
no_implicit_optional = true
show_error_codes = true
warn_unreachable = true
warn_unused_ignores = true
exclude = [
'pyproject.toml',
]

[[tool.mypy.overrides]]
module = "tests.*"
allow_untyped_defs = true

[[tool.mypy.overrides]]
module = "docs.*"
ignore_errors = true

[build-system]
requires = ["poetry-core>=1.0.0"]
Expand Down

0 comments on commit 4a8db46

Please sign in to comment.