setup.py 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. #!/usr/bin/env python
  2. # coding: utf-8
  3. import os
  4. import setuptools
  5. import sys
  6. #: The name of the package on PyPi
  7. PYPI_PACKAGE_NAME = 'pystray'
  8. #: The name of the main Python package
  9. MAIN_PACKAGE_NAME = 'pystray'
  10. #: The package URL
  11. PACKAGE_URL = 'https://github.com/moses-palmer/pystray'
  12. #: The author email
  13. AUTHOR_EMAIL = 'moses.palmer@gmail.com'
  14. #: The runtime requirements
  15. RUNTIME_PACKAGES = [
  16. 'Pillow',
  17. 'six']
  18. #: Additional requirements used during setup
  19. SETUP_PACKAGES = RUNTIME_PACKAGES + [
  20. 'sphinx >=1.3.1']
  21. #: Packages requires for different environments
  22. EXTRA_PACKAGES = {
  23. ':sys_platform == "darwin"': [
  24. 'pyobjc-framework-Quartz >=3.0'],
  25. ':sys_platform == "linux"': [
  26. 'python-xlib >=0.17']}
  27. # Read globals from ._info without loading it
  28. INFO = {}
  29. with open(os.path.join(
  30. os.path.dirname(__file__),
  31. 'lib',
  32. MAIN_PACKAGE_NAME,
  33. '_info.py'), 'rb') as f:
  34. data = (
  35. f.read().decode('utf-8') if sys.version_info.major >= 3
  36. else f.read())
  37. code = compile(data, '_info.py', 'exec')
  38. exec(code, {}, INFO)
  39. INFO['author'] = INFO['__author__']
  40. INFO['version'] = '.'.join(str(v) for v in INFO['__version__'])
  41. # Load the read me
  42. try:
  43. with open(os.path.join(
  44. os.path.dirname(__file__),
  45. 'README.rst', 'rb')) as f:
  46. README = f.read().decode('utf-8')
  47. with open(os.path.join(
  48. os.path.dirname(__file__),
  49. 'docs',
  50. 'usage.rst'), 'rb') as f:
  51. README += '\n\n' + f.read().decode('utf-8')
  52. except IOError:
  53. README = ''
  54. # Load the release notes
  55. try:
  56. with open(os.path.join(
  57. os.path.dirname(__file__),
  58. 'CHANGES.rst'), 'rb') as f:
  59. CHANGES = f.read().decode('utf-8')
  60. except IOError:
  61. CHANGES = ''
  62. setuptools.setup(
  63. name=PYPI_PACKAGE_NAME,
  64. version=INFO['version'],
  65. description='Provides systray integration',
  66. long_description=README + '\n\n' + CHANGES,
  67. install_requires=RUNTIME_PACKAGES,
  68. setup_requires=RUNTIME_PACKAGES + SETUP_PACKAGES,
  69. extras_require=EXTRA_PACKAGES,
  70. author=INFO['author'],
  71. author_email=AUTHOR_EMAIL,
  72. url=PACKAGE_URL,
  73. packages=setuptools.find_packages(
  74. os.path.join(
  75. os.path.dirname(__file__),
  76. 'lib')),
  77. package_dir={'': 'lib'},
  78. zip_safe=True,
  79. test_suite='tests',
  80. license='LGPLv3',
  81. keywords='system tray icon, systray icon',
  82. classifiers=[
  83. 'Development Status :: 4 - Beta',
  84. 'Intended Audience :: Developers',
  85. 'License :: OSI Approved :: GNU Lesser General Public License v3 '
  86. '(LGPLv3)',
  87. 'Operating System :: MacOS :: MacOS X',
  88. 'Operating System :: Microsoft :: Windows :: Windows NT/2000',
  89. 'Operating System :: POSIX',
  90. 'Programming Language :: Python',
  91. 'Programming Language :: Python :: 2.7',
  92. 'Programming Language :: Python :: 3.4'])