setup.py: Fixed a UserWarning that may occur with older Python. v0.6.x
authorPascal Volk <neverseen@users.sourceforge.net>
Sat, 02 Jan 2010 19:37:20 +0000
branchv0.6.x
changeset 163 1981f285f0c0
parent 162 0ac9ef587769
child 164 67dc18294de6
setup.py: Fixed a UserWarning that may occur with older Python.
setup.py
--- a/setup.py	Sat Jan 02 15:45:12 2010 +0000
+++ b/setup.py	Sat Jan 02 19:37:20 2010 +0000
@@ -5,51 +5,57 @@
 
 import os
 from distutils.core import setup
+from distutils.dist import DistributionMetadata
 
 VERSION = '0.5.2'
 
+descr = 'Tool to manage mail domains/accounts/aliases for Dovecot and Postfix'
 long_description = """
 vmm, a virtual mail manager, is a command line tool for
 administrators/postmasters to manage (alias-)domains, accounts,
 aliases and relocated users.
 It is designed for Dovecot and Postfix with a PostgreSQL backend.
 """
+packages = ['VirtualMailManager', 'VirtualMailManager.ext',
+            'VirtualMailManager.constants']
+classifiers = ['Development Status :: 5 - Production/Stable',
+               'Environment :: Console',
+               'Intended Audience :: System Administrators',
+               'License :: OSI Approved :: BSD License',
+               'Natural Language :: Dutch',
+               'Natural Language :: English',
+               'Natural Language :: French',
+               'Natural Language :: German',
+               'Operating System :: POSIX',
+               'Operating System :: POSIX :: BSD',
+               'Operating System :: POSIX :: Linux',
+               'Operating System :: POSIX :: Other',
+               'Programming Language :: Python',
+               'Topic :: Communications :: Email',
+               'Topic :: System :: Systems Administration',
+               'Topic :: Utilities']
+
+# sucessfuly tested on:
+platforms = ['freebsd7', 'linux2', 'openbsd4']
 
 # remove existing MANIFEST
 if os.path.exists('MANIFEST'):
     os.remove('MANIFEST')
 
+setup_args = {'name': 'VirtualMailManager',
+              'version': VERSION,
+              'description': descr,
+              'long_description': long_description,
+              'packages': packages,
+              'author': 'Pascal Volk',
+              'author_email': 'neverseen@users.sourceforge.net',
+              'license': 'BSD License',
+              'url': 'http://vmm.localdomain.org/',
+              'download_url':'http://sf.net/projects/vmm/files/',
+              'platforms': platforms,
+              'classifiers': classifiers}
 
-setup(name='VirtualMailManager',
-      version=VERSION,
-      description='Tool to manage mail domains/accounts/aliases for Dovecot and Postfix',
-      long_description=long_description,
-      packages=['VirtualMailManager', 'VirtualMailManager.ext',
-          'VirtualMailManager.constants'],
-      author='Pascal Volk',
-      author_email='neverseen@users.sourceforge.net',
-      license='BSD License',
-      url='http://vmm.localdomain.org/',
-      download_url='http://sf.net/projects/vmm/files/',
-      platforms=['freebsd7', 'linux2', 'openbsd4'],
-      classifiers=[
-          'Development Status :: 4 - Beta',
-          'Development Status :: 5 - Production/Stable',
-          'Environment :: Console',
-          'Intended Audience :: System Administrators',
-          'License :: OSI Approved :: BSD License',
-          'Natural Language :: Dutch',
-          'Natural Language :: English',
-          'Natural Language :: French',
-          'Natural Language :: German',
-          'Operating System :: POSIX',
-          'Operating System :: POSIX :: BSD',
-          'Operating System :: POSIX :: Linux',
-          'Operating System :: POSIX :: Other',
-          'Programming Language :: Python',
-          'Topic :: Communications :: Email',
-          'Topic :: System :: Systems Administration',
-          'Topic :: Utilities'
-      ],
-      requires=['pyPgSQL']
-      )
+if 'requires' in DistributionMetadata._METHOD_BASENAMES:
+    setup_args['requires'] = ['pyPgSQL']
+
+setup(**setup_args)