codekingpro/portable-devtools
115k
1from __future__ import annotations2 3from typing import NoReturn4 5from setuptools import Command6from setuptools.warnings import SetuptoolsDeprecationWarning7 8 9# Would restrict to Literal["test"], but mypy doesn't support it: https://github.com/python/mypy/issues/820310def __getattr__(name: str) -> type[_test]:11 if name == 'test':12 SetuptoolsDeprecationWarning.emit(13 "The test command is disabled and references to it are deprecated.",14 "Please remove any references to `setuptools.command.test` in all "15 "supported versions of the affected package.",16 due_date=(2024, 11, 15),17 stacklevel=2,18 )19 return _test20 raise AttributeError(name)21 22 23class _test(Command):24 """25 Stub to warn when test command is referenced or used.26 """27 28 description = "stub for old test command (do not use)"29 30 user_options = [31 ('test-module=', 'm', "Run 'test_suite' in specified module"),32 (33 'test-suite=',34 's',35 "Run single test, case or suite (e.g. 'module.test_suite')",36 ),37 ('test-runner=', 'r', "Test runner to use"),38 ]39 40 def initialize_options(self) -> None:41 pass42 43 def finalize_options(self) -> None:44 pass45 46 def run(self) -> NoReturn:47 raise RuntimeError("Support for the test command was removed in Setuptools 72")48 