Skip to content

Commit

Permalink
Remove deprecated 'python setup.py test' support (SciTools#4948)
Browse files Browse the repository at this point in the history
* Remove deprecated 'python setup.py test' support

* add whatsnew entry
  • Loading branch information
bjlittle authored and pp-mo committed Sep 26, 2022
1 parent 428cadc commit 856d1e8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 28 deletions.
7 changes: 5 additions & 2 deletions docs/src/whatsnew/latest.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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
26 changes: 0 additions & 26 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from contextlib import contextmanager
import os
from shutil import copyfile
import sys
Expand All @@ -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."""

Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit 856d1e8

Please sign in to comment.