Re: [PATCH] kunit: tool: undo type subscripts for subprocess.Popen

From: David Gow
Date: Sat Jun 10 2023 - 00:16:35 EST


On Sat, 10 Jun 2023 at 03:09, SeongJae Park <sj@xxxxxxxxxx> wrote:
>
> Hi David and Brendan,
>
> On Tue, 2 May 2023 08:04:20 +0800 David Gow <davidgow@xxxxxxxxxx> wrote:
>
> > [-- Attachment #1: Type: text/plain, Size: 1473 bytes --]
> >
> > On Tue, 2 May 2023 at 02:16, 'Daniel Latypov' via KUnit Development
> > <kunit-dev@xxxxxxxxxxxxxxxx> wrote:
> > >
> > > Writing `subprocess.Popen[str]` requires python 3.9+.
> > > kunit.py has an assertion that the python version is 3.7+, so we should
> > > try to stay backwards compatible.
> > >
> > > This conflicts a bit with commit 1da2e6220e11 ("kunit: tool: fix
> > > pre-existing `mypy --strict` errors and update run_checks.py"), since
> > > mypy complains like so
> > > > kunit_kernel.py:95: error: Missing type parameters for generic type "Popen" [type-arg]
> > >
> > > Note: `mypy --strict --python-version 3.7` does not work.
> > >
> > > We could annotate each file with comments like
> > > `# mypy: disable-error-code="type-arg"
> > > but then we might still get nudged to break back-compat in other files.
> > >
> > > This patch adds a `mypy.ini` file since it seems like the only way to
> > > disable specific error codes for all our files.
> > >
> > > Note: run_checks.py doesn't need to specify `--config_file mypy.ini`,
> > > but I think being explicit is better, particularly since most kernel
> > > devs won't be familiar with how mypy works.
> > >
> > > Fixes: 695e26030858 ("kunit: tool: add subscripts for type annotations where appropriate")
> > > Reported-by: SeongJae Park <sj@xxxxxxxxxx>
> > > Link: https://lore.kernel.org/linux-kselftest/20230501171520.138753-1-sj@xxxxxxxxxx
> > > Signed-off-by: Daniel Latypov <dlatypov@xxxxxxxxxx>
> > > ---
> >
> > Thanks for jumping on this.
> >
> > Looks good to me!
> >
> > Reviewed-by: David Gow <davidgow@xxxxxxxxxx>
>
> Looks like this patch is still not merged in the mainline. May I ask the ETA,
> or any concern if you have?
>
>

We've got this queued for 6.5 in the kselftest/kunit tree[1], so it
should land during the merge window. But I'll look into getting it
applied as a fix for 6.4, beforehand.

-- David

[1]: https://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest.git/commit/?h=kunit&id=e30f65c4b3d671115bf2a9d9ef142285387f2aff

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature