Skip to content

Commit 8a90cd5

Browse files
committed
setup.py: drop test
For compatibility with setuptools>=72 that remove the test command. See pypa/setuptools#931
1 parent 68b3a42 commit 8a90cd5

File tree

1 file changed

+1
-32
lines changed

1 file changed

+1
-32
lines changed

setup.py

Lines changed: 1 addition & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -40,16 +40,6 @@
4040
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
4141
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
4242

43-
# Hack to prevent stupid "TypeError: 'NoneType' object is not callable" error
44-
# in multiprocessing/util.py _exit_function when running `python
45-
# setup.py test` (see
46-
# http://www.eby-sarna.com/pipermail/peak/2010-May/003357.html)
47-
for m in ("multiprocessing", "billiard"):
48-
try:
49-
__import__(m)
50-
except ImportError:
51-
pass
52-
5343
import ast
5444
import codecs
5545
import os
@@ -59,31 +49,10 @@
5949

6050
import pkg_resources
6151
from setuptools import Extension, setup
62-
from setuptools.command.test import test as TestCommand
6352

6453
pkg_resources.require("setuptools>=39.2")
6554

6655

67-
class PyTest(TestCommand):
68-
user_options = [("pytest-args=", "a", "Arguments to pass to py.test")]
69-
70-
def initialize_options(self) -> None:
71-
TestCommand.initialize_options(self)
72-
self.pytest_args = []
73-
74-
def finalize_options(self) -> None:
75-
TestCommand.finalize_options(self)
76-
self.test_args = []
77-
self.test_suite = True
78-
79-
def run_tests(self) -> None:
80-
# import here, cause outside the eggs aren't loaded
81-
import pytest
82-
83-
errno = pytest.main(self.pytest_args)
84-
sys.exit(errno)
85-
86-
8756
def get_version():
8857
"""
8958
Get version without importing from elasticapm. This avoids any side effects
@@ -108,4 +77,4 @@ def get_version():
10877
return "unknown"
10978

11079

111-
setup(cmdclass={"test": PyTest}, version=get_version())
80+
setup(version=get_version())

0 commit comments

Comments
 (0)