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" , encoding = 'utf-8' ) as f :
13+ REQUIREMENTS = f .read ().splitlines ()
14+
15+
16+ def get_version ():
17+ init_path = os .path .join (os .path .dirname (__file__ ), 'metacluster' , '__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
1026def readme ():
1127 with open ('README.md' , encoding = 'utf-8' ) as f :
12- README = f .read ()
13- return README
14-
28+ res = f .read ()
29+ return res
1530
16- setup (
31+ setuptools . setup (
1732 name = "metacluster" ,
18- version = "1.2.0" ,
33+ version = get_version () ,
1934 author = "Thieu" ,
20352136 description = "MetaCluster: An Open-Source Python Library for Metaheuristic-based Clustering Problems" ,
@@ -40,7 +55,7 @@ def readme():
4055 'Change Log' : 'https://github.com/thieu1995/metacluster/blob/master/ChangeLog.md' ,
4156 'Forum' : 'https://t.me/+fRVCJGuGJg1mNDg1' ,
4257 },
43- packages = find_packages (exclude = ['tests*' , 'examples*' ]),
58+ packages = setuptools . find_packages (exclude = ['tests*' , 'examples*' ]),
4459 include_package_data = True ,
4560 license = "GPLv3" ,
4661 classifiers = [
@@ -52,11 +67,12 @@ def readme():
5267 "License :: OSI Approved :: GNU General Public License v3 (GPLv3)" ,
5368 "Natural Language :: English" ,
5469 "Programming Language :: Python :: 3" ,
55- "Programming Language :: Python :: 3.7" ,
5670 "Programming Language :: Python :: 3.8" ,
5771 "Programming Language :: Python :: 3.9" ,
5872 "Programming Language :: Python :: 3.10" ,
5973 "Programming Language :: Python :: 3.11" ,
74+ "Programming Language :: Python :: 3.12" ,
75+ "Programming Language :: Python :: 3.13" ,
6076 "Topic :: System :: Benchmark" ,
6177 "Topic :: Scientific/Engineering" ,
6278 "Topic :: Scientific/Engineering :: Mathematics" ,
@@ -69,11 +85,9 @@ def readme():
6985 "Topic :: Software Development :: Libraries :: Python Modules" ,
7086 "Topic :: Utilities" ,
7187 ],
72- install_requires = ["numpy>=1.17.1" , "scipy>=1.7.1" , "scikit-learn>=1.0.2" ,
73- "pandas>=1.3.5" , "mealpy>=3.0.1" , "permetrics>=1.5.0" ,
74- "plotly>=5.10.0" , "kaleido>=0.2.1" ],
88+ install_requires = REQUIREMENTS ,
7589 extras_require = {
76- "dev" : ["pytest>=7.1.2" , "pytest-cov==4.0.0" , "flake8>=4.0.1" ],
90+ "dev" : ["pytest>=7.1.2" , "twine>=4.0.1" , " pytest-cov==4.0.0" , "flake8>=4.0.1" ],
7791 },
7892 python_requires = '>=3.7' ,
7993)
0 commit comments