Convert calibcant to the new, nestable h5config.
[calibcant.git] / setup.py
index abfbe099265a864a27d3cf07b22e64a9aaaf60eb..da1f66d394f1201be89f6a73ab8339440ee57d42 100644 (file)
--- a/setup.py
+++ b/setup.py
@@ -1,12 +1,6 @@
-"""CalibCant: tools for thermally calibrating AFM cantilevers
-
-Requires
-  * TODO
-
-Git repository:
-http://www.physics.drexel.edu/~wking/code/git/calibcant.git
-"""
+"calibcant: tools for thermally calibrating AFM cantilevers"
 
+package_name = 'calibcant'
 classifiers = """\
 Development Status :: 2 - Pre-Alpha
 Intended Audience :: Developers
@@ -19,46 +13,39 @@ Topic :: Scientific/Engineering
 Topic :: Software Development :: Libraries :: Python Modules
 """
 
-# http://peak.telecommunity.com/DevCenter/setuptools#using-setuptools-without-bundling-it
-import ez_setup
-ez_setup.use_setuptools()
+from distutils.core import setup
+from os import walk, listdir
+import os.path
 
-from setuptools import setup, find_packages
+from calibcant import __version__
 
-# patch distutils if it can't cope with the "classifiers" or
-# "download_url" keywords
-from sys import version
-if version < '2.2.3':
-    from distutils.dist import DistributionMetadata
-    DistributionMetadata.classifiers = None
-    DistributionMetadata.download_url = None
 
-import calibcant
-__version__ = calibcant.__version__
+def find_packages(root='calibcant'):
+    packages = []
+    prefix = '.'+os.path.sep
+    for dirpath,dirnames,filenames in walk(root):
+        if '__init__.py' in filenames:
+            if dirpath.startswith(prefix):
+                dirpath = dirpath[len(prefix):]
+            packages.append(dirpath.replace(os.path.sep, '.'))
+    return packages
 
-doclines = __doc__.split("\n")
+packages = find_packages()
+scripts = [os.path.join('bin', f) for f in sorted(os.listdir('bin'))]
 
-setup(name="calibcant",
+setup(name=package_name,
       version=__version__,
-      maintainer="W. Trevor King",
-      maintainer_email="wking@drexel.edu",
-      url = "http://www.physics.drexel.edu/~wking/code/python/",
-      download_url = "http://www.physics.drexel.edu/~wking/code/python/calibcant-%s.tar.gz" % __version__,
-      license = "GNU General Public License (GPL)",
-      platforms = ["all"],
-      description = doclines[0],
-      long_description = "\n".join(doclines[2:]),
-      classifiers = filter(None, classifiers.split("\n")),
-      packages = find_packages(),
-      dependency_links = [
-        "http://www.physics.drexel.edu/~wking/code/python/"
-        ],
-      install_requires = ['piezo >= 0.3'],
+      maintainer='W. Trevor King',
+      maintainer_email='wking@drexel.edu',
+      url='http://www.physics.drexel.edu/~wking/unfolding-disasters/posts/%s/' % package_name,
+      download_url='http://www.physics.drexel.edu/~wking/code/python/%s-%s.tar.gz' % (package_name, __version__),
+      license='GNU General Public License (GPL)',
+      platforms=['all'],
+      description=__doc__,
+      long_description=open('README', 'r').read(),
+      classifiers=filter(None, classifiers.split('\n')),
+      packages=packages,
+      scripts=scripts,
+      provides=['calibcant (%s)' % __version__],
+      requires=['pypiezo (>= 0.5)'],
       )
-
-# use packages to include subdirectory packages
-# use py_modules to include single-module packages
-# use ext_modules to include extension modules
-# see
-#   http://www.python.org/doc/2.5.2/dist/listing-modules.html
-#   http://www.python.org/doc/2.5.2/dist/describing-extensions.html