Skip to content

Commit

Permalink
Merge pull request #812 from HEPData/remove-setuptools-test
Browse files Browse the repository at this point in the history
Remove use of `setuptools.command.test` in `setup.py`
  • Loading branch information
GraemeWatt authored Jul 31, 2024
2 parents 0c1b7de + 74b1d8e commit 5d46d79
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 48 deletions.
8 changes: 4 additions & 4 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
# -*- coding: utf-8 -*-
#
# This file is part of Zenodo.
# This file is part of HEPData.
# Copyright (C) 2015 CERN.
#
# Zenodo is free software; you can redistribute it
# HEPData is free software; you can redistribute it
# and/or modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of the
# License, or (at your option) any later version.
#
# Zenodo is distributed in the hope that it will be
# HEPData is distributed in the hope that it will be
# useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Zenodo; if not, write to the
# along with HEPData; if not, write to the
# Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
# MA 02111-1307, USA.
#
Expand Down
2 changes: 1 addition & 1 deletion hepdata/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@
and parsed by ``setup.py``.
"""

__version__ = "0.9.4dev20240703"
__version__ = "0.9.4dev20240731"
2 changes: 1 addition & 1 deletion run-tests.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
# This file is part of Zenodo.
# This file is part of HEPData.
# Copyright (C) 2015 CERN.
#
# HEPData is free software; you can redistribute it
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ directory = hepdata/translations/

[extract_messages]
copyright_holder = CERN
msgid_bugs_address = info@zenodo.org
msgid_bugs_address = info@hepdata.net
mapping-file = babel.ini
output-file = hepdata/translations/messages.pot

Expand Down
41 changes: 0 additions & 41 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,8 @@
"""hepdata - Research. Shared."""

import os
import sys

from setuptools import find_packages, setup
from setuptools.command.test import test as TestCommand

readme = open('README.rst').read()
history = open('CHANGES.rst').read()
Expand Down Expand Up @@ -56,47 +54,11 @@
for name, reqs in extras_require.items():
extras_require['all'].extend(reqs)

setup_requires = [
'Babel>=1.3',
]

# Packages moved to requirements.txt with specific versions
install_requires = []

packages = find_packages()


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 = []
try:
from ConfigParser import ConfigParser
except ImportError:
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
errno = pytest.main(self.pytest_args)
sys.exit(errno)


# Get the version string. Cannot be done with import!
g = {}
with open(os.path.join('hepdata', 'version.py'), 'rt') as fp:
Expand Down Expand Up @@ -170,8 +132,6 @@ def run_tests(self):
},
extras_require=extras_require,
install_requires=install_requires,
setup_requires=setup_requires,
tests_require=tests_require,
classifiers=[
'Environment :: Web Environment',
'Intended Audience :: Developers',
Expand All @@ -185,6 +145,5 @@ def run_tests(self):
'Programming Language :: Python :: 3.9',
'Development Status :: Production',
],
cmdclass={'test': PyTest},
python_requires='>=3.8, <3.10',
)

0 comments on commit 5d46d79

Please sign in to comment.