setup.py 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. import os
  4. import sys
  5. import codecs
  6. import platform
  7. if sys.version_info < (2, 5):
  8. raise Exception("Celery requires Python 2.5 or higher.")
  9. try:
  10. from setuptools import setup, find_packages
  11. from setuptools.command.test import test
  12. except ImportError:
  13. raise
  14. from ez_setup import use_setuptools
  15. use_setuptools()
  16. from setuptools import setup, find_packages # noqa
  17. from setuptools.command.test import test # noqa
  18. NAME = "celery"
  19. entrypoints = {}
  20. extra = {}
  21. # -*- Classifiers -*-
  22. classes = """
  23. Development Status :: 5 - Production/Stable
  24. License :: OSI Approved :: BSD License
  25. Topic :: System :: Distributed Computing
  26. Topic :: Software Development :: Object Brokering
  27. Intended Audience :: Developers
  28. Intended Audience :: Information Technology
  29. Intended Audience :: Science/Research
  30. Intended Audience :: Financial and Insurance Industry
  31. Intended Audience :: Healthcare Industry
  32. Environment :: No Input/Output (Daemon)
  33. Environment :: Console
  34. Programming Language :: Python
  35. Programming Language :: Python :: 2
  36. Programming Language :: Python :: 2.5
  37. Programming Language :: Python :: 2.6
  38. Programming Language :: Python :: 2.7
  39. Programming Language :: Python :: 3
  40. Programming Language :: Python :: 3.2
  41. Programming Language :: Python :: Implementation :: CPython
  42. Programming Language :: Python :: Implementation :: PyPy
  43. Programming Language :: Python :: Implementation :: Jython
  44. Operating System :: OS Independent
  45. Operating System :: POSIX
  46. Operating System :: Microsoft :: Windows
  47. Operating System :: MacOS :: MacOS X
  48. """
  49. classifiers = [s.strip() for s in classes.split('\n') if s]
  50. # -*- Python 3 -*-
  51. is_py3k = sys.version_info >= (3, 0)
  52. if is_py3k:
  53. extra.update(use_2to3=True)
  54. # -*- Distribution Meta -*-
  55. os.environ["CELERY_NO_EVAL"] = "yes"
  56. import celery as distmeta
  57. os.environ.pop("CELERY_NO_EVAL", None)
  58. sys.modules.pop("celery", None)
  59. # -*- Custom Commands -*-
  60. class quicktest(test):
  61. extra_env = dict(SKIP_RLIMITS=1, QUICKTEST=1)
  62. def run(self, *args, **kwargs):
  63. for env_name, env_value in self.extra_env.items():
  64. os.environ[env_name] = str(env_value)
  65. test.run(self, *args, **kwargs)
  66. # -*- Installation Dependencies -*-
  67. install_requires = []
  68. try:
  69. import importlib # noqa
  70. except ImportError:
  71. install_requires.append("importlib")
  72. install_requires.extend([
  73. "anyjson>=0.3.1",
  74. "kombu>=1.4.3,<3.0.0",
  75. ])
  76. if is_py3k:
  77. install_requires.append("python-dateutil>=2.0.0")
  78. else:
  79. install_requires.append("python-dateutil>=1.5.0,<2.0.0")
  80. py_version = sys.version_info
  81. is_jython = sys.platform.startswith("java")
  82. is_pypy = hasattr(sys, "pypy_version_info")
  83. if sys.version_info < (2, 7):
  84. install_requires.append("ordereddict") # Replacement for the ordered dict
  85. if sys.version_info < (2, 6) and not (is_jython or is_pypy):
  86. install_requires.append("multiprocessing")
  87. if is_jython:
  88. install_requires.append("threadpool")
  89. install_requires.append("simplejson")
  90. # -*- Tests Requires -*-
  91. tests_require = ["nose", "nose-cover3", "sqlalchemy", "mock"]
  92. if sys.version_info < (2, 7):
  93. tests_require.append("unittest2")
  94. elif sys.version_info <= (2, 5):
  95. tests_require.append("simplejson")
  96. # -*- Long Description -*-
  97. if os.path.exists("README.rst"):
  98. long_description = codecs.open("README.rst", "r", "utf-8").read()
  99. else:
  100. long_description = "See http://pypi.python.org/pypi/celery"
  101. # -*- Entry Points -*- #
  102. console_scripts = entrypoints["console_scripts"] = [
  103. 'celerybeat = celery.bin.celerybeat:main',
  104. 'camqadm = celery.bin.camqadm:main',
  105. 'celeryev = celery.bin.celeryev:main',
  106. 'celeryctl = celery.bin.celeryctl:main',
  107. 'celeryd-multi = celery.bin.celeryd_multi:main',
  108. ]
  109. if platform.system() == "Windows":
  110. console_scripts.append('celeryd = celery.bin.celeryd:windows_main')
  111. else:
  112. console_scripts.append('celeryd = celery.bin.celeryd:main')
  113. # bundles: Only relevant for Celery developers.
  114. entrypoints["bundle.bundles"] = ["celery = celery.contrib.bundles:bundles"]
  115. # -*- %%% -*-
  116. setup(
  117. name="celery",
  118. version=distmeta.__version__,
  119. description=distmeta.__doc__,
  120. author=distmeta.__author__,
  121. author_email=distmeta.__contact__,
  122. url=distmeta.__homepage__,
  123. platforms=["any"],
  124. license="BSD",
  125. packages=find_packages(exclude=['ez_setup', 'tests', 'tests.*']),
  126. zip_safe=False,
  127. install_requires=install_requires,
  128. tests_require=tests_require,
  129. test_suite="nose.collector",
  130. cmdclass={"quicktest": quicktest},
  131. classifiers=classifiers,
  132. entry_points=entrypoints,
  133. long_description=long_description,
  134. **extra)