From 85493042ac8ee34d45c3f45123d6097c700079b5 Mon Sep 17 00:00:00 2001 From: Bill Little Date: Thu, 8 Sep 2022 10:48:59 +0100 Subject: [PATCH] Remove deprecated 'python setup.py test' support (#4948) * Remove deprecated 'python setup.py test' support * add whatsnew entry --- docs/src/whatsnew/latest.rst | 7 +++++-- setup.py | 26 -------------------------- 2 files changed, 5 insertions(+), 28 deletions(-) diff --git a/docs/src/whatsnew/latest.rst b/docs/src/whatsnew/latest.rst index a42a5a64bef..df267dc89eb 100644 --- a/docs/src/whatsnew/latest.rst +++ b/docs/src/whatsnew/latest.rst @@ -88,6 +88,10 @@ This document explains the changes made to Iris for this release #. `@rcomer`_ removed the obsolete ``setUpClass`` method from Iris testing. (:pull:`4927`) +#. `@bjlittle`_ and `@lbdreyer`_ (reviewer) removed support for + ``python setup.py test``, which is a deprecated approach to executing + package tests, see `pypa/setuptools#1684`_. (:pull:`4948`) + .. comment Whatsnew author names (@github name) in alphabetical order. Note that, @@ -97,10 +101,9 @@ This document explains the changes made to Iris for this release - .. comment Whatsnew resources in alphabetical order: - .. _NEP13: https://numpy.org/neps/nep-0013-ufunc-overrides.html .. _NEP18: https://numpy.org/neps/nep-0018-array-function-protocol.html +.. _pypa/setuptools#1684: https://github.com/pypa/setuptools/issues/1684 \ No newline at end of file diff --git a/setup.py b/setup.py index c7438ee6985..089d33cb7bb 100644 --- a/setup.py +++ b/setup.py @@ -1,4 +1,3 @@ -from contextlib import contextmanager import os from shutil import copyfile import sys @@ -8,30 +7,6 @@ from setuptools.command.develop import develop as develop_cmd -@contextmanager -def temporary_path(directory): - """ - Context manager that adds and subsequently removes the given directory - to sys.path - - """ - sys.path.insert(0, directory) - try: - yield - finally: - del sys.path[0] - - -# Add full path so Python doesn't load any __init__.py in the intervening -# directories, thereby saving setup.py from additional dependencies. -with temporary_path("lib/iris/tests/runner"): - from _runner import TestRunner # noqa: - - -class SetupTestRunner(TestRunner, Command): - pass - - class BaseCommand(Command): """A valid no-op command for setuptools & distutils.""" @@ -108,7 +83,6 @@ def run(self): custom_commands = { - "test": SetupTestRunner, "develop": custom_cmd(develop_cmd, [build_std_names]), "build_py": custom_cmd(build_py, [build_std_names, copy_copyright]), "std_names": custom_cmd(