generate.py 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. import os
  2. import sys
  3. sys.path.insert(0, os.path.abspath(
  4. os.path.join(__file__, os.pardir, os.pardir)))
  5. from celery import VERSION
  6. from bundle import Bundle
  7. series = "{}.{}".format(*VERSION[:2])
  8. next_major = VERSION[0] + 1
  9. base_fmt = "{base}>={series},<{next_major}"
  10. defaults = {"version": series,
  11. "author": "Celery Project",
  12. "author_email": "bundles@celeryproject.org",
  13. "url": "http://celeryproject.org",
  14. "license": "BSD"}
  15. def basereq(base):
  16. return base_fmt.format(base=base, series=series, next_major=next_major)
  17. def _reqs(base, *reqs):
  18. return [basereq(base)] + list(reqs)
  19. def celery_with(*reqs):
  20. return _reqs("celery", *reqs)
  21. def djcelery_with(*reqs):
  22. return _reqs("django-celery", *reqs)
  23. bundles = [
  24. Bundle("celery-with-redis",
  25. "Bundle that installs the dependencies for Celery and Redis",
  26. requires=celery_with("redis>=2.4.4"), **defaults),
  27. Bundle("celery-with-mongodb",
  28. "Bundle that installs the dependencies for Celery and MongoDB",
  29. requires=celery_with("pymongo"), **defaults),
  30. Bundle("django-celery-with-redis",
  31. "Bundle that installs the dependencies for Django-Celery and Redis",
  32. requires=djcelery_with("redis>=2.4.4"), **defaults),
  33. Bundle("django-celery-with-mongodb",
  34. "Bundle that installs the dependencies for Django-Celery and MongoDB",
  35. requires=djcelery_with("redis>=2.4.4"), **defaults),
  36. Bundle("bundle-celery",
  37. "Bundle that installs Celery related modules",
  38. requires=celery_with("setproctitle", "celerymon", "cyme",
  39. "kombu-sqlalchemy", "django-kombu",
  40. basereq("django-celery"),
  41. basereq("Flask-Celery")), **defaults),
  42. ]
  43. def main():
  44. for bundle in bundles:
  45. print("* Updating %s (%s)" % (bundle.name.ljust(30), bundle.version))
  46. bundle.register()
  47. if __name__ == "__main__":
  48. main()