Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove deprecated 'python setup.py test' support #4948

Merged
merged 2 commits into from
Sep 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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