11import setuptools
22from pathlib import Path
3+ import os
34
45
56# Reading the long description from README.md
@@ -14,20 +15,18 @@ def read_long_description():
1415def retrieve_metadata ():
1516 vars2find = ["__author__" , "__version__" , "__url__" , "__description__" ]
1617 vars2readme = {}
17- try :
18- with open ("./__init__.py" , encoding = "utf-8" ) as f :
19- for line in f .readlines ():
20- for v in vars2find :
21- if line .startswith (v ):
22- line = (
23- line .replace (" " , "" )
24- .replace ('"' , "" )
25- .replace ("'" , "" )
26- .strip ()
27- )
28- vars2readme [v ] = line .split ("=" )[1 ]
29- except FileNotFoundError :
30- raise FileNotFoundError ("Metadata file './__init__.py' not found." )
18+
19+ # Use definitive path relative to setup.py location
20+ init_file_path = os .path .join (os .path .dirname (__file__ ), "__init__.py" )
21+
22+ with open (init_file_path , encoding = "utf-8" ) as f :
23+ for line in f .readlines ():
24+ for v in vars2find :
25+ if line .startswith (v ):
26+ line = (
27+ line .replace (" " , "" ).replace ('"' , "" ).replace ("'" , "" ).strip ()
28+ )
29+ vars2readme [v ] = line .split ("=" )[1 ]
3130
3231 # Checking if all required variables are found
3332 missing_vars = [v for v in vars2find if v not in vars2readme ]
@@ -58,11 +57,8 @@ def read_requirements():
5857long_description = read_long_description ()
5958requirements = read_requirements ()
6059
61- # All dependencies are required for full functionality
62- # No optional dependencies to ensure complete installation
63-
6460setuptools .setup (
65- name = "deepcode" ,
61+ name = "deepcode-hku " ,
6662 url = metadata ["__url__" ],
6763 version = metadata ["__version__" ],
6864 author = metadata ["__author__" ],
@@ -71,8 +67,8 @@ def read_requirements():
7167 long_description_content_type = "text/markdown" ,
7268 packages = setuptools .find_packages (
7369 exclude = ("tests*" , "docs*" , ".history*" , ".git*" , ".ruff_cache*" )
74- ), # Automatically find packages
75- py_modules = ["deepcode" ], # Include the main deepcode.py module
70+ ),
71+ py_modules = ["deepcode" ],
7672 classifiers = [
7773 "Development Status :: 4 - Beta" ,
7874 "Programming Language :: Python :: 3" ,
@@ -85,27 +81,18 @@ def read_requirements():
8581 "Topic :: Text Processing :: Linguistic" ,
8682 ],
8783 python_requires = ">=3.9" ,
88- install_requires = requirements , # All dependencies are required
89- include_package_data = True , # Includes non-code files from MANIFEST.in
84+ install_requires = requirements ,
85+ include_package_data = True ,
9086 entry_points = {
9187 "console_scripts" : [
92- "deepcode=deepcode:main" , # Command line entry point
88+ "deepcode=deepcode:main" ,
9389 ],
9490 },
95- project_urls = { # Additional project metadata
91+ project_urls = {
9692 "Documentation" : metadata .get ("__url__" , "" ),
9793 "Source" : metadata .get ("__url__" , "" ),
9894 "Tracker" : f"{ metadata .get ('__url__' , '' )} /issues"
9995 if metadata .get ("__url__" )
10096 else "" ,
10197 },
102- package_data = {
103- "deepcode" : [
104- "config/*.yaml" ,
105- "prompts/*" ,
106- "schema/*" ,
107- "*.png" ,
108- "*.md" ,
109- ],
110- },
11198)
0 commit comments