diff --git a/pyproject.toml b/pyproject.toml index 4fe58e62ab..f815aafcef 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -249,7 +249,8 @@ ignore = [ "tmt/convert.py", "tmt/lint.py", "tmt/queue.py", - "tmt/utils.py" + "tmt/utils.py", + "tmt/hardware.py", # pyright does not pick up pint's _typing.py or something :/ ] pythonVersion = "3.9" diff --git a/tmt/hardware.py b/tmt/hardware.py index fa8bb0fa34..916fe73062 100644 --- a/tmt/hardware.py +++ b/tmt/hardware.py @@ -64,7 +64,9 @@ from typing_extensions import TypeAlias #: A type of values describing sizes of things like storage or RAM. - Size: TypeAlias = 'Quantity[int]' + # Note: type-hinting is a bit wonky with pyright + # https://github.com/hgrecco/pint/issues/1166 + Size: TypeAlias = Quantity #: Unit registry, used and shared by all code. UNITS = pint.UnitRegistry()