-"""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
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 setuptools import setup, find_packages
-
-# 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
-
-doclines = __doc__.split("\n")
-
-setup(name="calibcant",
- 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")),
- py_modules = ['ez_setup'],
- packages = find_packages(),
- dependency_links = [
- "http://www.physics.drexel.edu/~wking/code/python/"
- ],
- install_requires = ['piezo >= 0.1'],
+from distutils.core import setup
+from os import walk, listdir
+import os.path
+
+from calibcant import __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
+
+packages = find_packages()
+scripts = [os.path.join('bin', f) for f in sorted(os.listdir('bin'))]
+
+setup(name=package_name,
+ version=__version__,
+ maintainer='W. Trevor King',
+ maintainer_email='wking@drexel.edu',
+ url='http://blog.tremily.us/posts/%s/' % package_name,
+ download_url='http://git.tremily.us/?p=calibcant.git;a=snapshot;h={};sf=tgz'.format(__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