@@ -17,14 +17,78 @@ class DownloadLibrariesCommand(install):
1717 """Custom install command that verifies C libraries are present."""
1818
1919 def run (self ):
20- """Run the standard install."""
20+ """Run the standard install and verify libraries."""
21+ print ("\n " + "=" * 70 )
22+ print ("Biocomputing: Checking C libraries..." )
23+ print ("=" * 70 + "\n " )
24+
25+ # Get the _lib directory
26+ lib_dir = Path (__file__ ).parent / "biocomputing" / "_lib"
27+
28+ # Required libraries
29+ required_libs = [
30+ "libdna_sequential.so" ,
31+ "libdna_parallel.so"
32+ ]
33+
34+ # Create _lib directory if it doesn't exist
35+ lib_dir .mkdir (exist_ok = True , parents = True )
36+
37+ print (f"Library directory: { lib_dir } \n " )
38+ print ("Shared Object Status:" )
39+ print ("-" * 70 )
40+
41+ all_present = True
42+ for lib_name in required_libs :
43+ lib_path = lib_dir / lib_name
44+ if lib_path .exists ():
45+ file_size = lib_path .stat ().st_size
46+ size_mb = file_size / (1024 * 1024 )
47+ print (f"✓ { lib_name :<30} { size_mb :>8.2f} MB [{ lib_path } ]" )
48+ else :
49+ print (f"✗ { lib_name :<30} { 'NOT FOUND' :<10} [{ lib_path } ]" )
50+ all_present = False
51+
52+ print ("-" * 70 )
53+
54+ if all_present :
55+ print ("\n ✓ All required shared objects are present!\n " )
56+ else :
57+ print ("\n ⚠ Warning: Some shared objects are missing!" )
58+ print (" The biocomputing package will try to download them." )
59+ print (" Make sure you have internet access.\n " )
60+
61+ # Try to download missing libraries
62+ try :
63+ from biocomputing .download_libs import download_libraries , verify_libraries
64+
65+ print ("Attempting to download libraries from GitHub..." )
66+ success = download_libraries (
67+ github_repo = "sigdelsanjog/biocomputing_core" ,
68+ release_tag = "latest" ,
69+ target_dir = str (lib_dir )
70+ )
71+
72+ if success :
73+ print ("\n ✓ Libraries downloaded successfully!\n " )
74+ else :
75+ print ("\n ⚠ Failed to download some libraries." )
76+ print (" You can manually download from:" )
77+ print (" https://github.com/sigdelsanjog/biocomputing_core/releases\n " )
78+ except Exception as e :
79+ print (f"\n ⚠ Could not download libraries: { e } " )
80+ print (" Manual download may be required.\n " )
81+
82+ print ("=" * 70 )
83+ print ("Proceeding with installation...\n " )
84+
2185 # Run the standard install
2286 super ().run ()
2387
2488
2589setup (
2690 name = "biocomputing" ,
27- version = "1.0.3 " ,
91+ version = "1.0.4 " ,
2892 author = "Sanjog Sigdel" ,
2993 author_email = "sigdelsanjog@example.com" ,
3094 description = "High-performance DNA sequence generator with Python bindings (Sequential & Parallel)" ,
0 commit comments