contributing.rst 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246
  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 a Bug
  78. ===============
  79. Bugs can always be described to the :ref:`mailing-list`, but the best
  80. way to report an issue and to ensure a timely response is to use the
  81. issue tracker.
  82. 1) Create a GitHub account.
  83. You need to `create a GitHub account`_ to be able to create new issues
  84. and participate in the discussion.
  85. .. _`create a GitHub account`: https://github.com/signup/free
  86. 2) Determine if your bug is really a bug.
  87. You should not file a bug if you are requesting support. For that you can use
  88. the :ref:`mailing-list`, or :ref:`irc-channel`.
  89. 3) Make sure your bug hasn't already been reported.
  90. Search through the appropriate Issue tracker. If a bug like yours was found,
  91. check if you have new information that could be reported to help
  92. the developers fix the bug.
  93. 4) Collect information about the bug.
  94. To have the best chance of having a bug fixed, we need to be able to easily
  95. reproduce the conditions that caused it. Most of the time this information
  96. will be from a Python traceback message, though some bugs might be in design,
  97. spelling or other errors on the website/docs/code.
  98. If the error is from a Python traceback, include it in the bug report.
  99. We also need to know what platform you're running (Windows, OSX, Linux, etc),
  100. the version of your Python interpreter, and the version of Celery, and related
  101. packages that you were running when the bug occurred.
  102. 5) Submit the bug.
  103. By default `GitHub`_ will email you to let you know when new comments have
  104. been made on your bug. In the event you've turned this feature off, you
  105. should check back on occasion to ensure you don't miss any questions a
  106. developer trying to fix the bug might ask.
  107. .. _`GitHub`: http://github.com
  108. .. _issue-trackers:
  109. Issue Trackers
  110. --------------
  111. Bugs for a package in the Celery ecosystem should be reported to the relevant
  112. issue tracker.
  113. * Celery: http://github.com/ask/celery/issues/
  114. * Django-Celery: http://github.com/ask/django-celery/issues
  115. * Flask-Celery: http://github.com/ask/flask-celery/issues
  116. * Celery-Pylons: http://bitbucket.org/ianschenck/celery-pylons/issues
  117. * Kombu: http://github.com/ask/kombu/issues
  118. If you are unsure of the origin of the bug you can ask the
  119. :ref:`mailing-list`, or just use the Celery issue tracker.
  120. .. _coding-style:
  121. Coding Style
  122. ============
  123. You should probably be able to pick up the coding style
  124. from surrounding code, but it is a good idea to be aware of the
  125. following conventions.
  126. * All Python code must follow the `PEP-8`_ guidelines.
  127. `pep8.py`_ is an utility you can use to verify that your code
  128. is following the conventions.
  129. .. _`PEP-8`: http://www.python.org/dev/peps/pep-0008/
  130. .. _`pep8.py`: http://pypi.python.org/pypi/pep8
  131. * Docstrings must follow the `PEP-257`_ conventions, and use the following
  132. style.
  133. Do this:
  134. .. code-block:: python
  135. def method(self, arg):
  136. """Short description.
  137. More details.
  138. """
  139. or:
  140. .. code-block:: python
  141. def method(self, arg):
  142. """Short description."""
  143. but not this:
  144. .. code-block:: python
  145. def method(self, arg):
  146. """
  147. Short description.
  148. """
  149. .. _`PEP-257`: http://www.python.org/dev/peps/pep-0257/
  150. * Lines should not exceed 78 columns.
  151. * Import order
  152. * Python standard library (`import xxx`)
  153. * Python standard library ('from xxx import`)
  154. * Third party packages.
  155. * Other modules from the current package.
  156. or in case of code using Django:
  157. * Python standard library (`import xxx`)
  158. * Python standard library ('from xxx import`)
  159. * Third party packages.
  160. * Django packages.
  161. * Other modules from the current package.
  162. Within these sections imports should be sorted by name.
  163. Example:
  164. .. code-block:: python
  165. import threading
  166. import time
  167. from collections import deque
  168. from Queue import Queue, Empty
  169. from celery.datastructures import TokenBucket
  170. from celery.utils import timeutils
  171. from celery.utils.compat import all, izip_longest, chain_from_iterable
  172. * Wildcard imports must not be used (`from xxx import *`).