Remove stray ' character in initial message
[urlwatch.git] / setup.py
blob3f11ee1825738f47311817f0368700d7062937e4
1 #!/usr/bin/python
2 # -*- coding: utf-8 -*-
3 # Minimalistic, automatic setup.py file for Python modules
4 # Copyright (c) 2008-2014 Thomas Perl <thp.io/about>
6 PACKAGE_NAME = 'urlwatch'
8 # Assumptions:
9 # 1. Package name equals main script file name (and only one script)
10 # 2. Main script contains docstring + dunder-{author, license, url, version}
11 # 3. Data files are in "share/", will be installed in $(PREFIX)/share
12 # 4. Packages are in "lib/", no modules
14 from distutils.core import setup
16 import os
17 import re
19 main_py = open(PACKAGE_NAME).read()
20 m = dict(re.findall("\n__([a-z]+)__ = '([^']+)'", main_py))
21 docs = re.findall('"""(.*?)"""', main_py, re.DOTALL)
23 m['name'] = PACKAGE_NAME
24 m['author'], m['author_email'] = re.match(r'(.*) <(.*)>', m['author']).groups()
25 m['description'], m['long_description'] = docs[0].strip().split('\n\n', 1)
26 m['download_url'] = m['url'] + PACKAGE_NAME + '-' + m['version'] + '.tar.gz'
28 m['scripts'] = [PACKAGE_NAME]
29 m['package_dir'] = {'': 'lib'}
30 m['packages'] = ['.'.join(dirname.split(os.sep)[1:])
31 for dirname, _, files in os.walk('lib') if '__init__.py' in files]
32 m['data_files'] = [(dirname, [os.path.join(dirname, file) for file in files])
33 for dirname, _, files in os.walk('share')]
35 setup(**m)