* [PATCH] kunit: tool: remove unnecessary "annotations" import
@ 2021-06-23 19:09 Daniel Latypov
2021-06-25 4:17 ` David Gow
2021-06-28 20:03 ` Brendan Higgins
0 siblings, 2 replies; 3+ messages in thread
From: Daniel Latypov @ 2021-06-23 19:09 UTC (permalink / raw)
To: brendanhiggins, davidgow
Cc: linux-kernel, kunit-dev, linux-kselftest, skhan, Daniel Latypov
The import was working around the fact "tuple[T]" was used instead of
typing.Tuple[T].
Convert it to use type.Tuple to be consistent with how the rest of the
code is anotated.
Signed-off-by: Daniel Latypov <dlatypov@google.com>
---
tools/testing/kunit/kunit_kernel.py | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/tools/testing/kunit/kunit_kernel.py b/tools/testing/kunit/kunit_kernel.py
index e1951fa60027..5987d5b1b874 100644
--- a/tools/testing/kunit/kunit_kernel.py
+++ b/tools/testing/kunit/kunit_kernel.py
@@ -6,15 +6,13 @@
# Author: Felix Guo <felixguoxiuping@gmail.com>
# Author: Brendan Higgins <brendanhiggins@google.com>
-from __future__ import annotations
import importlib.util
import logging
import subprocess
import os
import shutil
import signal
-from typing import Iterator
-from typing import Optional
+from typing import Iterator, Optional, Tuple
from contextlib import ExitStack
@@ -208,7 +206,7 @@ def get_source_tree_ops(arch: str, cross_compile: Optional[str]) -> LinuxSourceT
raise ConfigError(arch + ' is not a valid arch')
def get_source_tree_ops_from_qemu_config(config_path: str,
- cross_compile: Optional[str]) -> tuple[
+ cross_compile: Optional[str]) -> Tuple[
str, LinuxSourceTreeOperations]:
# The module name/path has very little to do with where the actual file
# exists (I learned this through experimentation and could not find it
base-commit: 87c9c16317882dd6dbbc07e349bc3223e14f3244
--
2.32.0.93.g670b81a890-goog
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] kunit: tool: remove unnecessary "annotations" import
2021-06-23 19:09 [PATCH] kunit: tool: remove unnecessary "annotations" import Daniel Latypov
@ 2021-06-25 4:17 ` David Gow
2021-06-28 20:03 ` Brendan Higgins
1 sibling, 0 replies; 3+ messages in thread
From: David Gow @ 2021-06-25 4:17 UTC (permalink / raw)
To: Daniel Latypov
Cc: Brendan Higgins, Linux Kernel Mailing List, KUnit Development,
open list:KERNEL SELFTEST FRAMEWORK, Shuah Khan
[-- Attachment #1: Type: text/plain, Size: 1930 bytes --]
On Thu, Jun 24, 2021 at 3:09 AM Daniel Latypov <dlatypov@google.com> wrote:
>
> The import was working around the fact "tuple[T]" was used instead of
> typing.Tuple[T].
>
> Convert it to use type.Tuple to be consistent with how the rest of the
> code is anotated.
>
> Signed-off-by: Daniel Latypov <dlatypov@google.com>
> ---
This looks sensible and works for me.
Reviewed-by: David Gow <davidgow@google.com>
Thanks,
-- David
> tools/testing/kunit/kunit_kernel.py | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/tools/testing/kunit/kunit_kernel.py b/tools/testing/kunit/kunit_kernel.py
> index e1951fa60027..5987d5b1b874 100644
> --- a/tools/testing/kunit/kunit_kernel.py
> +++ b/tools/testing/kunit/kunit_kernel.py
> @@ -6,15 +6,13 @@
> # Author: Felix Guo <felixguoxiuping@gmail.com>
> # Author: Brendan Higgins <brendanhiggins@google.com>
>
> -from __future__ import annotations
> import importlib.util
> import logging
> import subprocess
> import os
> import shutil
> import signal
> -from typing import Iterator
> -from typing import Optional
> +from typing import Iterator, Optional, Tuple
>
> from contextlib import ExitStack
>
> @@ -208,7 +206,7 @@ def get_source_tree_ops(arch: str, cross_compile: Optional[str]) -> LinuxSourceT
> raise ConfigError(arch + ' is not a valid arch')
>
> def get_source_tree_ops_from_qemu_config(config_path: str,
> - cross_compile: Optional[str]) -> tuple[
> + cross_compile: Optional[str]) -> Tuple[
> str, LinuxSourceTreeOperations]:
> # The module name/path has very little to do with where the actual file
> # exists (I learned this through experimentation and could not find it
>
> base-commit: 87c9c16317882dd6dbbc07e349bc3223e14f3244
> --
> 2.32.0.93.g670b81a890-goog
>
[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4000 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] kunit: tool: remove unnecessary "annotations" import
2021-06-23 19:09 [PATCH] kunit: tool: remove unnecessary "annotations" import Daniel Latypov
2021-06-25 4:17 ` David Gow
@ 2021-06-28 20:03 ` Brendan Higgins
1 sibling, 0 replies; 3+ messages in thread
From: Brendan Higgins @ 2021-06-28 20:03 UTC (permalink / raw)
To: Daniel Latypov; +Cc: davidgow, linux-kernel, kunit-dev, linux-kselftest, skhan
On Wed, Jun 23, 2021 at 12:09 PM Daniel Latypov <dlatypov@google.com> wrote:
>
> The import was working around the fact "tuple[T]" was used instead of
> typing.Tuple[T].
>
> Convert it to use type.Tuple to be consistent with how the rest of the
> code is anotated.
nit: s/anotated/annotated
>
> Signed-off-by: Daniel Latypov <dlatypov@google.com>
Reviewed-by: Brendan Higgins <brendanhiggins@google.com>
Tested-by: Brendan Higgins <brendanhiggins@google.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-06-28 20:03 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-23 19:09 [PATCH] kunit: tool: remove unnecessary "annotations" import Daniel Latypov
2021-06-25 4:17 ` David Gow
2021-06-28 20:03 ` Brendan Higgins
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).