From 6d4cbe5eda54a26815baa1265a60dac41d350893 Mon Sep 17 00:00:00 2001 From: Kevin Kirsche Date: Wed, 27 Jul 2022 20:47:23 -0400 Subject: [PATCH 1/3] Fix commented code due to previous bug (todo) in setuptools.command.test With https://github.com/python/mypy/pull/10884 merged and released, this should be safe to re-enable per the todo comment. --- stubs/setuptools/setuptools/command/test.pyi | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/stubs/setuptools/setuptools/command/test.pyi b/stubs/setuptools/setuptools/command/test.pyi index a905fc1c5af1..80836120fa1b 100644 --- a/stubs/setuptools/setuptools/command/test.pyi +++ b/stubs/setuptools/setuptools/command/test.pyi @@ -29,8 +29,7 @@ class test(Command): test_runner: Any def initialize_options(self) -> None: ... def finalize_options(self) -> None: ... - # TODO: uncomment once https://github.com/python/mypy/pull/10884 is released - # def test_args(self): ... + def test_args(self): ... def with_project_on_sys_path(self, func) -> None: ... def project_on_sys_path(self, include_dists=...): ... @staticmethod From 1925648306bf14ca08020fe30e6317f61caba778 Mon Sep 17 00:00:00 2001 From: Kevin Kirsche Date: Wed, 27 Jul 2022 20:53:33 -0400 Subject: [PATCH 2/3] Fix: Add missing NonDataProperty decorator https://github.com/pypa/setuptools/blob/main/setuptools/command/test.py#L117 --- stubs/setuptools/setuptools/command/test.pyi | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/stubs/setuptools/setuptools/command/test.pyi b/stubs/setuptools/setuptools/command/test.pyi index 80836120fa1b..90b8def54493 100644 --- a/stubs/setuptools/setuptools/command/test.pyi +++ b/stubs/setuptools/setuptools/command/test.pyi @@ -29,7 +29,8 @@ class test(Command): test_runner: Any def initialize_options(self) -> None: ... def finalize_options(self) -> None: ... - def test_args(self): ... + @NonDataProperty + def test_args(self) -> list[Any]: ... def with_project_on_sys_path(self, func) -> None: ... def project_on_sys_path(self, include_dists=...): ... @staticmethod From 17747dbe09f151fa372365982e14531bcab325e6 Mon Sep 17 00:00:00 2001 From: Kevin Kirsche Date: Wed, 27 Jul 2022 21:15:53 -0400 Subject: [PATCH 3/3] Replace `list[Any]` with `list[str]` to align yield types with return type --- stubs/setuptools/setuptools/command/test.pyi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stubs/setuptools/setuptools/command/test.pyi b/stubs/setuptools/setuptools/command/test.pyi index 90b8def54493..2e11178b6f44 100644 --- a/stubs/setuptools/setuptools/command/test.pyi +++ b/stubs/setuptools/setuptools/command/test.pyi @@ -30,7 +30,7 @@ class test(Command): def initialize_options(self) -> None: ... def finalize_options(self) -> None: ... @NonDataProperty - def test_args(self) -> list[Any]: ... + def test_args(self) -> list[str]: ... def with_project_on_sys_path(self, func) -> None: ... def project_on_sys_path(self, include_dists=...): ... @staticmethod