setup.py 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  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 - 2018 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 re
  22. try:
  23. from setuptools import setup, Command
  24. except:
  25. from distutils.core import setup, Command
  26. with open('offlineimap/__init__.py') as f:
  27. version_grp = re.search(r"__version__ = ['\"](.+)['\"]", f.read())
  28. if version_grp:
  29. version = version_grp.group(1)
  30. else:
  31. version = "0.0.0"
  32. f.seek(0)
  33. description_grp = re.search(r"__description__ = ['\"](.+)['\"]", f.read())
  34. if description_grp:
  35. description = description_grp.group(1)
  36. else:
  37. description = "Disconnected Universal IMAP Mail Synchronization/Reader Support"
  38. f.seek(0)
  39. author_grp = re.search(r"__author__ = ['\"](.+)['\"]", f.read())
  40. if author_grp:
  41. author = author_grp.group(1)
  42. else:
  43. author = "John Goerzen"
  44. f.seek(0)
  45. author_email_grp = re.search(r"__author_email__ = ['\"](.+)['\"]", f.read())
  46. if author_email_grp:
  47. author_email = author_email_grp.group(1)
  48. else:
  49. author_email = ""
  50. f.seek(0)
  51. homepage_grp = re.search(r"__homepage__ = ['\"](.+)['\"]", f.read())
  52. if homepage_grp:
  53. homepage = homepage_grp.group(1)
  54. else:
  55. homepage = "http://www.offlineimap.org"
  56. f.seek(0)
  57. copyright_grp = re.search(r"__copyright__ = ['\"](.+)['\"]", f.read())
  58. if copyright_grp:
  59. copyright = copyright_grp.group(1)
  60. else:
  61. copyright = ""
  62. setup(name="offlineimap",
  63. version=version,
  64. description=description,
  65. long_description=description,
  66. author=author,
  67. author_email=author_email,
  68. url=homepage,
  69. packages=['offlineimap', 'offlineimap.folder',
  70. 'offlineimap.repository', 'offlineimap.ui',
  71. 'offlineimap.utils'],
  72. scripts=['bin/offlineimap'],
  73. setup_requires=['setuptools>=18.5', 'wheel', 'imaplib2'],
  74. license=copyright + ", Licensed under the GPL version 2",
  75. install_requires=['distro',
  76. 'imaplib2>=3.5',
  77. 'rfc6555',
  78. 'urllib3~=1.25.9'],
  79. extras_require={'kerberos':'gssapi[kerberos]',
  80. 'keyring':'keyring[keyring]',
  81. 'cygwin':'portalocker[cygwin]',
  82. 'testinternet':'certifi~=2020.6.20'}
  83. )