~sambuddhabasu1/mailman/fix_mailman_run_error

« back to all changes in this revision

Viewing changes to setup.py

  • Committer: Barry Warsaw
  • Date: 2009-07-04 16:47:24 UTC
  • Revision ID: barry@list.org-20090704164724-gws0n2y2bzf49lum
More lint picking.
Fix a documentation link.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2007-2013 by the Free Software Foundation, Inc.
 
1
# Copyright (C) 2007-2009 by the Free Software Foundation, Inc.
2
2
#
3
3
# This file is part of GNU Mailman.
4
4
#
15
15
# You should have received a copy of the GNU General Public License along with
16
16
# GNU Mailman.  If not, see <http://www.gnu.org/licenses/>.
17
17
 
18
 
from distribute_setup import use_setuptools
19
 
use_setuptools()
 
18
import ez_setup
 
19
ez_setup.use_setuptools()
20
20
 
21
 
import re
22
21
import sys
23
 
 
 
22
from string import Template
 
23
 
 
24
sys.path.insert(0, 'src')
 
25
 
 
26
import mailman.bin
 
27
from mailman.version import VERSION as __version__
24
28
from setuptools import setup, find_packages
25
 
from string import Template
26
 
 
27
 
if sys.hexversion < 0x20700f0:
28
 
    print 'Mailman requires at least Python 2.7'
 
29
 
 
30
 
 
31
 
 
32
if sys.hexversion < 0x20600f0:
 
33
    print 'Mailman requires at least Python 2.6'
29
34
    sys.exit(1)
30
35
 
31
36
 
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)
42
 
 
43
 
 
44
37
 
45
38
# Ensure that all the .mo files are generated from the corresponding .po file.
46
39
# This procedure needs to be made sane, probably when the language packs are
47
40
# properly split out.
48
41
 
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))
 
42
import os
 
43
import mailman.commands
 
44
import mailman.messages
 
45
 
 
46
start_dir = os.path.dirname(mailman.messages.__file__)
 
47
for dirpath, dirnames, filenames in os.walk(start_dir):
 
48
    for filename in filenames:
 
49
        po_file = os.path.join(dirpath, filename)
 
50
        basename, ext = os.path.splitext(po_file)
 
51
        if ext <> '.po':
 
52
            continue
 
53
        mo_file = basename + '.mo'
 
54
        if (not os.path.exists(mo_file) or
 
55
            os.path.getmtime(po_file) > os.path.getmtime(mo_file)):
 
56
            # The mo file doesn't exist or is older than the po file.
 
57
            os.system('msgfmt -o %s %s' % (mo_file, po_file))
63
58
 
64
59
 
65
60
 
67
62
template = Template('$script = mailman.bin.$script:main')
68
63
scripts = set(
69
64
    template.substitute(script=script)
70
 
    for script in ('mailman', 'runner', 'master', 'onebounce')
 
65
    for script in mailman.bin.__all__
71
66
    )
72
67
 
73
68
 
93
88
        'console_scripts' : list(scripts),
94
89
        },
95
90
    install_requires = [
96
 
        'flufl.bounce',
97
 
        'flufl.enum',
98
 
        'flufl.i18n',
99
 
        'flufl.lock',
100
 
        'httplib2',
 
91
        'argparse',
101
92
        'lazr.config',
102
 
        'lazr.smtptest',
103
 
        'mock',
104
 
        'passlib',
105
 
        'restish',
 
93
        'lazr.delegates',
 
94
        'lazr.restful',
 
95
        'locknix',
 
96
        'munepy',
106
97
        'storm',
107
 
        'zc.buildout',
108
 
        'zope.component',
109
 
        'zope.configuration',
110
 
        'zope.event',
 
98
        'zope.schema',
111
99
        'zope.interface',
112
 
        'zope.testing<4',
113
 
        ],
 
100
        ],
 
101
    setup_requires = [
 
102
        'setuptools_bzr',
 
103
        ],
 
104
    extras_require=dict(
 
105
        docs=['Sphinx', 'z3c.recipe.sphinxdoc'],
 
106
        )
114
107
    )