improvements on MUC set role/affiliation
[jabberbot/examples.git] / setup.py
blobec630d7a9b71aab259eae390b7f359efdb8cc3c7
1 #!/usr/bin/env python
2 # Generic setup script for single-module Python projects
3 # by Thomas Perl <thp.io/about>
5 from distutils.core import setup
7 import re
9 PACKAGE = 'jabberbot'
10 SCRIPT_FILE = PACKAGE + '.py'
12 main_py = open(SCRIPT_FILE).read()
13 metadata = dict(re.findall("__([a-z]+)__ = '([^']+)'", main_py))
14 docstrings = re.findall('"""(.*?)"""', main_py, re.DOTALL)
16 # List the modules that need to be installed/packaged
17 MODULES = (
18 PACKAGE,
21 # Metadata fields extracted from SCRIPT_FILE
22 AUTHOR_EMAIL = metadata['author']
23 VERSION = metadata['version']
24 WEBSITE = metadata['website']
25 LICENSE = metadata['license']
26 DESCRIPTION = docstrings[0].strip()
27 if '\n\n' in DESCRIPTION:
28 DESCRIPTION, LONG_DESCRIPTION = DESCRIPTION.split('\n\n', 1)
29 else:
30 LONG_DESCRIPTION = None
32 # Extract name and e-mail ("Firstname Lastname <mail@example.org>")
33 AUTHOR, EMAIL = re.match(r'(.*) <(.*)>', AUTHOR_EMAIL).groups()
35 setup(name=PACKAGE,
36 version=VERSION,
37 description=DESCRIPTION,
38 long_description=LONG_DESCRIPTION,
39 author=AUTHOR,
40 author_email=EMAIL,
41 license=LICENSE,
42 url=WEBSITE,
43 py_modules=MODULES,
44 download_url=WEBSITE+PACKAGE+'-'+VERSION+'.tar.gz')