Simplify building of help message
[jabberbot/examples.git] / setup.py
blob81befbac3ac10ab5b2388fc00cbe6364ccd27cce
1 #!/usr/bin/env python
2 # Setup script for python-jabberbot
3 # by Thomas Perl <thp.io/about>
5 from distutils.core import setup
7 import re
9 jabberbot_py = open('jabberbot.py').read()
10 metadata = dict(re.findall("__([a-z]+)__ = '([^']+)'", jabberbot_py))
11 docstrings = re.findall('"""(.*)"""', jabberbot_py)
13 # How is the package going to be called?
14 PACKAGE = 'jabberbot'
16 # List the modules that need to be installed/packaged
17 MODULES = (
18 'jabberbot',
21 # Metadata fields extracted from jabberbot.py
22 AUTHOR_EMAIL = metadata['author']
23 VERSION = metadata['version']
24 WEBSITE = metadata['website']
25 LICENSE = metadata['license']
26 DESCRIPTION = docstrings[0]
28 # Extract name and e-mail ("Firstname Lastname <mail@example.org>")
29 AUTHOR, EMAIL = re.match(r'(.*) <(.*)>', AUTHOR_EMAIL).groups()
31 setup(name=PACKAGE,
32 version=VERSION,
33 description=DESCRIPTION,
34 author=AUTHOR,
35 author_email=EMAIL,
36 license=LICENSE,
37 url=WEBSITE,
38 py_modules=MODULES,
39 download_url=WEBSITE+PACKAGE+'-'+VERSION+'.tar.gz')