From e3fc939af32f842850557ce866cdffff1d8f0596 Mon Sep 17 00:00:00 2001 From: Justin Mahlik Date: Wed, 9 Oct 2024 17:55:17 -0500 Subject: [PATCH 1/3] fix: remove test command from setup.py Has been deprecated for 5+ years and has been removed in recent setuptools versions. See https://github.com/pypa/setuptools/issues/4519 --- setup.py | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/setup.py b/setup.py index 610501d..48cf620 100644 --- a/setup.py +++ b/setup.py @@ -4,8 +4,6 @@ import sys from setuptools import find_packages, setup, Command -from setuptools.command.test import test as TestCommand - long_description = ''' The optimal binning is the optimal discretization of a variable into bins @@ -34,20 +32,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 = [ 'matplotlib', @@ -89,7 +73,7 @@ def run_tests(self): include_package_data=True, license="Apache Licence 2.0", url="https://github.com/guillermo-navas-palencia/optbinning", - cmdclass={'clean': CleanCommand, 'test': PyTest}, + cmdclass={'clean': CleanCommand}, python_requires='>=3.7', install_requires=install_requires, tests_require=tests_require, From f7c892f87227a868568ab0b99e9e82f1cc0a4080 Mon Sep 17 00:00:00 2001 From: Justin Mahlik Date: Wed, 9 Oct 2024 18:00:27 -0500 Subject: [PATCH 2/3] fix: packaging move test deps to an extra instead of tests_require Remove `tests_require`, it is essentially deprecated and wasn't used. See https://github.com/pypa/setuptools/issues/931, it's likely to be removed soon. --- setup.py | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/setup.py b/setup.py index 48cf620..ee56ac0 100644 --- a/setup.py +++ b/setup.py @@ -1,7 +1,6 @@ #!/usr/bin/env python import os -import sys from setuptools import find_packages, setup, Command @@ -43,15 +42,10 @@ def run(self): 'scipy>=1.6.0', ] -# test requirements -tests_require = [ - 'pytest', - 'coverage' -] - # extra requirements extras_require = { 'distributed': ['pympler', 'tdigest'], + 'test': ['coverage', 'flake8', 'pytest', 'pyarrow'], } @@ -76,7 +70,6 @@ def run(self): cmdclass={'clean': CleanCommand}, python_requires='>=3.7', install_requires=install_requires, - tests_require=tests_require, extras_require=extras_require, classifiers=[ 'Topic :: Scientific/Engineering :: Mathematics', From d4ab315d213e16154f06155044e4b20f1cc6fae5 Mon Sep 17 00:00:00 2001 From: Justin Mahlik Date: Wed, 9 Oct 2024 18:03:20 -0500 Subject: [PATCH 3/3] feat: add tests for python 3.10-3.12 in ci --- .github/workflows/python-package.yml | 3 ++- setup.py | 6 +++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 46de2be..cd07ac0 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -15,7 +15,8 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - python-version: ['3.7', '3.8', '3.9', '3.10'] + + python-version: ['3.7', '3.8', '3.9', '3.10', "3.11", "3.12"] os: [ubuntu-latest, windows-latest, macos-12] steps: diff --git a/setup.py b/setup.py index ee56ac0..62ab515 100644 --- a/setup.py +++ b/setup.py @@ -82,5 +82,9 @@ def run(self): 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.7', 'Programming Language :: Python :: 3.8', - 'Programming Language :: Python :: 3.9'] + 'Programming Language :: Python :: 3.9', + 'Programming Language :: Python :: 3.10', + 'Programming Language :: Python :: 3.11', + 'Programming Language :: Python :: 3.12', + ] )