Skip to content

Commit

Permalink
Merge pull request #64 from HEPData/remove-setuptools-test
Browse files Browse the repository at this point in the history
setup: remove use of setuptools.command.test
  • Loading branch information
GraemeWatt authored Jul 31, 2024
2 parents 4c3ae8e + 7036ed5 commit e542f69
Showing 1 changed file with 0 additions and 38 deletions.
38 changes: 0 additions & 38 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

import os
from setuptools import setup
from setuptools.command.test import test as TestCommand


test_requirements = [
Expand All @@ -25,40 +24,6 @@
for name, reqs in extras_require.items():
extras_require['all'].extend(reqs)

class PyTest(TestCommand):
"""PyTest Test."""

user_options = [('pytest-args=', 'a', "Arguments to pass to pytest")]

def initialize_options(self):
"""Init pytest."""
TestCommand.initialize_options(self)
self.pytest_args = []

from ConfigParser import ConfigParser

config = ConfigParser()
config.read('pytest.ini')
self.pytest_args = config.get('pytest', 'addopts').split(' ')

def finalize_options(self):
"""Finalize pytest."""
TestCommand.finalize_options(self)
self.test_args = []
self.test_suite = True

def run_tests(self):
"""Run tests."""
# import here, cause outside the eggs aren't loaded
import pytest
import _pytest.config

pm = _pytest.config.get_plugin_manager()
pm.consider_setuptools_entrypoints()
errno = pytest.main(self.pytest_args)
sys.exit(errno)


g = {}
with open(os.path.join('hepdata_validator', 'version.py'), 'rt') as fp:
exec(fp.read(), g)
Expand Down Expand Up @@ -91,9 +56,6 @@ def run_tests(self):
"pyyaml>=5.4.1",
"requests",
],
test_suite='hepdata_validator.testsuite',
tests_require=test_requirements,
cmdclass={'test': PyTest},
python_requires='>=3.6',
entry_points={
'console_scripts': ['hepdata-validate=hepdata_validator.cli:validate'],
Expand Down

0 comments on commit e542f69

Please sign in to comment.