-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4522 from pypa/feature/graceful-drop-tests
Restore the tests command and deprecate access to the module.
- Loading branch information
Showing
3 changed files
with
45 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Restore the tests command and deprecate access to the module. (#4519) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters