setup.py 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. #!/usr/bin/env python
  2. # $Id: setup.py,v 1.1 2002/06/21 18:10:49 jgoerzen Exp $
  3. # IMAP synchronization
  4. # Module: installer
  5. # COPYRIGHT #
  6. # Copyright (C) 2002 - 2006 John Goerzen
  7. #
  8. # This program is free software; you can redistribute it and/or modify
  9. # it under the terms of the GNU General Public License as published by
  10. # the Free Software Foundation; either version 2 of the License, or
  11. # (at your option) any later version.
  12. #
  13. # This program is distributed in the hope that it will be useful,
  14. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. # GNU General Public License for more details.
  17. #
  18. # You should have received a copy of the GNU General Public License
  19. # along with this program; if not, write to the Free Software
  20. # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  21. import os
  22. from distutils.core import setup, Command
  23. import offlineimap
  24. import logging
  25. from test.OLItest import TextTestRunner, TestLoader, OLITestLib
  26. class TestCommand(Command):
  27. """runs the OLI testsuite"""
  28. description = """Runs the test suite. In order to execute only a single
  29. test, you could also issue e.g. 'python -m unittest
  30. test.tests.test_01_basic.TestBasicFunctions.test_01_olistartup' on the
  31. command line."""
  32. user_options = []
  33. def initialize_options(self):
  34. pass
  35. def finalize_options(self):
  36. pass
  37. def run(self):
  38. logging.basicConfig(format='%(message)s')
  39. # set credentials and OfflineImap command to be executed:
  40. OLITestLib(cred_file='./test/credentials.conf', cmd='./offlineimap.py')
  41. suite = TestLoader().discover('./test/tests')
  42. #TODO: failfast does not seem to exist in python2.6?
  43. TextTestRunner(verbosity=2,failfast=True).run(suite)
  44. setup(name = "offlineimap",
  45. version = offlineimap.__version__,
  46. description = offlineimap.__description__,
  47. author = offlineimap.__author__,
  48. author_email = offlineimap.__author_email__,
  49. url = offlineimap.__homepage__,
  50. packages = ['offlineimap', 'offlineimap.folder',
  51. 'offlineimap.repository', 'offlineimap.ui',
  52. 'offlineimap.utils'],
  53. scripts = ['bin/offlineimap'],
  54. license = offlineimap.__copyright__ + \
  55. ", Licensed under the GPL version 2",
  56. cmdclass = { 'test': TestCommand}
  57. )