Skip to content

Commit

Permalink
fix: remove deprecated test command from setup.py
Browse files Browse the repository at this point in the history
See pypa/setuptools#4519

* Remove tests_require and add a test extra
* Add extra for ecos since it will not be installed by default
    https://www.cvxpy.org/updates/index.html#ecos-deprecation
  • Loading branch information
jmahlik committed Oct 10, 2024
1 parent 169fe43 commit 4e3a4b7
Showing 1 changed file with 6 additions and 23 deletions.
29 changes: 6 additions & 23 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
#!/usr/bin/env python

import os
import sys

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


long_description = '''
**RoPWR** is a library written in Python implementing several mathematical
Expand All @@ -31,20 +28,6 @@ def run(self):
os.system('rm -vrf ./build ./dist ./*.pyc ./*.tgz ./*.egg-info')


# test suites
class PyTest(TestCommand):
def finalize_options(self):
TestCommand.finalize_options(self)
self.test_args = []
self.test_suite = []

def run_tests(self):
# import here, because outside the eggs aren't loaded
import pytest
errcode = pytest.main(self.test_args)
sys.exit(errcode)


# install requirements
install_requires = [
'cvxpy>=1.1.14',
Expand All @@ -54,10 +37,10 @@ def run_tests(self):
]

# test requirements
tests_require = [
'pytest',
'coverage'
]
extras_require = {
'test': ['pytest', 'coverage'],
'ecos': ['ecos'],
}


# Read version file
Expand All @@ -78,10 +61,10 @@ def run_tests(self):
include_package_data=True,
license="Apache Licence 2.0",
url="https://github.com/guillermo-navas-palencia/ropwr",
cmdclass={'clean': CleanCommand, 'test': PyTest},
cmdclass={'clean': CleanCommand},
python_requires='>=3.7',
install_requires=install_requires,
tests_require=tests_require,
extras_require=extras_require,
classifiers=[
'Topic :: Scientific/Engineering :: Mathematics',
'Topic :: Software Development :: Libraries',
Expand Down

0 comments on commit 4e3a4b7

Please sign in to comment.