contributing.rst 27 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013
  1. .. _contributing:
  2. ==============
  3. Contributing
  4. ==============
  5. .. contents::
  6. :local:
  7. .. _community-code-of-conduct:
  8. Community Code of Conduct
  9. =========================
  10. The goal is to maintain a diverse community that is pleasant for everyone.
  11. That is why we would greatly appreciate it if everyone contributing to and
  12. interacting with the community also followed this Code of Conduct.
  13. The Code of Conduct covers our behavior as members of the community,
  14. in any forum, mailing list, wiki, website, Internet relay chat (IRC), public
  15. meeting or private correspondence.
  16. The Code of Conduct is heavily based on the `Ubuntu Code of Conduct`_, and
  17. the `Pylons Code of Conduct`_.
  18. .. _`Ubuntu Code of Conduct`: http://www.ubuntu.com/community/conduct
  19. .. _`Pylons Code of Conduct`: http://docs.pylonshq.com/community/conduct.html
  20. Be considerate.
  21. ---------------
  22. Your work will be used by other people, and you in turn will depend on the
  23. work of others. Any decision you take will affect users and colleagues, and
  24. we expect you to take those consequences into account when making decisions.
  25. Even if it's not obvious at the time, our contributions to Ubuntu will impact
  26. the work of others. For example, changes to code, infrastructure, policy,
  27. documentation and translations during a release may negatively impact
  28. others work.
  29. Be respectful.
  30. --------------
  31. The Celery community and its members treat one another with respect. Everyone
  32. can make a valuable contribution to Celery. We may not always agree, but
  33. disagreement is no excuse for poor behavior and poor manners. We might all
  34. experience some frustration now and then, but we cannot allow that frustration
  35. to turn into a personal attack. It's important to remember that a community
  36. where people feel uncomfortable or threatened is not a productive one. We
  37. expect members of the Celery community to be respectful when dealing with
  38. other contributors as well as with people outside the Celery project and with
  39. users of Celery.
  40. Be collaborative.
  41. -----------------
  42. Collaboration is central to Celery and to the larger free software community.
  43. We should always be open to collaboration. Your work should be done
  44. transparently and patches from Celery should be given back to the community
  45. when they are made, not just when the distribution releases. If you wish
  46. to work on new code for existing upstream projects, at least keep those
  47. projects informed of your ideas and progress. It many not be possible to
  48. get consensus from upstream, or even from your colleagues about the correct
  49. implementation for an idea, so don't feel obliged to have that agreement
  50. before you begin, but at least keep the outside world informed of your work,
  51. and publish your work in a way that allows outsiders to test, discuss and
  52. contribute to your efforts.
  53. When you disagree, consult others.
  54. ----------------------------------
  55. Disagreements, both political and technical, happen all the time and
  56. the Celery community is no exception. It is important that we resolve
  57. disagreements and differing views constructively and with the help of the
  58. community and community process. If you really want to go a different
  59. way, then we encourage you to make a derivative distribution or alternate
  60. set of packages that still build on the work we've done to utilize as common
  61. of a core as possible.
  62. When you are unsure, ask for help.
  63. ----------------------------------
  64. Nobody knows everything, and nobody is expected to be perfect. Asking
  65. questions avoids many problems down the road, and so questions are
  66. encouraged. Those who are asked questions should be responsive and helpful.
  67. However, when asking a question, care must be taken to do so in an appropriate
  68. forum.
  69. Step down considerately.
  70. ------------------------
  71. Developers on every project come and go and Celery is no different. When you
  72. leave or disengage from the project, in whole or in part, we ask that you do
  73. so in a way that minimizes disruption to the project. This means you should
  74. tell people you are leaving and take the proper steps to ensure that others
  75. can pick up where you leave off.
  76. .. _reporting-bugs:
  77. Reporting Bugs
  78. ==============
  79. .. _vulnsec:
  80. Security
  81. --------
  82. You must never report security related issues, vulnerabilities or bugs
  83. including senstive information to the bug tracker, or elsewhere in public.
  84. Instead sensitive bugs must be sent by email to security@celeryproject.org.
  85. If you'd like to submit the information encrypted our PGP key is::
  86. -----BEGIN PGP PUBLIC KEY BLOCK-----
  87. Version: GnuPG v1.4.15 (Darwin)
  88. mQENBFJpWDkBCADFIc9/Fpgse4owLNvsTC7GYfnJL19XO0hnL99sPx+DPbfr+cSE
  89. 9wiU+Wp2TfUX7pCLEGrODiEP6ZCZbgtiPgId+JYvMxpP6GXbjiIlHRw1EQNH8RlX
  90. cVxy3rQfVv8PGGiJuyBBjxzvETHW25htVAZ5TI1+CkxmuyyEYqgZN2fNd0wEU19D
  91. +c10G1gSECbCQTCbacLSzdpngAt1Gkrc96r7wGHBBSvDaGDD2pFSkVuTLMbIRrVp
  92. lnKOPMsUijiip2EMr2DvfuXiUIUvaqInTPNWkDynLoh69ib5xC19CSVLONjkKBsr
  93. Pe+qAY29liBatatpXsydY7GIUzyBT3MzgMJlABEBAAG0MUNlbGVyeSBTZWN1cml0
  94. eSBUZWFtIDxzZWN1cml0eUBjZWxlcnlwcm9qZWN0Lm9yZz6JATgEEwECACIFAlJp
  95. WDkCGwMGCwkIBwMCBhUIAgkKCwQWAgMBAh4BAheAAAoJEOArFOUDCicIw1IH/26f
  96. CViDC7/P13jr+srRdjAsWvQztia9HmTlY8cUnbmkR9w6b6j3F2ayw8VhkyFWgYEJ
  97. wtPBv8mHKADiVSFARS+0yGsfCkia5wDSQuIv6XqRlIrXUyqJbmF4NUFTyCZYoh+C
  98. ZiQpN9xGhFPr5QDlMx2izWg1rvWlG1jY2Es1v/xED3AeCOB1eUGvRe/uJHKjGv7J
  99. rj0pFcptZX+WDF22AN235WYwgJM6TrNfSu8sv8vNAQOVnsKcgsqhuwomSGsOfMQj
  100. LFzIn95MKBBU1G5wOs7JtwiV9jefGqJGBO2FAvOVbvPdK/saSnB+7K36dQcIHqms
  101. 5hU4Xj0RIJiod5idlRC5AQ0EUmlYOQEIAJs8OwHMkrdcvy9kk2HBVbdqhgAREMKy
  102. gmphDp7prRL9FqSY/dKpCbG0u82zyJypdb7QiaQ5pfPzPpQcd2dIcohkkh7G3E+e
  103. hS2L9AXHpwR26/PzMBXyr2iNnNc4vTksHvGVDxzFnRpka6vbI/hrrZmYNYh9EAiv
  104. uhE54b3/XhXwFgHjZXb9i8hgJ3nsO0pRwvUAM1bRGMbvf8e9F+kqgV0yWYNnh6QL
  105. 4Vpl1+epqp2RKPHyNQftbQyrAHXT9kQF9pPlx013MKYaFTADscuAp4T3dy7xmiwS
  106. crqMbZLzfrxfFOsNxTUGE5vmJCcm+mybAtRo4aV6ACohAO9NevMx8pUAEQEAAYkB
  107. HwQYAQIACQUCUmlYOQIbDAAKCRDgKxTlAwonCNFbB/9esir/f7TufE+isNqErzR/
  108. aZKZo2WzZR9c75kbqo6J6DYuUHe6xI0OZ2qZ60iABDEZAiNXGulysFLCiPdatQ8x
  109. 8zt3DF9BMkEck54ZvAjpNSern6zfZb1jPYWZq3TKxlTs/GuCgBAuV4i5vDTZ7xK/
  110. aF+OFY5zN7ciZHkqLgMiTZ+RhqRcK6FhVBP/Y7d9NlBOcDBTxxE1ZO1ute6n7guJ
  111. ciw4hfoRk8qNN19szZuq3UU64zpkM2sBsIFM9tGF2FADRxiOaOWZHmIyVZriPFqW
  112. RUwjSjs7jBVNq0Vy4fCu/5+e+XLOUBOoqtM5W7ELt0t1w9tXebtPEetV86in8fU2
  113. =0chn
  114. -----END PGP PUBLIC KEY BLOCK-----
  115. Other bugs
  116. ----------
  117. Bugs can always be described to the :ref:`mailing-list`, but the best
  118. way to report an issue and to ensure a timely response is to use the
  119. issue tracker.
  120. 1) Create a GitHub account.
  121. You need to `create a GitHub account`_ to be able to create new issues
  122. and participate in the discussion.
  123. .. _`create a GitHub account`: https://github.com/signup/free
  124. 2) Determine if your bug is really a bug.
  125. You should not file a bug if you are requesting support. For that you can use
  126. the :ref:`mailing-list`, or :ref:`irc-channel`.
  127. 3) Make sure your bug hasn't already been reported.
  128. Search through the appropriate Issue tracker. If a bug like yours was found,
  129. check if you have new information that could be reported to help
  130. the developers fix the bug.
  131. 4) Collect information about the bug.
  132. To have the best chance of having a bug fixed, we need to be able to easily
  133. reproduce the conditions that caused it. Most of the time this information
  134. will be from a Python traceback message, though some bugs might be in design,
  135. spelling or other errors on the website/docs/code.
  136. If the error is from a Python traceback, include it in the bug report.
  137. We also need to know what platform you're running (Windows, OSX, Linux, etc),
  138. the version of your Python interpreter, and the version of Celery, and related
  139. packages that you were running when the bug occurred.
  140. 5) Submit the bug.
  141. By default `GitHub`_ will email you to let you know when new comments have
  142. been made on your bug. In the event you've turned this feature off, you
  143. should check back on occasion to ensure you don't miss any questions a
  144. developer trying to fix the bug might ask.
  145. .. _`GitHub`: http://github.com
  146. .. _issue-trackers:
  147. Issue Trackers
  148. --------------
  149. Bugs for a package in the Celery ecosystem should be reported to the relevant
  150. issue tracker.
  151. * Celery: http://github.com/celery/celery/issues/
  152. * Django-Celery: http://github.com/celery/django-celery/issues
  153. * Celery-Pylons: http://bitbucket.org/ianschenck/celery-pylons/issues
  154. * Kombu: http://github.com/celery/kombu/issues
  155. If you are unsure of the origin of the bug you can ask the
  156. :ref:`mailing-list`, or just use the Celery issue tracker.
  157. Contributors guide to the codebase
  158. ==================================
  159. There's a seperate section for internal details,
  160. including details about the codebase and a style guide.
  161. Read :ref:`internals-guide` for more!
  162. .. _versions:
  163. Versions
  164. ========
  165. Version numbers consists of a major version, minor version and a release number.
  166. Since version 2.1.0 we use the versioning semantics described by
  167. semver: http://semver.org.
  168. Stable releases are published at PyPI
  169. while development releases are only available in the GitHub git repository as tags.
  170. All version tags starts with “v”, so version 0.8.0 is the tag v0.8.0.
  171. .. _git-branches:
  172. Branches
  173. ========
  174. Current active version branches:
  175. * master (http://github.com/celery/celery/tree/master)
  176. * 3.0 (http://github.com/celery/celery/tree/3.0)
  177. You can see the state of any branch by looking at the Changelog:
  178. https://github.com/celery/celery/blob/master/Changelog
  179. If the branch is in active development the topmost version info should
  180. contain metadata like::
  181. 2.4.0
  182. ======
  183. :release-date: TBA
  184. :status: DEVELOPMENT
  185. :branch: master
  186. The ``status`` field can be one of:
  187. * ``PLANNING``
  188. The branch is currently experimental and in the planning stage.
  189. * ``DEVELOPMENT``
  190. The branch is in active development, but the test suite should
  191. be passing and the product should be working and possible for users to test.
  192. * ``FROZEN``
  193. The branch is frozen, and no more features will be accepted.
  194. When a branch is frozen the focus is on testing the version as much
  195. as possible before it is released.
  196. ``master`` branch
  197. -----------------
  198. The master branch is where development of the next version happens.
  199. Maintenance branches
  200. --------------------
  201. Maintenance branches are named after the version, e.g. the maintenance branch
  202. for the 2.2.x series is named ``2.2``. Previously these were named
  203. ``releaseXX-maint``.
  204. The versions we currently maintain is:
  205. * 2.3
  206. This is the current series.
  207. * 2.2
  208. This is the previous series, and the last version to support Python 2.4.
  209. * 2.1
  210. This is the last version to use the ``carrot`` AMQP framework.
  211. Recent versions use ``kombu``.
  212. Archived branches
  213. -----------------
  214. Archived branches are kept for preserving history only,
  215. and theoretically someone could provide patches for these if they depend
  216. on a series that is no longer officially supported.
  217. An archived version is named ``X.Y-archived``.
  218. Our currently archived branches are:
  219. * 2.1-archived
  220. * 2.0-archived
  221. * 1.0-archived
  222. Feature branches
  223. ----------------
  224. Major new features are worked on in dedicated branches.
  225. There is no strict naming requirement for these branches.
  226. Feature branches are removed once they have been merged into a release branch.
  227. Tags
  228. ====
  229. Tags are used exclusively for tagging releases. A release tag is
  230. named with the format ``vX.Y.Z``, e.g. ``v2.3.1``.
  231. Experimental releases contain an additional identifier ``vX.Y.Z-id``, e.g.
  232. ``v3.0.0-rc1``. Experimental tags may be removed after the official release.
  233. .. _contributing-changes:
  234. Working on Features & Patches
  235. =============================
  236. .. note::
  237. Contributing to Celery should be as simple as possible,
  238. so none of these steps should be considered mandatory.
  239. You can even send in patches by email if that is your preferred
  240. work method. We won't like you any less, any contribution you make
  241. is always appreciated!
  242. However following these steps may make maintainers life easier,
  243. and may mean that your changes will be accepted sooner.
  244. Forking and setting up the repository
  245. -------------------------------------
  246. First you need to fork the Celery repository, a good introduction to this
  247. is in the Github Guide: `Fork a Repo`_.
  248. After you have cloned the repository you should checkout your copy
  249. to a directory on your machine:
  250. .. code-block:: bash
  251. $ git clone git@github.com:username/celery.git
  252. When the repository is cloned enter the directory to set up easy access
  253. to upstream changes:
  254. .. code-block:: bash
  255. $ cd celery
  256. .. code-block:: bash
  257. $ git remote add upstream git://github.com/celery/celery.git
  258. .. code-block:: bash
  259. $ git fetch upstream
  260. If you need to pull in new changes from upstream you should
  261. always use the :option:`--rebase` option to ``git pull``:
  262. .. code-block:: bash
  263. git pull --rebase upstream master
  264. With this option you don't clutter the history with merging
  265. commit notes. See `Rebasing merge commits in git`_.
  266. If you want to learn more about rebasing see the `Rebase`_
  267. section in the Github guides.
  268. If you need to work on a different branch than ``master`` you can
  269. fetch and checkout a remote branch like this::
  270. git checkout --track -b 3.0-devel origin/3.0-devel
  271. For a list of branches see :ref:`git-branches`.
  272. .. _`Fork a Repo`: http://help.github.com/fork-a-repo/
  273. .. _`Rebasing merge commits in git`:
  274. http://notes.envato.com/developers/rebasing-merge-commits-in-git/
  275. .. _`Rebase`: http://help.github.com/rebase/
  276. .. _contributing-testing:
  277. Running the unit test suite
  278. ---------------------------
  279. To run the Celery test suite you need to install a few dependencies.
  280. A complete list of the dependencies needed are located in
  281. :file:`requirements/test.txt`.
  282. Installing the test requirements:
  283. .. code-block:: bash
  284. $ pip install -U -r requirements/test.txt
  285. When installation of dependencies is complete you can execute
  286. the test suite by calling ``nosetests``:
  287. .. code-block:: bash
  288. $ nosetests
  289. Some useful options to :program:`nosetests` are:
  290. * :option:`-x`
  291. Stop running the tests at the first test that fails.
  292. * :option:`-s`
  293. Don't capture output
  294. * :option:`--nologcapture`
  295. Don't capture log output.
  296. * :option:`-v`
  297. Run with verbose output.
  298. If you want to run the tests for a single test file only
  299. you can do so like this:
  300. .. code-block:: bash
  301. $ nosetests celery.tests.test_worker.test_worker_job
  302. .. _contributing-pull-requests:
  303. Creating pull requests
  304. ----------------------
  305. When your feature/bugfix is complete you may want to submit
  306. a pull requests so that it can be reviewed by the maintainers.
  307. Creating pull requests is easy, and also let you track the progress
  308. of your contribution. Read the `Pull Requests`_ section in the Github
  309. Guide to learn how this is done.
  310. You can also attach pull requests to existing issues by following
  311. the steps outlined here: http://bit.ly/koJoso
  312. .. _`Pull Requests`: http://help.github.com/send-pull-requests/
  313. .. _contributing-coverage:
  314. Calculating test coverage
  315. ~~~~~~~~~~~~~~~~~~~~~~~~~
  316. Code coverage in HTML:
  317. .. code-block:: bash
  318. $ nosetests --with-coverage3 --cover3-html
  319. The coverage output will then be located at
  320. :file:`celery/tests/cover/index.html`.
  321. Code coverage in XML (Cobertura-style):
  322. .. code-block:: bash
  323. $ nosetests --with-coverage3 --cover3-xml --cover3-xml-file=coverage.xml
  324. The coverage XML output will then be located at :file:`coverage.xml`
  325. .. _contributing-tox:
  326. Running the tests on all supported Python versions
  327. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  328. There is a ``tox`` configuration file in the top directory of the
  329. distribution.
  330. To run the tests for all supported Python versions simply execute:
  331. .. code-block:: bash
  332. $ tox
  333. If you only want to test specific Python versions use the :option:`-e`
  334. option:
  335. .. code-block:: bash
  336. $ tox -e py26
  337. Building the documentation
  338. --------------------------
  339. To build the documentation you need to install the dependencies
  340. listed in :file:`requirements/docs.txt`:
  341. .. code-block:: bash
  342. $ pip install -U -r requirements/docs.txt
  343. After these dependencies are installed you should be able to
  344. build the docs by running:
  345. .. code-block:: bash
  346. $ cd docs
  347. $ rm -rf .build
  348. $ make html
  349. Make sure there are no errors or warnings in the build output.
  350. After building succeeds the documentation is available at :file:`.build/html`.
  351. .. _contributing-verify:
  352. Verifying your contribution
  353. ---------------------------
  354. To use these tools you need to install a few dependencies. These dependencies
  355. can be found in :file:`requirements/pkgutils.txt`.
  356. Installing the dependencies:
  357. .. code-block:: bash
  358. $ pip install -U -r requirements/pkgutils.txt
  359. pyflakes & PEP8
  360. ~~~~~~~~~~~~~~~
  361. To ensure that your changes conform to PEP8 and to run pyflakes
  362. execute:
  363. .. code-block:: bash
  364. $ paver flake8
  365. To not return a negative exit code when this command fails use the
  366. :option:`-E` option, this can be convenient while developing:
  367. .. code-block:: bash
  368. $ paver flake8 -E
  369. API reference
  370. ~~~~~~~~~~~~~
  371. To make sure that all modules have a corresponding section in the API
  372. reference please execute:
  373. .. code-block:: bash
  374. $ paver autodoc
  375. $ paver verifyindex
  376. If files are missing you can add them by copying an existing reference file.
  377. If the module is internal it should be part of the internal reference
  378. located in :file:`docs/internals/reference/`. If the module is public
  379. it should be located in :file:`docs/reference/`.
  380. For example if reference is missing for the module ``celery.worker.awesome``
  381. and this module is considered part of the public API, use the following steps:
  382. .. code-block:: bash
  383. $ cd docs/reference/
  384. $ cp celery.schedules.rst celery.worker.awesome.rst
  385. .. code-block:: bash
  386. $ vim celery.worker.awesome.rst
  387. # change every occurance of ``celery.schedules`` to
  388. # ``celery.worker.awesome``
  389. .. code-block:: bash
  390. $ vim index.rst
  391. # Add ``celery.worker.awesome`` to the index.
  392. .. code-block:: bash
  393. # Add the file to git
  394. $ git add celery.worker.awesome.rst
  395. $ git add index.rst
  396. $ git commit celery.worker.awesome.rst index.rst \
  397. -m "Adds reference for celery.worker.awesome"
  398. .. _coding-style:
  399. Coding Style
  400. ============
  401. You should probably be able to pick up the coding style
  402. from surrounding code, but it is a good idea to be aware of the
  403. following conventions.
  404. * All Python code must follow the `PEP-8`_ guidelines.
  405. `pep8.py`_ is an utility you can use to verify that your code
  406. is following the conventions.
  407. .. _`PEP-8`: http://www.python.org/dev/peps/pep-0008/
  408. .. _`pep8.py`: http://pypi.python.org/pypi/pep8
  409. * Docstrings must follow the `PEP-257`_ conventions, and use the following
  410. style.
  411. Do this:
  412. .. code-block:: python
  413. def method(self, arg):
  414. """Short description.
  415. More details.
  416. """
  417. or:
  418. .. code-block:: python
  419. def method(self, arg):
  420. """Short description."""
  421. but not this:
  422. .. code-block:: python
  423. def method(self, arg):
  424. """
  425. Short description.
  426. """
  427. .. _`PEP-257`: http://www.python.org/dev/peps/pep-0257/
  428. * Lines should not exceed 78 columns.
  429. You can enforce this in :program:`vim` by setting the ``textwidth`` option:
  430. .. code-block:: vim
  431. set textwidth=78
  432. If adhering to this limit makes the code less readable, you have one more
  433. character to go on, which means 78 is a soft limit, and 79 is the hard
  434. limit :)
  435. * Import order
  436. * Python standard library (`import xxx`)
  437. * Python standard library ('from xxx import`)
  438. * Third party packages.
  439. * Other modules from the current package.
  440. or in case of code using Django:
  441. * Python standard library (`import xxx`)
  442. * Python standard library ('from xxx import`)
  443. * Third party packages.
  444. * Django packages.
  445. * Other modules from the current package.
  446. Within these sections the imports should be sorted by module name.
  447. Example:
  448. .. code-block:: python
  449. import threading
  450. import time
  451. from collections import deque
  452. from Queue import Queue, Empty
  453. from .datastructures import TokenBucket
  454. from .utils import timeutils
  455. from .utils.compat import all, izip_longest, chain_from_iterable
  456. * Wildcard imports must not be used (`from xxx import *`).
  457. * For distributions where Python 2.5 is the oldest support version
  458. additional rules apply:
  459. * Absolute imports must be enabled at the top of every module::
  460. from __future__ import absolute_import
  461. * If the module uses the with statement and must be compatible
  462. with Python 2.5 (celery is not) then it must also enable that::
  463. from __future__ import with_statement
  464. * Every future import must be on its own line, as older Python 2.5
  465. releases did not support importing multiple features on the
  466. same future import line::
  467. # Good
  468. from __future__ import absolute_import
  469. from __future__ import with_statement
  470. # Bad
  471. from __future__ import absolute_import, with_statement
  472. (Note that this rule does not apply if the package does not include
  473. support for Python 2.5)
  474. * Note that we use "new-style` relative imports when the distribution
  475. does not support Python versions below 2.5
  476. .. code-block:: python
  477. from . import submodule
  478. .. _feature-with-extras:
  479. Contributing features requiring additional libraries
  480. ====================================================
  481. Some features like a new result backend may require additional libraries
  482. that the user must install.
  483. We use setuptools `extra_requires` for this, and all new optional features
  484. that require 3rd party libraries must be added.
  485. 1) Add a new requirements file in `requirements/extras`
  486. E.g. for the Cassandra backend this is
  487. :file:`requirements/extras/cassandra.txt`, and the file looks like this::
  488. pycassa
  489. These are pip requirement files so you can have version specifiers and
  490. multiple packages are separated by newline. A more complex example could
  491. be:
  492. # pycassa 2.0 breaks Foo
  493. pycassa>=1.0,<2.0
  494. thrift
  495. 2) Modify ``setup.py``
  496. After the requirements file is added you need to add it as an option
  497. to ``setup.py`` in the ``extras_require`` section::
  498. extra['extras_require'] = {
  499. # ...
  500. 'cassandra': extras('cassandra.txt'),
  501. }
  502. 3) Document the new feature in ``docs/includes/installation.txt``
  503. You must add your feature to the list in the :ref:`bundles` section
  504. of :file:`docs/includes/installation.txt`.
  505. After you've made changes to this file you need to render
  506. the distro :file:`README` file:
  507. .. code-block:: bash
  508. $ pip install -U requirements/pkgutils.txt
  509. $ paver readme
  510. That's all that needs to be done, but remember that if your feature
  511. adds additional configuration options then these needs to be documented
  512. in ``docs/configuration.rst``. Also all settings need to be added to the
  513. ``celery/app/defaults.py`` module.
  514. Result backends require a separate section in the ``docs/configuration.rst``
  515. file.
  516. .. _contact_information:
  517. Contacts
  518. ========
  519. This is a list of people that can be contacted for questions
  520. regarding the official git repositories, PyPI packages
  521. Read the Docs pages.
  522. If the issue is not an emergency then it is better
  523. to :ref:`report an issue <reporting-bugs>`.
  524. Committers
  525. ----------
  526. Ask Solem
  527. ~~~~~~~~~
  528. :github: https://github.com/ask
  529. :twitter: http://twitter.com/#!/asksol
  530. Mher Movsisyan
  531. ~~~~~~~~~~~~~~
  532. :github: https://github.com/mher
  533. :twitter: http://twitter.com/#!/movsm
  534. Steeve Morin
  535. ~~~~~~~~~~~~
  536. :github: https://github.com/steeve
  537. :twitter: http://twitter.com/#!/steeve
  538. Website
  539. -------
  540. The Celery Project website is run and maintained by
  541. Mauro Rocco
  542. ~~~~~~~~~~~
  543. :github: https://github.com/fireantology
  544. :twitter: https://twitter.com/#!/fireantology
  545. with design by:
  546. Jan Henrik Helmers
  547. ~~~~~~~~~~~~~~~~~~
  548. :web: http://www.helmersworks.com
  549. :twitter: http://twitter.com/#!/helmers
  550. .. _packages:
  551. Packages
  552. ========
  553. celery
  554. ------
  555. :git: https://github.com/celery/celery
  556. :CI: http://travis-ci.org/#!/celery/celery
  557. :PyPI: http://pypi.python.org/pypi/celery
  558. :docs: http://docs.celeryproject.org
  559. kombu
  560. -----
  561. Messaging framework.
  562. :git: https://github.com/celery/kombu
  563. :CI: http://travis-ci.org/#!/celery/kombu
  564. :PyPI: http://pypi.python.org/pypi/kombu
  565. :docs: http://kombu.readthedocs.org
  566. billiard
  567. --------
  568. Fork of multiprocessing containing improvements
  569. that will eventually be merged into the Python stdlib.
  570. :git: https://github.com/celery/billiard
  571. :PyPI: http://pypi.python.org/pypi/billiard
  572. librabbitmq
  573. -----------
  574. Very fast Python AMQP client written in C.
  575. :git: https://github.com/celery/librabbitmq
  576. :PyPI: http://pypi.python.org/pypi/librabbitmq
  577. celerymon
  578. ---------
  579. Celery monitor web-service.
  580. :git: https://github.com/celery/celerymon
  581. :PyPI: http://pypi.python.org/pypi/celerymon
  582. django-celery
  583. -------------
  584. Django <-> Celery Integration.
  585. :git: https://github.com/celery/django-celery
  586. :PyPI: http://pypi.python.org/pypi/django-celery
  587. :docs: http://docs.celeryproject.org/en/latest/django
  588. cl
  589. --
  590. Actor framework.
  591. :git: https://github.com/celery/cl
  592. :PyPI: http://pypi.python.org/pypi/cl
  593. cyme
  594. ----
  595. Distributed Celery Instance manager.
  596. :git: https://github.com/celery/cyme
  597. :PyPI: http://pypi.python.org/pypi/cyme
  598. :docs: http://cyme.readthedocs.org/
  599. Deprecated
  600. ----------
  601. - Flask-Celery
  602. :git: https://github.com/ask/Flask-Celery
  603. :PyPI: http://pypi.python.org/pypi/Flask-Celery
  604. - carrot
  605. :git: https://github.com/ask/carrot
  606. :PyPI: http://pypi.python.org/pypi/carrot
  607. - ghettoq
  608. :git: https://github.com/ask/ghettoq
  609. :PyPI: http://pypi.python.org/pypi/ghettoq
  610. - kombu-sqlalchemy
  611. :git: https://github.com/ask/kombu-sqlalchemy
  612. :PyPI: http://pypi.python.org/pypi/kombu-sqlalchemy
  613. - django-kombu
  614. :git: https://github.com/ask/django-kombu
  615. :PyPI: http://pypi.python.org/pypi/django-kombu
  616. - pylibrabbitmq
  617. Old name for :mod:`librabbitmq`.
  618. :git: :const:`None`
  619. :PyPI: http://pypi.python.org/pypi/pylibrabbitmq
  620. .. _release-procedure:
  621. Release Procedure
  622. =================
  623. Updating the version number
  624. ---------------------------
  625. The version number must be updated two places:
  626. * :file:`celery/__init__.py`
  627. * :file:`docs/include/introduction.txt`
  628. After you have changed these files you must render
  629. the :file:`README` files. There is a script to convert sphinx syntax
  630. to generic reStructured Text syntax, and the paver task `readme`
  631. does this for you:
  632. .. code-block:: bash
  633. $ paver readme
  634. Now commit the changes:
  635. .. code-block:: bash
  636. $ git commit -a -m "Bumps version to X.Y.Z"
  637. and make a new version tag:
  638. .. code-block:: bash
  639. $ git tag vX.Y.Z
  640. $ git push --tags
  641. Releasing
  642. ---------
  643. Commands to make a new public stable release::
  644. $ paver releaseok # checks pep8, autodoc index, runs tests and more
  645. $ paver removepyc # Remove .pyc files
  646. $ git clean -xdn # Check that there's no left-over files in the repo
  647. $ python setup.py sdist upload # Upload package to PyPI
  648. If this is a new release series then you also need to do the
  649. following:
  650. * Go to the Read The Docs management interface at:
  651. http://readthedocs.org/projects/celery/?fromdocs=celery
  652. * Enter "Edit project"
  653. Change default branch to the branch of this series, e.g. ``2.4``
  654. for series 2.4.
  655. * Also add the previous version under the "versions" tab.