setup.py 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  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 - 2020 John Goerzen & contributors
  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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  21. import os
  22. from distutils.core import setup, Command
  23. import logging
  24. from os import path
  25. here = path.abspath(path.dirname(__file__))
  26. # load __version__, __doc__, __author_, ...
  27. exec(open(path.join(here, 'offlineimap', 'version.py')).read())
  28. class TestCommand(Command):
  29. """runs the OLI testsuite"""
  30. description = """Runs the test suite. In order to execute only a single
  31. test, you could also issue e.g. 'python -m unittest
  32. test.tests.test_01_basic.TestBasicFunctions.test_01_olistartup' on the
  33. command line."""
  34. user_options = []
  35. def initialize_options(self):
  36. pass
  37. def finalize_options(self):
  38. pass
  39. def run(self):
  40. # Import the test classes here instead of at the begin of the module
  41. # to avoid an implicit dependency of the 'offlineimap' module
  42. # in the setup.py (which may run *before* offlineimap is installed)
  43. from test.OLItest import TextTestRunner, TestLoader, OLITestLib
  44. logging.basicConfig(format='%(message)s')
  45. # set credentials and OfflineImap command to be executed:
  46. OLITestLib(cred_file='./test/credentials.conf', cmd='./offlineimap.py')
  47. suite = TestLoader().discover('./test/tests')
  48. #TODO: failfast does not seem to exist in python2.6?
  49. TextTestRunner(verbosity=2,failfast=True).run(suite)
  50. reqs = [
  51. 'six',
  52. 'rfc6555'
  53. ]
  54. setup(name = "offlineimap",
  55. version = __version__,
  56. description = __description__,
  57. long_description = __description__,
  58. author = __author__,
  59. author_email = __author_email__,
  60. url = __homepage__,
  61. packages = ['offlineimap', 'offlineimap.folder',
  62. 'offlineimap.repository', 'offlineimap.ui',
  63. 'offlineimap.utils'],
  64. scripts = ['bin/offlineimap'],
  65. license = __copyright__ + \
  66. ", Licensed under the GPL version 2",
  67. cmdclass = { 'test': TestCommand},
  68. install_requires = reqs
  69. )