diff options
author | Eli Schwartz <eschwartz@archlinux.org> | 2023-08-10 21:19:29 -0400 |
---|---|---|
committer | Eli Schwartz <eschwartz@archlinux.org> | 2023-08-11 13:41:03 -0400 |
commit | 90ce0841441506e3f409ab59ded1df8f2e6e7363 (patch) | |
tree | 3478769eef2620e9d7b5a41b73dd94c75b003465 /mesonbuild/cmake/executor.py | |
parent | de1cc0b02bcb1bab6977f0ab8bb3fef0cd0646dd (diff) | |
download | meson-90ce0841441506e3f409ab59ded1df8f2e6e7363.zip meson-90ce0841441506e3f409ab59ded1df8f2e6e7363.tar.gz meson-90ce0841441506e3f409ab59ded1df8f2e6e7363.tar.bz2 |
treewide: automatic rewriting of all comment-style type annotations
Performed using https://github.com/ilevkivskyi/com2ann
This has no actual effect on the codebase as type checkers (still)
support both and negligible effect on runtime performance since
__future__ annotations ameliorates that. Technically, the bytecode would
be bigger for non function-local annotations, of which we have many
either way.
So if it doesn't really matter, why do a large-scale refactor? Simple:
because people keep wanting to, but it's getting nickle-and-dimed. If
we're going to do this we might as well do it consistently in one shot,
using tooling that guarantees repeatability and correctness.
Repeat with:
```
com2ann mesonbuild/
```
Diffstat (limited to 'mesonbuild/cmake/executor.py')
-rw-r--r-- | mesonbuild/cmake/executor.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/mesonbuild/cmake/executor.py b/mesonbuild/cmake/executor.py index c22c0ca..7958baf 100644 --- a/mesonbuild/cmake/executor.py +++ b/mesonbuild/cmake/executor.py @@ -39,9 +39,9 @@ if T.TYPE_CHECKING: class CMakeExecutor: # The class's copy of the CMake path. Avoids having to search for it # multiple times in the same Meson invocation. - class_cmakebin = PerMachine(None, None) # type: PerMachine[T.Optional[ExternalProgram]] - class_cmakevers = PerMachine(None, None) # type: PerMachine[T.Optional[str]] - class_cmake_cache = {} # type: T.Dict[T.Any, TYPE_result] + class_cmakebin: PerMachine[T.Optional[ExternalProgram]] = PerMachine(None, None) + class_cmakevers: PerMachine[T.Optional[str]] = PerMachine(None, None) + class_cmake_cache: T.Dict[T.Any, TYPE_result] = {} def __init__(self, environment: 'Environment', version: str, for_machine: MachineChoice, silent: bool = False): self.min_version = version @@ -50,8 +50,8 @@ class CMakeExecutor: self.cmakebin, self.cmakevers = self.find_cmake_binary(self.environment, silent=silent) self.always_capture_stderr = True self.print_cmout = False - self.prefix_paths = [] # type: T.List[str] - self.extra_cmake_args = [] # type: T.List[str] + self.prefix_paths: T.List[str] = [] + self.extra_cmake_args: T.List[str] = [] if self.cmakebin is None: return |