setup.py 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. import os
  4. import sys
  5. import codecs
  6. import platform
  7. try:
  8. from setuptools import setup, find_packages, Command
  9. from setuptools.command.test import test as TestCommand
  10. except ImportError:
  11. from ez_setup import use_setuptools
  12. use_setuptools()
  13. from setuptools import setup, find_packages, Command
  14. from setuptools.command.test import test as TestCommand
  15. import celery as distmeta
  16. class RunTests(TestCommand):
  17. env = dict(CELERY_LOADER="default",
  18. CELERY_CONFIG_MODULE="tests.celeryconfig",
  19. CELERYINIT=1)
  20. extra_env = {}
  21. def run(self, *args, **kwargs):
  22. for env_name, env_value in dict(self.env, **self.extra_env).items():
  23. os.environ[env_name] = str(env_value)
  24. TestCommand.run(self, *args, **kwargs)
  25. class QuickRunTests(RunTests):
  26. extra_env = dict(SKIP_RLIMITS=1, QUICKTEST=1)
  27. install_requires = []
  28. try:
  29. import importlib
  30. except ImportError:
  31. install_requires.append("importlib")
  32. install_requires.extend([
  33. "python-dateutil",
  34. "mailer",
  35. "sqlalchemy",
  36. "anyjson",
  37. "carrot>=0.10.4",
  38. "billiard>=0.3.0",
  39. "pyparsing"])
  40. py_version = sys.version_info
  41. if sys.version_info < (2, 6):
  42. install_requires.append("multiprocessing==2.6.2.1")
  43. if sys.version_info < (2, 5):
  44. install_requires.append("uuid")
  45. if os.path.exists("README.rst"):
  46. long_description = codecs.open("README.rst", "r", "utf-8").read()
  47. else:
  48. long_description = "See http://pypi.python.org/pypi/celery"
  49. setup(
  50. name='celery',
  51. version=distmeta.__version__,
  52. description=distmeta.__doc__,
  53. author=distmeta.__author__,
  54. author_email=distmeta.__contact__,
  55. url=distmeta.__homepage__,
  56. platforms=["any"],
  57. license="BSD",
  58. packages=find_packages(exclude=['ez_setup', 'tests', 'tests.*']),
  59. scripts=["bin/celeryd", "bin/celerybeat",
  60. "bin/camqadm", "bin/celeryd-multi",
  61. "bin/celeryev"],
  62. zip_safe=False,
  63. setup_requires=["nose", "nose-cover3", "unittest2>=0.4.0", "simplejson"],
  64. install_requires=install_requires,
  65. cmdclass = {"test": RunTests, "quicktest": QuickRunTests},
  66. test_suite="nose.collector",
  67. classifiers=[
  68. "Development Status :: 5 - Production/Stable",
  69. "Operating System :: OS Independent",
  70. "Programming Language :: Python",
  71. "Environment :: No Input/Output (Daemon)",
  72. "Intended Audience :: Developers",
  73. "License :: OSI Approved :: BSD License",
  74. "Operating System :: POSIX",
  75. "Topic :: Communications",
  76. "Topic :: System :: Distributed Computing",
  77. "Topic :: Software Development :: Libraries :: Python Modules",
  78. ],
  79. entry_points={
  80. 'console_scripts': [
  81. 'celeryd = celery.bin.celeryd:main',
  82. 'celeryinit = celery.bin.celeryinit:main',
  83. 'celerybeat = celery.bin.celerybeat:main',
  84. 'camqadm = celery.bin.camqadm:main',
  85. 'celeryev = celery.bin.celeryev:main',
  86. 'celeryd-multi = celery.bin.celeryd_multi:main',
  87. ],
  88. },
  89. long_description=long_description,
  90. )