aboutsummaryrefslogtreecommitdiffstats
path: root/setup.py
diff options
context:
space:
mode:
Diffstat (limited to 'setup.py')
-rw-r--r--setup.py55
1 files changed, 11 insertions, 44 deletions
diff --git a/setup.py b/setup.py
index 99fa20e..53e77bc 100644
--- a/setup.py
+++ b/setup.py
@@ -1,34 +1,14 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
from __future__ import print_function
-import unittest
-import sys
-from distutils.core import setup, Extension, Command
+import os.path
+from setuptools import setup
+from distutils.core import Extension
from distutils.command.build_ext import build_ext
from subprocess import check_call
from mail2news import VERSION, DESC
-class RunTests(Command):
- """New setup.py command to run all tests for the package.
- """
- description = "run all tests for the package"
-
- user_options = []
-
- def initialize_options(self):
- pass
-
- def finalize_options(self):
- pass
-
- def run(self):
- tests = unittest.TestLoader().discover('.')
- runner = unittest.TextTestRunner()
- results = runner.run(tests)
- sys.exit(not results.wasSuccessful())
-
-
class Build_WLP_ext(build_ext):
def run(self):
self.make_file(
@@ -45,6 +25,9 @@ class Build_WLP_ext(build_ext):
'Generating parser')
build_ext.run(self)
+def read(fname):
+ return open(os.path.join(os.path.dirname(__file__), fname)).read()
+
# see https://github.com/Turbo87/py-xcsoar/blob/master/setup.py
wlp_module = Extension('wlp',
sources=['wlp/wlp.c',
@@ -58,30 +41,14 @@ setup(name='pyg',
author="Cosimo Alfarano, Matej Cepl",
author_email="kalfa@debian.org, mcepl@cepl.eu",
description=DESC,
- long_description='''
- Python Gateway Script from news to mail and vice versa.
-
- It is intended to be a full SMTP/NNTP rfc compliant gateway
- with whitelist manager.
-
- You will probably have to install a mail-transport-agent and/or
- news-transport-system package to manage SMTP/NNTP traffic.
-
- MTA is needed for mail2news service, since mail have to be
- processed on a box where pyg is installed. You can use a remote
- smtpserver for news2mail.
-
- News system is useful but not needed, since you can send articles to a
- remote SMTP server (ie: moderated NG) where is installed pyg, otherwise you
- will need it.
-
- It refers to rfc 822 (mail) and 850 (news).
- ''',
+ long_description=read('README'),
py_modules=['mail2news', 'news2mail', 'setup', 'whitelist'],
ext_modules=[wlp_module],
+ test_suite="test",
scripts=['pygm2n', 'pygn2m'],
- cmdclass={'build_ext': Build_WLP_ext,
- 'test': RunTests},
+ cmdclass={
+ 'build_ext': Build_WLP_ext
+ },
# TODO package actually requires lex and yacc port, but not sure
# how to say it here
requires=[],