8000 TST: fix distutils tests for deprecations in recent setuptools versions by charris · Pull Request #24356 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content
Merged
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
11 changes: 11 additions & 0 deletions numpy/distutils/tests/test_system_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import pytest
from tempfile import mkstemp, mkdtemp
from subprocess import Popen, PIPE
import importlib.metadata
from distutils.errors import DistutilsError

from numpy.testing import assert_, assert_equal, assert_raises
Expand All @@ -13,6 +14,16 @@
from numpy.distutils import _shell_utils


try:
if importlib.metadata.version('setuptools') >= '60':
# pkg-resources gives deprecation warnings, and there may be more
# issues. We only support setuptools <60
pytest.skip("setuptools is too new", allow_module_level=True)
except importlib.metadata.PackageNotFoundError:
# we don't require `setuptools`; if it is not found, continue
pass


def get_class(name, notfound_action=1):
"""
notfound_action:
Expand Down
0