From 113685e1b94df9dd2945adbdda757a545b09598c Mon Sep 17 00:00:00 2001 From: Stephen Finucane Date: Tue, 7 Nov 2017 04:46:19 +0000 Subject: [PATCH] Deprecate testr and nose integration These are not recommended for use in OpenStack anymore and both nose and testr offer native setuptools commands that can be manually aliased to 'test' on a per-project basis if necessary. Deprecate with an eye to removal in the future. Change-Id: I753f2ffe8b223b180b8ed813d879b3a28b47a1ab Signed-off-by: Stephen Finucane --- pbr/packaging.py | 7 +++++++ pbr/testr_command.py | 8 +++++++- ...recate-testr-nose-integration-56e3e11248d946fc.yaml | 10 ++++++++++ 3 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 releasenotes/notes/deprecate-testr-nose-integration-56e3e11248d946fc.yaml 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.