From 2710ec64b7e07151f10c6db742e958a1c960807c 2023-10-27 00:35:47 From: Martin Matějek Date: 2023-10-27 00:35:47 Subject: [PATCH] refactor: update type hints in utils/sysinfo.py --- diff --git a/IPython/utils/sysinfo.py b/IPython/utils/sysinfo.py index 01bde99..347123f 100644 --- a/IPython/utils/sysinfo.py +++ b/IPython/utils/sysinfo.py @@ -29,7 +29,7 @@ from IPython.utils import _sysinfo, encoding # Code #----------------------------------------------------------------------------- -def pkg_commit_hash(pkg_path): +def pkg_commit_hash(pkg_path: str) -> tuple[str, str]: """Get short form of commit hash given directory `pkg_path` We get the commit hash from (in order of preference): @@ -67,7 +67,7 @@ def pkg_commit_hash(pkg_path): return '(none found)', '' -def pkg_info(pkg_path): +def pkg_info(pkg_path: str) -> dict: """Return dict describing the context of this package Parameters @@ -94,7 +94,7 @@ def pkg_info(pkg_path): default_encoding=encoding.DEFAULT_ENCODING, ) -def get_sys_info(): +def get_sys_info() -> dict: """Return useful information about IPython and the system, as a dict.""" path = Path(__file__, "..").resolve().parent return pkg_info(str(path))