setup.py 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. import codecs
  4. import sys
  5. import os
  6. import platform
  7. try:
  8. from setuptools import setup, find_packages, Command
  9. except ImportError:
  10. from ez_setup import use_setuptools
  11. use_setuptools()
  12. from setuptools import setup, find_packages, Command
  13. import celery
  14. class RunTests(Command):
  15. description = "Run the django test suite from the testproj dir."
  16. user_options = []
  17. def initialize_options(self):
  18. pass
  19. def finalize_options(self):
  20. pass
  21. def run(self):
  22. this_dir = os.getcwd()
  23. testproj_dir = os.path.join(this_dir, "testproj")
  24. os.chdir(testproj_dir)
  25. sys.path.append(testproj_dir)
  26. from django.core.management import execute_manager
  27. os.environ["DJANGO_SETTINGS_MODULE"] = os.environ.get(
  28. "DJANGO_SETTINGS_MODULE", "settings")
  29. settings_file = os.environ["DJANGO_SETTINGS_MODULE"]
  30. settings_mod = __import__(settings_file, {}, {}, [''])
  31. execute_manager(settings_mod, argv=[
  32. __file__, "test"])
  33. os.chdir(this_dir)
  34. install_requires = ["django-unittest-depth",
  35. "anyjson",
  36. "carrot>=0.6.0"]
  37. # python-daemon doesn't run on windows, so check current platform
  38. if platform.system() == "Windows":
  39. print("""
  40. ***WARNING***
  41. I see you are using windows. You will not be able to run celery
  42. in daemon mode with the --detach parameter.""")
  43. else:
  44. install_requires.append("python-daemon>=1.4.8")
  45. py_version_info = sys.version_info
  46. py_major_version = py_version_info[0]
  47. py_minor_version = py_version_info[1]
  48. if (py_major_version == 2 and py_minor_version <=5) or py_major_version < 2:
  49. install_requires.append("multiprocessing")
  50. if os.path.exists("README.rst"):
  51. long_description = codecs.open("README.rst", "r", "utf-8").read()
  52. else:
  53. long_description = "See http://pypi.python.org/pypi/celery"
  54. setup(
  55. name='celery',
  56. version=celery.__version__,
  57. description=celery.__doc__,
  58. author=celery.__author__,
  59. author_email=celery.__contact__,
  60. url=celery.__homepage__,
  61. platforms=["any"],
  62. license="BSD",
  63. packages=find_packages(exclude=['ez_setup']),
  64. scripts=["bin/celeryd", "bin/celeryinit", "bin/celerybeat"],
  65. zip_safe=False,
  66. install_requires=install_requires,
  67. extra_requires={
  68. "Tyrant": ["pytyrant"],
  69. },
  70. cmdclass = {"test": RunTests},
  71. classifiers=[
  72. "Development Status :: 5 - Production/Stable",
  73. "Framework :: Django",
  74. "Operating System :: OS Independent",
  75. "Programming Language :: Python",
  76. "Environment :: No Input/Output (Daemon)",
  77. "Intended Audience :: Developers",
  78. "License :: OSI Approved :: BSD License",
  79. "Operating System :: POSIX",
  80. "Topic :: Communications",
  81. "Topic :: System :: Distributed Computing",
  82. "Topic :: Software Development :: Libraries :: Python Modules",
  83. ],
  84. long_description=long_description,
  85. )