Skip to content

Commit 63d7a3c

Browse files
committed
Update setup to support python 3.13.x
1 parent 18f4451 commit 63d7a3c

File tree

1 file changed

+25
-9
lines changed

1 file changed

+25
-9
lines changed

setup.py

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,34 @@
44
# Github: https://github.com/thieu1995 %
55
# --------------------------------------------------%
66

7-
from setuptools import setup, find_packages
7+
import setuptools
8+
import os
9+
import re
10+
11+
12+
with open("requirements.txt") as f:
13+
REQUIREMENTS = f.read().splitlines()
14+
15+
16+
def get_version():
17+
init_path = os.path.join(os.path.dirname(__file__), 'metasklearn', '__init__.py')
18+
with open(init_path, 'r', encoding='utf-8') as f:
19+
init_content = f.read()
20+
version_match = re.search(r"^__version__ = ['\"]([^'\"]+)['\"]", init_content, re.M)
21+
if version_match:
22+
return version_match.group(1)
23+
raise RuntimeError("Unable to find version string.")
824

925

1026
def readme():
1127
with open('README.md', encoding='utf-8') as f:
12-
README = f.read()
13-
return README
28+
res = f.read()
29+
return res
1430

1531

16-
setup(
32+
setuptools.setup(
1733
name="metasklearn",
18-
version="0.2.0",
34+
version=get_version(),
1935
author="Thieu",
2036
author_email="nguyenthieu2102@gmail.com",
2137
description="MetaSklearn: A Metaheuristic-Powered Hyperparameter Optimization Framework for Scikit-Learn Models",
@@ -41,7 +57,7 @@ def readme():
4157
'Change Log': 'https://github.com/thieu1995/MetaSklearn/blob/main/ChangeLog.md',
4258
'Forum': 'https://t.me/+fRVCJGuGJg1mNDg1',
4359
},
44-
packages=find_packages(exclude=['tests*', 'examples*']),
60+
packages=setuptools.find_packages(exclude=['tests*', 'examples*']),
4561
include_package_data=True,
4662
license="GPLv3",
4763
classifiers=[
@@ -57,6 +73,7 @@ def readme():
5773
"Programming Language :: Python :: 3.10",
5874
"Programming Language :: Python :: 3.11",
5975
"Programming Language :: Python :: 3.12",
76+
"Programming Language :: Python :: 3.13",
6077
"Topic :: System :: Benchmark",
6178
"Topic :: Scientific/Engineering",
6279
"Topic :: Scientific/Engineering :: Mathematics",
@@ -69,10 +86,9 @@ def readme():
6986
"Topic :: Software Development :: Libraries :: Python Modules",
7087
"Topic :: Utilities",
7188
],
72-
install_requires=["numpy>=1.17.1", "scipy>=1.7.1", "scikit-learn>=1.0.2",
73-
"pandas>=1.3.5", "mealpy>=3.0.2", "permetrics>=2.0.0"],
89+
install_requires=REQUIREMENTS,
7490
extras_require={
75-
"dev": ["pytest>=7.0", "pytest-cov==4.0.0", "flake8>=4.0.1"],
91+
"dev": ["pytest==7.1.2", "pytest-cov==4.0.0", "flake8>=4.0.1"],
7692
},
7793
python_requires='>=3.8',
7894
)

0 commit comments

Comments
 (0)