diff --git a/pbr/packaging.py b/pbr/packaging.py index 99eff52e..01774373 100644 --- a/pbr/packaging.py +++ b/pbr/packaging.py @@ -27,6 +27,7 @@ import email.errors import os import re import sys +import warnings import pkg_resources import setuptools @@ -259,8 +260,14 @@ try: """Fallback test runner if testr is a no-go.""" command_name = 'test' + description = 'DEPRECATED: Run unit tests using nose' def run(self): + warnings.warn('nose integration in pbr is deprecated. Please use ' + 'the native nose setuptools configuration or call ' + 'nose directly', + DeprecationWarning) + # Can't use super - base class old-style class commands.nosetests.run(self) diff --git a/pbr/testr_command.py b/pbr/testr_command.py index cd179a27..d143565f 100644 --- a/pbr/testr_command.py +++ b/pbr/testr_command.py @@ -45,13 +45,14 @@ import distutils.errors import logging import os import sys +import warnings logger = logging.getLogger(__name__) class TestrReal(cmd.Command): - description = "Run unit tests using testr" + description = "DEPRECATED: Run unit tests using testr" user_options = [ ('coverage', None, "Replace PYTHON with coverage and merge coverage " @@ -100,6 +101,11 @@ class TestrReal(cmd.Command): def run(self): """Set up testr repo, then run testr.""" logger.debug("run called") + + warnings.warn('testr integration in pbr is deprecated. Please use ' + 'the \'testr\' setup command or call testr directly', + DeprecationWarning) + if not os.path.isdir(".testrepository"): self._run_testr("init") diff --git a/releasenotes/notes/deprecate-testr-nose-integration-56e3e11248d946fc.yaml b/releasenotes/notes/deprecate-testr-nose-integration-56e3e11248d946fc.yaml new file mode 100644 index 00000000..13568474 --- /dev/null +++ b/releasenotes/notes/deprecate-testr-nose-integration-56e3e11248d946fc.yaml @@ -0,0 +1,10 @@ +--- +deprecations: + - | + *testr* and *nose* integration has been deprecated. This feature allowed + *pbr* to dynamically configure the test runner used when running + ``setup.py test``. However, this target has fallen out of favour in both + the OpenStack and broader Python ecosystem, and both *testr* and *nose* + offer native setuptools commands that can be manually aliased to ``test`` + on a per-project basis, if necessary. This feature will be removed in a + future release.