5ca7218d9b67f2d92b15506be2765a330e59a9e8
vsmalladi
  Thu Apr 12 16:45:25 2012 -0700
Fixed setup.py to deal find and load submodules.
diff --git python/lib/setup.py python/lib/setup.py
index 72a1223..80edc19 100644
--- python/lib/setup.py
+++ python/lib/setup.py
@@ -1,10 +1,32 @@
 from distutils.core import setup
+import os
+
+def is_package(path):
+        return (
+            os.path.isdir(path) and
+            os.path.isfile(os.path.join(path, '__init__.py'))
+            )
+
+def find_packages(path, base="" ):
+        """ Find all packages in path """
+        packages = {}
+        for item in os.listdir(path):
+            dir = os.path.join(path, item)
+            if is_package( dir ):
+                if base:
+                    module_name = "%(base)s.%(item)s" % vars()
+                else:
+                    module_name = item
+                packages[module_name] = dir
+                packages.update(find_packages(dir, module_name))
+        return packages
+
 
 setup(
 		name='ucscgenomics',
 		version='0.1.0',
 		author='Morgan Maddren',
-		packages=['ucscgenomics'],
+		packages=find_packages("."),
 		description='UCSC Genomics parses fileformats specific to use in the Browser source tree. ',
 	)