setup.py 4.39 KB
Newer Older
Abhilash Raj's avatar
Abhilash Raj committed
1
# Copyright (C) 2007-2019 by the Free Software Foundation, Inc.
2
#
Barry Warsaw's avatar
Barry Warsaw committed
3 4 5 6 7
# This file is part of GNU Mailman.
#
# GNU Mailman is free software: you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free
# Software Foundation, either version 3 of the License, or (at your option)
8 9
# any later version.
#
Barry Warsaw's avatar
Barry Warsaw committed
10
# GNU Mailman is distributed in the hope that it will be useful, but WITHOUT
11 12 13 14 15
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
# more details.
#
# You should have received a copy of the GNU General Public License along with
16
# GNU Mailman.  If not, see <https://www.gnu.org/licenses/>.
17

18
import re
19
import sys
20

21
from setuptools import setup, find_packages
22
from string import Template
23

24

Barry Warsaw's avatar
Barry Warsaw committed
25 26
if sys.hexversion < 0x30500f0:
    print('Mailman requires at least Python 3.5')
27 28 29
    sys.exit(1)


30 31 32
# Calculate the version number without importing the mailman package.
with open('src/mailman/version.py') as fp:
    for line in fp:
33
        mo = re.match("VERSION = '(?P<version>[^']+?)'", line)
34 35 36 37
        if mo:
            __version__ = mo.group('version')
            break
    else:
38
        print('No version number found')
39 40 41
        sys.exit(1)


42 43 44 45

# Ensure that all the .mo files are generated from the corresponding .po file.
# This procedure needs to be made sane, probably when the language packs are
# properly split out.
46

47 48
# Create the .mo files from the .po files.  There may be errors and warnings
# here and that could cause the digester.txt test to fail.
49 50 51 52 53 54 55 56 57 58 59 60
## start_dir = os.path.dirname('src/mailman/messages')
## for dirpath, dirnames, filenames in os.walk(start_dir):
##     for filename in filenames:
##         po_file = os.path.join(dirpath, filename)
##         basename, ext = os.path.splitext(po_file)
##         if ext <> '.po':
##             continue
##         mo_file = basename + '.mo'
##         if (not os.path.exists(mo_file) or
##             os.path.getmtime(po_file) > os.path.getmtime(mo_file)):
##             # The mo file doesn't exist or is older than the po file.
##             os.system('msgfmt -o %s %s' % (mo_file, po_file))
61 62


63

64
# XXX The 'bin/' prefix here should be configurable.
65
template = Template('$script = mailman.bin.$script:main')
66
scripts = set(
67
    template.substitute(script=script)
68
    for script in ('mailman', 'runner', 'master')
69 70
    )

71

72 73 74

setup(
    name            = 'mailman',
Barry Warsaw's avatar
Barry Warsaw committed
75
    version         = __version__,
76 77 78
    description     = 'Mailman -- the GNU mailing list manager',
    long_description= """\
This is GNU Mailman, a mailing list management system distributed under the
Barry Warsaw's avatar
Barry Warsaw committed
79 80
terms of the GNU General Public License (GPL) version 3 or later.  The name of
this software is spelled 'Mailman' with a leading capital 'M' but with a lower
Abhilash Raj's avatar
Abhilash Raj committed
81
case second 'm'.  Any other spelling is incorrect.""",
82 83
    author          = 'The Mailman Developers',
    author_email    = 'mailman-developers@python.org',
Barry Warsaw's avatar
Barry Warsaw committed
84
    license         = 'GPLv3',
85
    url             = 'https://www.list.org',
86
    keywords        = 'email',
87 88 89 90
    classifiers = [
        'Development Status :: 5 - Production/Stable',
        'Intended Audience :: System Administrators',
        'License :: OSI Approved :: '
91
        'GNU General Public License v3 or later (GPLv3+)',
92 93
        'Operating System :: POSIX',
        'Programming Language :: Python :: 3.5',
94
        'Programming Language :: Python :: 3.6',
95
        'Programming Language :: Python :: 3.7',
96 97 98 99
        'Topic :: Communications :: Email :: Mailing List Servers',
        'Topic :: Communications :: Usenet News',
        'Topic :: Internet :: WWW/HTTP :: WSGI :: Application',
        ],
100 101
    packages        = find_packages('src'),
    package_dir     = {'': 'src'},
102
    include_package_data = True,
103
    entry_points    = {
104
        'console_scripts' : list(scripts),
105 106
        },
    install_requires = [
107
        'aiosmtpd>=1.1',
108
        'alembic',
109
        'atpublic',
gene's avatar
gene committed
110 111
        'authheaders>=0.9.2',
        'authres>=1.0.1',
112
        'click>=7.0.0',
113
        'dnspython>=1.14.0',
114
        'falcon>1.0.0',
115
        'flufl.bounce',
116
        'flufl.i18n>=2.0',
117
        'flufl.lock>=3.1',
118
        'importlib_resources',
119
        'gunicorn',
120
        'lazr.config',
121
        'python-dateutil>=2.0',
122
        'passlib',
123
        'requests',
124
        'sqlalchemy>=1.2.3',
125
        'zope.component',
126
        'zope.configuration',
Barry Warsaw's avatar
Barry Warsaw committed
127
        'zope.event',
128 129
        'zope.interface',
        ],
130
    )
Barry Warsaw's avatar
Barry Warsaw committed
131 132

# flake8: noqa