Skip to content
Myr

contributing.rst

This file

Path

docs/dev/contributing.rst

216 lines · 7.9 KiB

Last changed by

Merge pull request #5160 from OrangutanGaming/change-githubNate Prewittbefore adoptiond79024f

History of this file

Take it

The walk stopped after 200 commits: lines older than 0eb9a4c point at it.

stickersKenneth Reitzbefore adoption0eb9a4c

lines 1–15why, one step back
1.. _contributing:
23Contributor's Guide4===================56.. image:: https://farm5.staticflickr.com/4237/35550408335_7671fde302_k_d.jpg78If you're reading this, you're probably interested in contributing to Requests.9Thank you very much! Open source projects live-and-die based on the support10they receive from others, and the fact that you're even considering11contributing to the Requests project is *very* generous of you.1213This document lays out guidelines and advice for contributing to this project.14If you're thinking of contributing, please start by reading this document and15getting a feel for how contributing to this project works. If you have any

update maintainer contact infoNate Prewittbefore adoptiond2962f1

lines 16–17why, one step back
16questions, feel free to reach out to either `Ian Cordasco`_, `Cory Benfield`_,
17or `Nate Prewitt`_, the primary maintainers.

stickersKenneth Reitzbefore adoption0eb9a4c

lines 18–20why, one step back
18
19.. _Ian Cordasco: http://www.coglib.com/~icordasc/20.. _Cory Benfield: https://lukasa.co.uk/about

update maintainer contact infoNate Prewittbefore adoptiond2962f1

line 21why, one step back
21.. _Nate Prewitt: https://www.nateprewitt.com/

stickersKenneth Reitzbefore adoption0eb9a4c

lines 22–44why, one step back
22
23If you have non-technical feedback, philosophical ponderings, crazy ideas, or24other general thoughts about Requests or its position within the Python25ecosystem, the BDFL, `Kenneth Reitz`_, would love to hear from you.2627The guide is split into sections based on the type of contribution you're28thinking of making, with a section that covers general guidelines for all29contributors.3031.. _Kenneth Reitz: mailto:me@kennethreitz.org3233Be Cordial34----------3536 **Be cordial or be on your way**. *—Kenneth Reitz*3738Requests has one very important rule governing all forms of contribution,39including reporting bugs or requesting features. This golden rule is40"`be cordial or be on your way`_".4142**All contributions are welcome**, as long as43everyone involved is treated with respect.44

Merge branch 'master' of github.com:requests/requestsKenneth Reitzbefore adoptionfdcb717

line 45why, one step back
45.. _be cordial or be on your way: https://www.kennethreitz.org/essays/be-cordial-or-be-on-your-way

stickersKenneth Reitzbefore adoption0eb9a4c

lines 46–132why, one step back
46
47.. _early-feedback:4849Get Early Feedback50------------------5152If you are contributing, do not feel the need to sit on your contribution until53it is perfectly polished and complete. It helps everyone involved for you to54seek feedback as early as you possibly can. Submitting an early, unfinished55version of your contribution for feedback in no way prejudices your chances of56getting that contribution accepted, and can save you from putting a lot of work57into a contribution that is not suitable for the project.5859Contribution Suitability60------------------------6162Our project maintainers have the last word on whether or not a contribution is63suitable for Requests. All contributions will be considered carefully, but from64time to time, contributions will be rejected because they do not suit the65current goals or needs of the project.6667If your contribution is rejected, don't despair! As long as you followed these68guidelines, you will have a much better chance of getting your next69contribution accepted.707172Code Contributions73------------------7475Steps for Submitting Code76~~~~~~~~~~~~~~~~~~~~~~~~~7778When contributing code, you'll want to follow this checklist:79801. Fork the repository on GitHub.812. Run the tests to confirm they all pass on your system. If they don't, you'll82 need to investigate why they fail. If you're unable to diagnose this83 yourself, raise it as a bug report by following the guidelines in this84 document: :ref:`bug-reports`.853. Write tests that demonstrate your bug or feature. Ensure that they fail.864. Make your change.875. Run the entire test suite again, confirming that all tests pass *including88 the ones you just added*.896. Send a GitHub Pull Request to the main repository's ``master`` branch.90 GitHub Pull Requests are the expected method of code collaboration on this91 project.9293The following sub-sections go into more detail on some of the points above.9495Code Review96~~~~~~~~~~~9798Contributions will not be merged until they've been code reviewed. You should99implement any code review feedback unless you strongly object to it. In the100event that you object to the code review feedback, you should make your case101clearly and calmly. If, after doing so, the feedback is judged to still apply,102you must either apply the feedback or withdraw your contribution.103104New Contributors105~~~~~~~~~~~~~~~~106107If you are new or relatively new to Open Source, welcome! Requests aims to108be a gentle introduction to the world of Open Source. If you're concerned about109how best to contribute, please consider mailing a maintainer (listed above) and110asking for help.111112Please also check the :ref:`early-feedback` section.113114Kenneth Reitz's Code Style™115~~~~~~~~~~~~~~~~~~~~~~~~~~~116117The Requests codebase uses the `PEP 8`_ code style.118119In addition to the standards outlined in PEP 8, we have a few guidelines:120121- Line-length can exceed 79 characters, to 100, when convenient.122- Line-length can exceed 100 characters, when doing otherwise would be *terribly* inconvenient.123- Always use single-quoted strings (e.g. ``'#flatearth'``), unless a single-quote occurs within the string.124125Additionally, one of the styles that PEP8 recommends for `line continuations`_126completely lacks all sense of taste, and is not to be permitted within127the Requests codebase::128129 # Aligned with opening delimiter.130 foo = long_function_name(var_one, var_two,131 var_three, var_four)132

Merge pull request #5142 from dullbananas/masterKenneth Reitzbefore adoption9a2e5df

lines 133–140why, one step back
133No. Just don't. Please. This is much better::
134135 foo = long_function_name(136 var_one,137 var_two,138 var_three,139 var_four,140 )

stickersKenneth Reitzbefore adoption0eb9a4c

lines 141–167why, one step back
141
142Docstrings are to follow the following syntaxes::143144 def the_earth_is_flat():145 """NASA divided up the seas into thirty-three degrees."""146 pass147148::149150 def fibonacci_spiral_tool():151 """With my feet upon the ground I lose myself / between the sounds152 and open wide to suck it in. / I feel it move across my skin. / I'm153 reaching up and reaching out. / I'm reaching for the random or154 whatever will bewilder me. / Whatever will bewilder me. / And155 following our will and wind we may just go where no one's been. /156 We'll ride the spiral to the end and may just go where no one's157 been.158159 Spiral out. Keep going...160 """161 pass162163All functions, methods, and classes are to contain docstrings. Object data164model methods (e.g. ``__repr__``) are typically the exception to this rule.165166Thanks for helping to make the world a better place!167

Merge pull request #4805 from jdufresne/httpsNate Prewittbefore adoptionff0c325

line 168why, one step back
168.. _PEP 8: https://pep8.org/

stickersKenneth Reitzbefore adoption0eb9a4c

lines 169–199why, one step back
169.. _line continuations: https://www.python.org/dev/peps/pep-0008/#indentation
170171Documentation Contributions172---------------------------173174Documentation improvements are always welcome! The documentation files live in175the ``docs/`` directory of the codebase. They're written in176`reStructuredText`_, and use `Sphinx`_ to generate the full suite of177documentation.178179When contributing documentation, please do your best to follow the style of the180documentation files. This means a soft-limit of 79 characters wide in your text181files and a semi-formal, yet friendly and approachable, prose style.182183When presenting Python code, use single-quoted strings (``'hello'`` instead of184``"hello"``).185186.. _reStructuredText: http://docutils.sourceforge.net/rst.html187.. _Sphinx: http://sphinx-doc.org/index.html188189190.. _bug-reports:191192Bug Reports193-----------194195Bug reports are hugely important! Before you raise one, though, please check196through the `GitHub issues`_, **both open and closed**, to confirm that the bug197hasn't been reported before. Duplicate bug reports are a huge drain on the time198of other contributors, and should be avoided as much as possible.199

Merge pull request #5160 from OrangutanGaming/change-githubNate Prewittbefore adoptiond79024f

line 200why, one step back
200.. _GitHub issues: https://github.com/psf/requests/issues

stickersKenneth Reitzbefore adoption0eb9a4c

lines 201–216why, one step back
201
202203Feature Requests204----------------205206Requests is in a perpetual feature freeze, only the BDFL can add or approve of207new features. The maintainers believe that Requests is a feature-complete208piece of software at this time.209210One of the most important skills to have while maintaining a largely-used211open source project is learning the ability to say "no" to suggested changes,212while keeping an open ear and mind.213214If you believe there is a feature missing, feel free to raise a feature215request, but please do be aware that the overwhelming likelihood is that your216feature request will not be accepted.