25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.
 
 
 
 

46 satır
1.3 KiB

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