setup.py 3.1 KB

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