|
54 | 54 | from mesonpy._compat import Collection, Mapping, cached_property, read_binary |
55 | 55 |
|
56 | 56 |
|
| 57 | +_MESON_ARGS_KEYS = ['dist', 'setup', 'compile', 'install'] |
| 58 | + |
57 | 59 | if typing.TYPE_CHECKING: # pragma: no cover |
58 | 60 | from typing import Any, Callable, DefaultDict, List, Literal, Optional, Sequence, TextIO, Tuple, Type, TypeVar, Union |
59 | 61 |
|
|
62 | 64 | P = ParamSpec('P') |
63 | 65 | T = TypeVar('T') |
64 | 66 |
|
65 | | - |
66 | | -__version__ = '0.15.0.dev0' |
67 | | - |
68 | | - |
69 | | -# XXX: Once Python 3.8 is our minimum supported version, get rid of |
70 | | -# meson_args_keys and use typing.get_args(MesonArgsKeys) instead. |
71 | | - |
72 | | -# Keep both definitions in sync! |
73 | | -_MESON_ARGS_KEYS = ['dist', 'setup', 'compile', 'install'] |
74 | | -if typing.TYPE_CHECKING: |
75 | 67 | MesonArgsKeys = Literal['dist', 'setup', 'compile', 'install'] |
76 | 68 | MesonArgs = Mapping[MesonArgsKeys, List[str]] |
77 | | -else: |
78 | | - MesonArgs = dict |
| 69 | + |
| 70 | + |
| 71 | +__version__ = '0.15.0.dev0' |
79 | 72 |
|
80 | 73 |
|
81 | 74 | _COLORS = { |
@@ -940,7 +933,7 @@ def _project(config_settings: Optional[Dict[Any, Any]] = None) -> Iterator[Proje |
940 | 933 | """Create the project given the given config settings.""" |
941 | 934 |
|
942 | 935 | settings = _validate_config_settings(config_settings or {}) |
943 | | - meson_args = typing.cast(MesonArgs, {name: settings.get(f'{name}-args', []) for name in _MESON_ARGS_KEYS}) |
| 936 | + meson_args = typing.cast('MesonArgs', {name: settings.get(f'{name}-args', []) for name in _MESON_ARGS_KEYS}) |
944 | 937 | source_dir = os.path.curdir |
945 | 938 | build_dir = settings.get('builddir') |
946 | 939 | editable_verbose = bool(settings.get('editable-verbose')) |
|
0 commit comments