aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild
diff options
context:
space:
mode:
authorEli Schwartz <eschwartz@archlinux.org>2023-08-16 13:01:21 -0400
committerEli Schwartz <eschwartz@archlinux.org>2023-08-18 15:37:52 -0400
commit3ebd570bd538732437ee83c2fe9ac97aef6a03db (patch)
treead03fa008b2e0b2a36d1bf398a5027e1b8148205 /mesonbuild
parent184277bb4abbc0aa194ac02f592192d91fb109e1 (diff)
downloadmeson-3ebd570bd538732437ee83c2fe9ac97aef6a03db.zip
meson-3ebd570bd538732437ee83c2fe9ac97aef6a03db.tar.gz
meson-3ebd570bd538732437ee83c2fe9ac97aef6a03db.tar.bz2
consistently use Literal annotation from typing_extensions
This is our standard annotation policy, and makes mypy safe under python 3.7
Diffstat (limited to 'mesonbuild')
-rw-r--r--mesonbuild/dependencies/pkgconfig.py4
-rw-r--r--mesonbuild/utils/universal.py2
2 files changed, 4 insertions, 2 deletions
diff --git a/mesonbuild/dependencies/pkgconfig.py b/mesonbuild/dependencies/pkgconfig.py
index cfe9cbb..e8f349e 100644
--- a/mesonbuild/dependencies/pkgconfig.py
+++ b/mesonbuild/dependencies/pkgconfig.py
@@ -26,6 +26,8 @@ import shlex
import typing as T
if T.TYPE_CHECKING:
+ from typing_extensions import Literal
+
from ..environment import Environment
from ..mesonlib import MachineChoice
from ..utils.core import EnvironOrDict
@@ -78,7 +80,7 @@ class PkgConfigCLI(PkgConfigInterface):
# The class's copy of the pkg-config path. Avoids having to search for it
# multiple times in the same Meson invocation.
- class_pkgbin: PerMachine[T.Union[None, T.Literal[False], ExternalProgram]] = PerMachine(None, None)
+ class_pkgbin: PerMachine[T.Union[None, Literal[False], ExternalProgram]] = PerMachine(None, None)
# We cache all pkg-config subprocess invocations to avoid redundant calls
pkgbin_cache: T.Dict[
T.Tuple[ExternalProgram, T.Tuple[str, ...], T.FrozenSet[T.Tuple[str, str]]],
diff --git a/mesonbuild/utils/universal.py b/mesonbuild/utils/universal.py
index 73d4523..c0fa15f 100644
--- a/mesonbuild/utils/universal.py
+++ b/mesonbuild/utils/universal.py
@@ -1361,7 +1361,7 @@ CONF_NASM_PRELUDE = '''; Autogenerated by the Meson build system.
'''
-def dump_conf_header(ofilename: str, cdata: 'ConfigurationData', output_format: T.Literal['c', 'nasm']) -> None:
+def dump_conf_header(ofilename: str, cdata: 'ConfigurationData', output_format: Literal['c', 'nasm']) -> None:
if output_format == 'c':
prelude = CONF_C_PRELUDE
prefix = '#'