1- from os import path
1+ from pathlib import Path
22from setuptools import setup , find_packages
3- from setuptools .command .install import install
4- import subprocess
5- import sys
3+
64
75def parse_requirements (file ):
6+ """Parse requirements from requirements.txt file."""
87 required_packages = []
9- with open (path .join (path .dirname (__file__ ), file )) as req_file :
10- for line in req_file :
11- # Exclude any comments or empty lines
12- line = line .strip ()
13- if line and not line .startswith ("#" ):
14- required_packages .append (line )
8+ requirements_path = Path (__file__ ).parent / file
9+ try :
10+ with open (requirements_path ) as req_file :
11+ for line in req_file :
12+ # Exclude any comments or empty lines
13+ line = line .strip ()
14+ if line and not line .startswith ("#" ):
15+ required_packages .append (line )
16+ except FileNotFoundError :
17+ print (f"Warning: { file } not found. Using default requirements." )
1518 return required_packages
1619
17- class PostInstallCommand (install ):
18- """Post-installation for downloading NLTK resources."""
19- def run (self ):
20- install .run (self )
21-
22- try :
23- import nltk
24- except ImportError :
25- print ("NLTK is not installed. Installing NLTK..." )
26- subprocess .check_call ([sys .executable , "-m" , "pip" , "install" , "nltk" ])
27- import nltk
28- try :
29- print ("Downloading NLTK 'stopwords' resource..." )
30- for lib in ['stopwords' , 'punkt_tab' , 'averaged_perceptron_tagger_eng' ]:
31- subprocess .check_call ([sys .executable , "-m" , "nltk.downloader" , lib ])
32- print (f"NLTK { lib } downloaded successfully." )
33- except subprocess .CalledProcessError as e :
34- print (f"Failed to download NLTK 'stopwords': { e } " )
35- sys .exit (1 ) # Exit with error code
36-
3720long_description = """
3821autoBOT is an AutoML system for text classification with an emphasis on explainability.
3922It implements the idea of *representation evolution*, learning to combine representations
@@ -58,5 +41,19 @@ def run(self):
5841 packages = packages ,
5942 zip_safe = False ,
6043 include_package_data = True ,
61- install_requires = parse_requirements ("requirements.txt" )
44+ install_requires = parse_requirements ("requirements.txt" ),
45+ classifiers = [
46+ "Development Status :: 4 - Beta" ,
47+ "Intended Audience :: Developers" ,
48+ "Intended Audience :: Science/Research" ,
49+ "License :: OSI Approved :: BSD License" ,
50+ "Programming Language :: Python :: 3" ,
51+ "Programming Language :: Python :: 3.8" ,
52+ "Programming Language :: Python :: 3.9" ,
53+ "Programming Language :: Python :: 3.10" ,
54+ "Programming Language :: Python :: 3.11" ,
55+ "Topic :: Scientific/Engineering :: Artificial Intelligence" ,
56+ "Topic :: Text Processing :: Linguistic" ,
57+ ],
58+ python_requires = ">=3.8" ,
6259)
0 commit comments