falcon git is no longer needed now that 0.2.0b1 is on pypi.
[mailman.git] / setup.py
blob78787ed06127a660847a928fc4da8b6b5e8a515a
1 # Copyright (C) 2007-2014 by the Free Software Foundation, Inc.
3 # This file is part of GNU Mailman.
5 # GNU Mailman is free software: you can redistribute it and/or modify it under
6 # the terms of the GNU General Public License as published by the Free
7 # Software Foundation, either version 3 of the License, or (at your option)
8 # any later version.
10 # GNU Mailman is distributed in the hope that it will be useful, but WITHOUT
11 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
13 # more details.
15 # You should have received a copy of the GNU General Public License along with
16 # GNU Mailman. If not, see <http://www.gnu.org/licenses/>.
18 # Do *not* import unicode_literals. This breaks setuptools.
19 from __future__ import absolute_import, print_function
21 import re
22 import sys
24 from setuptools import setup, find_packages
25 from string import Template
27 if sys.hexversion < 0x20700f0:
28 print('Mailman requires at least Python 2.7')
29 sys.exit(1)
32 # Calculate the version number without importing the mailman package.
33 with open('src/mailman/version.py') as fp:
34 for line in fp:
35 mo = re.match("VERSION = '(?P<version>[^']+?)'", line)
36 if mo:
37 __version__ = mo.group('version')
38 break
39 else:
40 print('No version number found')
41 sys.exit(1)
45 # Ensure that all the .mo files are generated from the corresponding .po file.
46 # This procedure needs to be made sane, probably when the language packs are
47 # properly split out.
49 # Create the .mo files from the .po files. There may be errors and warnings
50 # here and that could cause the digester.txt test to fail.
51 ## start_dir = os.path.dirname('src/mailman/messages')
52 ## for dirpath, dirnames, filenames in os.walk(start_dir):
53 ## for filename in filenames:
54 ## po_file = os.path.join(dirpath, filename)
55 ## basename, ext = os.path.splitext(po_file)
56 ## if ext <> '.po':
57 ## continue
58 ## mo_file = basename + '.mo'
59 ## if (not os.path.exists(mo_file) or
60 ## os.path.getmtime(po_file) > os.path.getmtime(mo_file)):
61 ## # The mo file doesn't exist or is older than the po file.
62 ## os.system('msgfmt -o %s %s' % (mo_file, po_file))
66 # XXX The 'bin/' prefix here should be configurable.
67 template = Template('$script = mailman.bin.$script:main')
68 scripts = set(
69 template.substitute(script=script)
70 for script in ('mailman', 'runner', 'master', 'onebounce')
75 setup(
76 name = 'mailman',
77 version = __version__,
78 description = 'Mailman -- the GNU mailing list manager',
79 long_description= """\
80 This is GNU Mailman, a mailing list management system distributed under the
81 terms of the GNU General Public License (GPL) version 3 or later. The name of
82 this software is spelled 'Mailman' with a leading capital 'M' but with a lower
83 case second `m'. Any other spelling is incorrect.""",
84 author = 'The Mailman Developers',
85 author_email = 'mailman-developers@python.org',
86 license = 'GPLv3',
87 url = 'http://www.list.org',
88 keywords = 'email',
89 packages = find_packages('src'),
90 package_dir = {'': 'src'},
91 include_package_data = True,
92 entry_points = {
93 'console_scripts' : list(scripts),
95 install_requires = [
96 'alembic',
97 'enum34',
98 'falcon',
99 'flufl.bounce',
100 'flufl.i18n',
101 'flufl.lock',
102 'httplib2',
103 'lazr.config',
104 'lazr.smtptest',
105 'mock',
106 'nose2',
107 'passlib',
108 'sqlalchemy',
109 'zope.component',
110 'zope.configuration',
111 'zope.event',
112 'zope.interface',
114 test_suite = 'nose2.collector.collector',