From 31339e37e61a6a4df224cae98a806cebf948ec4d Mon Sep 17 00:00:00 2001 From: Alexander Rashed Date: Mon, 29 Jul 2024 11:47:35 +0200 Subject: [PATCH] remove usage of setuptools.command.test --- doc/install.rst | 2 +- setup.cfg | 3 --- setup.py | 1 - setupext/__init__.py | 1 - setupext/pytester.py | 39 --------------------------------------- 5 files changed, 1 insertion(+), 45 deletions(-) delete mode 100644 setupext/pytester.py diff --git a/doc/install.rst b/doc/install.rst index 6e1ef71b1..4e1ae14e8 100644 --- a/doc/install.rst +++ b/doc/install.rst @@ -107,7 +107,7 @@ bench requires JDK to build. **4. Test JPype with (optional):** :: - python setup.py test + python -m pytest diff --git a/setup.cfg b/setup.cfg index 44c5ddbe5..acc5cf1af 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,3 @@ -[alias] -test=pytest - [tool:pytest] addopts = --verbose testpaths = diff --git a/setup.py b/setup.py index 06f8c2064..83c263f39 100644 --- a/setup.py +++ b/setup.py @@ -70,7 +70,6 @@ 'develop': setupext.develop.Develop, 'test_java': setupext.test_java.TestJavaCommand, 'sdist': setupext.sdist.BuildSourceDistribution, - 'test': setupext.pytester.PyTest, }, zip_safe=False, ext_modules=[jpypeJar, jpypeLib, ], diff --git a/setupext/__init__.py b/setupext/__init__.py index d4f70098f..f47d0bc5a 100644 --- a/setupext/__init__.py +++ b/setupext/__init__.py @@ -21,4 +21,3 @@ from . import develop from . import test_java from . import sdist -from . import pytester diff --git a/setupext/pytester.py b/setupext/pytester.py deleted file mode 100644 index a19a3fa7d..000000000 --- a/setupext/pytester.py +++ /dev/null @@ -1,39 +0,0 @@ -# ***************************************************************************** -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# See NOTICE file for details. -# -# ***************************************************************************** -import sys - -from setuptools.command.test import test as TestCommand - - -class PyTest(TestCommand): - user_options = [("pytest-args=", "a", "Arguments to pass to pytest")] - - def initialize_options(self): - TestCommand.initialize_options(self) - self.pytest_args = "" - - def run_tests(self): - self.run_command("test_java") - - import shlex - - # import here, cause outside the eggs aren't loaded - import pytest - - errno = pytest.main(shlex.split(self.pytest_args)) - sys.exit(errno)