From a6726b95f7a50dc5945e012050f00450c883fdcd Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Mon, 29 Jul 2024 10:44:18 -0400 Subject: [PATCH 1/2] Add celery and requests to the packages that test integration. Ref #4520 --- setuptools/tests/integration/test_pip_install_sdist.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/setuptools/tests/integration/test_pip_install_sdist.py b/setuptools/tests/integration/test_pip_install_sdist.py index 17bf2af9d2..ee70b1c286 100644 --- a/setuptools/tests/integration/test_pip_install_sdist.py +++ b/setuptools/tests/integration/test_pip_install_sdist.py @@ -54,6 +54,8 @@ ("pyyaml", LATEST), # cython + custom build_ext + custom distclass ("charset-normalizer", LATEST), # uses mypyc, used by aiohttp ("protobuf", LATEST), + ("requests", LATEST), + ("celery", LATEST), # When adding packages to this list, make sure they expose a `__version__` # attribute, or modify the tests below ] From c437aaa8d5b969a9fe8c8147463bfcb85b31ab26 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Mon, 29 Jul 2024 10:07:27 -0400 Subject: [PATCH 2/2] Restore the tests command and deprecate access to the module. Closes #4520; Closes #4519. --- newsfragments/4520.feature.rst | 1 + setuptools/command/test.py | 42 ++++++++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 newsfragments/4520.feature.rst create mode 100644 setuptools/command/test.py diff --git a/newsfragments/4520.feature.rst b/newsfragments/4520.feature.rst new file mode 100644 index 0000000000..d221b05aab --- /dev/null +++ b/newsfragments/4520.feature.rst @@ -0,0 +1 @@ +Restore the tests command and deprecate access to the module. (#4519) diff --git a/setuptools/command/test.py b/setuptools/command/test.py new file mode 100644 index 0000000000..38e1164c27 --- /dev/null +++ b/setuptools/command/test.py @@ -0,0 +1,42 @@ +from setuptools import Command +from setuptools.warnings import SetuptoolsDeprecationWarning + + +def __getattr__(name): + if name == 'test': + SetuptoolsDeprecationWarning.emit( + "The test command is disabled and references to it are deprecated.", + "Please remove any references to `setuptools.command.test` in all " + "supported versions of the affected package.", + due_date=(2024, 11, 15), + stacklevel=2, + ) + return _test + raise AttributeError(name) + + +class _test(Command): + """ + Stub to warn when test command is referenced or used. + """ + + description = "stub for old test command (do not use)" + + user_options = [ + ('test-module=', 'm', "Run 'test_suite' in specified module"), + ( + 'test-suite=', + 's', + "Run single test, case or suite (e.g. 'module.test_suite')", + ), + ('test-runner=', 'r', "Test runner to use"), + ] + + def initialize_options(self): + pass + + def finalize_options(self): + pass + + def run(self): + raise RuntimeError("Support for the test command was removed in Setuptools 72")