setup.py 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  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 as distmeta
  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 = [
  35. "django",
  36. "django-unittest-depth",
  37. "python-dateutil",
  38. "anyjson",
  39. "carrot>=0.8.0",
  40. "django-picklefield",
  41. "billiard>=0.2.0"]
  42. # python-daemon doesn't run on windows, so check current platform
  43. if platform.system() == "Windows":
  44. print("""
  45. ***WARNING***
  46. I see you are using windows. You will not be able to run celery
  47. in daemon mode with the --detach parameter.""")
  48. else:
  49. install_requires.append("python-daemon>=1.4.8")
  50. py_version_info = sys.version_info
  51. py_major_version = py_version_info[0]
  52. py_minor_version = py_version_info[1]
  53. if (py_major_version == 2 and py_minor_version <=5) or py_major_version < 2:
  54. install_requires.append("multiprocessing==2.6.2.1")
  55. if os.path.exists("README.rst"):
  56. long_description = codecs.open("README.rst", "r", "utf-8").read()
  57. else:
  58. long_description = "See http://pypi.python.org/pypi/celery"
  59. setup(
  60. name='celery',
  61. version=distmeta.__version__,
  62. description=distmeta.__doc__,
  63. author=distmeta.__author__,
  64. author_email=distmeta.__contact__,
  65. url=distmeta.__homepage__,
  66. platforms=["any"],
  67. license="BSD",
  68. packages=find_packages(exclude=['ez_setup']),
  69. scripts=["bin/celeryd", "bin/celeryinit", "bin/celerybeat"],
  70. zip_safe=False,
  71. install_requires=install_requires,
  72. extra_requires={
  73. "Tyrant": ["pytyrant"],
  74. },
  75. cmdclass = {"test": RunTests},
  76. classifiers=[
  77. "Development Status :: 5 - Production/Stable",
  78. "Framework :: Django",
  79. "Operating System :: OS Independent",
  80. "Programming Language :: Python",
  81. "Environment :: No Input/Output (Daemon)",
  82. "Intended Audience :: Developers",
  83. "License :: OSI Approved :: BSD License",
  84. "Operating System :: POSIX",
  85. "Topic :: Communications",
  86. "Topic :: System :: Distributed Computing",
  87. "Topic :: Software Development :: Libraries :: Python Modules",
  88. ],
  89. long_description=long_description,
  90. )