contributing.rst
This file
Path
docs/dev/contributing.rst
206 lines · 7.7 KiB
Last changed by
docs2Kenneth Reitzbefore adoption4618423
History of this fileTake it
The walk stopped after 200 commits: lines older than 3cf4ec4 point at it.
Merge pull request #2729 from smiley/patch-1Cory Benfieldbefore adoption3cf4ec4
lines 1–5why, one step back1.. _contributing:23Contributor's Guide4===================5contributingKenneth Reitzbefore adoptiond3bd9f3
lines 6–9why, one step back6If you're reading this, you're probably interested in contributing to Requests.7Thank you very much! Open source projects live-and-die based on the support8they receive from others, and the fact that you're even considering9contributing to the Requests project is *very* generous of you.Merge pull request #2729 from smiley/patch-1Cory Benfieldbefore adoption3cf4ec4
line 10why, one step back10contributingKenneth Reitzbefore adoptiond3bd9f3
lines 11–13why, one step back11This document lays out guidelines and advice for contributing to this project.12If you're thinking of contributing, please start by reading this document and13getting a feel for how contributing to this project works. If you have anyMerge pull request #2729 from smiley/patch-1Cory Benfieldbefore adoption3cf4ec4
lines 14–16why, one step back14questions, feel free to reach out to either `Ian Cordasco`_ or `Cory Benfield`_,15the primary maintainers.16contributingKenneth Reitzbefore adoptiond3bd9f3
lines 17–19why, one step back17.. _Ian Cordasco: http://www.coglib.com/~icordasc/18.. _Cory Benfield: https://lukasa.co.uk/about19spKenneth Reitzbefore adoption2cb052a
line 20why, one step back20If you have non-technical feedback, philosophical ponderings, crazy ideas, orcontributingKenneth Reitzbefore adoptiond3bd9f3
lines 21–23why, one step back21other general thoughts about Requests or its position within the Python22ecosystem, the BDFL, `Kenneth Reitz`_, would love to hear from you.23Merge pull request #2729 from smiley/patch-1Cory Benfieldbefore adoption3cf4ec4
lines 24–27why, one step back24The guide is split into sections based on the type of contribution you're25thinking of making, with a section that covers general guidelines for all26contributors.27contributingKenneth Reitzbefore adoptiond3bd9f3
line 28why, one step back28.. _Kenneth Reitz: mailto:me@kennethreitz.orgMerge pull request #2729 from smiley/patch-1Cory Benfieldbefore adoption3cf4ec4
lines 29–30why, one step back2930Be Cordialimprove contributions sectionKenneth Reitzbefore adoption688a00c
line 31why, one step back31----------Merge pull request #2729 from smiley/patch-1Cory Benfieldbefore adoption3cf4ec4
line 32why, one step back32contributingKenneth Reitzbefore adoptiond3bd9f3
line 33why, one step back33 **Be cordial or be on your way**. *—Kenneth Reitz*Merge pull request #2729 from smiley/patch-1Cory Benfieldbefore adoption3cf4ec4
lines 34–36why, one step back3435Requests has one very important rule governing all forms of contribution,36including reporting bugs or requesting features. This golden rule iscontributingKenneth Reitzbefore adoption886f923
lines 37–39why, one step back37"`be cordial or be on your way`_".3839**All contributions are welcome**, as long asMerge pull request #2729 from smiley/patch-1Cory Benfieldbefore adoption3cf4ec4
lines 40–46why, one step back40everyone involved is treated with respect.4142.. _be cordial or be on your way: http://kennethreitz.org/be-cordial-or-be-on-your-way/4344.. _early-feedback:4546Get Early Feedbackimprove contributions sectionKenneth Reitzbefore adoption688a00c
line 47why, one step back47------------------Merge pull request #2729 from smiley/patch-1Cory Benfieldbefore adoption3cf4ec4
lines 48–56why, one step back4849If you are contributing, do not feel the need to sit on your contribution until50it is perfectly polished and complete. It helps everyone involved for you to51seek feedback as early as you possibly can. Submitting an early, unfinished52version of your contribution for feedback in no way prejudices your chances of53getting that contribution accepted, and can save you from putting a lot of work54into a contribution that is not suitable for the project.5556Contribution Suitabilityimprove contributions sectionKenneth Reitzbefore adoption688a00c
line 57why, one step back57------------------------Merge pull request #2729 from smiley/patch-1Cory Benfieldbefore adoption3cf4ec4
line 58why, one step back58sentencesKenneth Reitzbefore adoptionf653b9a
lines 59–62why, one step back59Our project maintainers have the last word on whether or not a contribution is60suitable for Requests. All contributions will be considered carefully, but from61time to time, contributions will be rejected because they do not suit the62current goals or needs of the project.Merge pull request #2729 from smiley/patch-1Cory Benfieldbefore adoption3cf4ec4
line 63why, one step back63sentencesKenneth Reitzbefore adoptionf653b9a
lines 64–66why, one step back64If your contribution is rejected, don't despair! As long as you followed these65guidelines, you will have a much better chance of getting your next66contribution accepted.Merge pull request #2729 from smiley/patch-1Cory Benfieldbefore adoption3cf4ec4
lines 67–71why, one step back676869Code Contributions70------------------71style guideKenneth Reitzbefore adoption5d0ffd8
lines 72–73why, one step back72Steps for Submitting Code73~~~~~~~~~~~~~~~~~~~~~~~~~Merge pull request #2729 from smiley/patch-1Cory Benfieldbefore adoption3cf4ec4
lines 74–109why, one step back7475When contributing code, you'll want to follow this checklist:76771. Fork the repository on GitHub.782. Run the tests to confirm they all pass on your system. If they don't, you'll79 need to investigate why they fail. If you're unable to diagnose this80 yourself, raise it as a bug report by following the guidelines in this81 document: :ref:`bug-reports`.823. Write tests that demonstrate your bug or feature. Ensure that they fail.834. Make your change.845. Run the entire test suite again, confirming that all tests pass *including85 the ones you just added*.866. Send a GitHub Pull Request to the main repository's ``master`` branch.87 GitHub Pull Requests are the expected method of code collaboration on this88 project.8990The following sub-sections go into more detail on some of the points above.9192Code Review93~~~~~~~~~~~9495Contributions will not be merged until they've been code reviewed. You should96implement any code review feedback unless you strongly object to it. In the97event that you object to the code review feedback, you should make your case98clearly and calmly. If, after doing so, the feedback is judged to still apply,99you must either apply the feedback or withdraw your contribution.100101New Contributors102~~~~~~~~~~~~~~~~103104If you are new or relatively new to Open Source, welcome! Requests aims to105be a gentle introduction to the world of Open Source. If you're concerned about106how best to contribute, please consider mailing a maintainer (listed above) and107asking for help.108109Please also check the :ref:`early-feedback` section.style guideKenneth Reitzbefore adoption5d0ffd8
line 110why, one step back110transcendental meditationKenneth Reitzbefore adoption75096a1
lines 111–112why, one step back111Kenneth Reitz's Code Style™112~~~~~~~~~~~~~~~~~~~~~~~~~~~style guideKenneth Reitzbefore adoption5d0ffd8
line 113why, one step back113http://pep8.orgKenneth Reitzbefore adoptionf8798a2
line 114why, one step back114The Requests codebase uses the `PEP 8`_ code style.style guideKenneth Reitzbefore adoption5d0ffd8
line 115why, one step back115docsKenneth Reitzbefore adoption7c5d703
line 116why, one step back116In addition to the standards outlined in PEP 8, we have a few guidelines:style guideKenneth Reitzbefore adoption5d0ffd8
lines 117–121why, one step back117118- Line-length can exceed 79 characters, to 100, when convenient.119- Line-length can exceed 100 characters, when doing otherwise would be *terribly* inconvenient.120- Always use single-quoted strings (e.g. ``'#flatearth'``), unless a single-quote occurs within the string.121completely (docs)Kenneth Reitzbefore adoptionb70136c
lines 122–123why, one step back122Additionally, one of the styles that PEP8 recommends for `line continuations`_123completely lacks all sense of taste, and is not to be permitted withinstyle guideKenneth Reitzbefore adoption5d0ffd8
lines 124–129why, one step back124the Requests codebase::125126 # Aligned with opening delimiter.127 foo = long_function_name(var_one, var_two,128 var_three, var_four)129more pleasant wording about strong opinionKenneth Reitzbefore adoptionee02442
line 130why, one step back130No. Just don't. Please.updated style guideKenneth Reitzbefore adoption90ddeca
lines 131–134why, one step back131132Docstrings are to follow the following syntaxes::133134 def the_earth_is_flat():lyrics, er, docstringsKenneth Reitzbefore adoptionfc1e9b4
line 135why, one step back135 """NASA divided up the seas into thirty-three degrees."""pass go, yay $200Kenneth Reitzbefore adoptiona7b5e31
line 136why, one step back136 passupdated style guideKenneth Reitzbefore adoption90ddeca
lines 137–139why, one step back137138::139lyrics, er, docstringsKenneth Reitzbefore adoptionfc1e9b4
line 140why, one step back140 def fibonacci_spiral_tool():improved presentation of style guideKenneth Reitzbefore adoptionb366ef0
lines 141–147why, one step back141 """With my feet upon the ground I lose myself / between the sounds142 and open wide to suck it in. / I feel it move across my skin. / I'm143 reaching up and reaching out. / I'm reaching for the random or144 whatever will bewilder me. / Whatever will bewilder me. / And145 following our will and wind we may just go where no one's been. /146 We'll ride the spiral to the end and may just go where no one's147 been.lyrics, er, docstringsKenneth Reitzbefore adoptionfc1e9b4
lines 148–149why, one step back148149 Spiral out. Keep going...updated style guideKenneth Reitzbefore adoption90ddeca
line 150why, one step back150 """pass go, yay $200Kenneth Reitzbefore adoptiona7b5e31
line 151why, one step back151 passstyle guideKenneth Reitzbefore adoption5d0ffd8
line 152why, one step back152what's docstrungKenneth Reitzbefore adoption1cf1699
line 153why, one step back153All functions, methods, and classes are to contain docstrings. Object datawords (docs)Kenneth Reitzbefore adoption14a8333
line 154why, one step back154model methods (e.g. ``__repr__``) are typically the exception to this rule.what's docstrungKenneth Reitzbefore adoption1cf1699
line 155why, one step back155</tone>Kenneth Reitzbefore adoption29b191b
lines 156–157why, one step back156Thanks for helping to make the world a better place!157docs2Kenneth Reitzbefore adoption4618423
line 158why, one step back158.. _PEP 8: http://pep8.orgstyle guideKenneth Reitzbefore adoption5d0ffd8
line 159why, one step back159.. _line continuations: https://www.python.org/dev/peps/pep-0008/#indentationMerge pull request #2729 from smiley/patch-1Cory Benfieldbefore adoption3cf4ec4
lines 160–168why, one step back160161Documentation Contributions162---------------------------163164Documentation improvements are always welcome! The documentation files live in165the ``docs/`` directory of the codebase. They're written in166`reStructuredText`_, and use `Sphinx`_ to generate the full suite of167documentation.168contributingKenneth Reitzbefore adoptiond3bd9f3
line 169why, one step back169When contributing documentation, please do your best to follow the style of theMerge pull request #2729 from smiley/patch-1Cory Benfieldbefore adoption3cf4ec4
line 170why, one step back170documentation files. This means a soft-limit of 79 characters wide in your textcontributingKenneth Reitzbefore adoptiond3bd9f3
line 171why, one step back171files and a semi-formal, yet friendly and approachable, prose style.improve contributions sectionKenneth Reitzbefore adoption688a00c
lines 172–174why, one step back172173When presenting Python code, use single-quoted strings (``'hello'`` instead of174``"hello"``).Merge pull request #2729 from smiley/patch-1Cory Benfieldbefore adoption3cf4ec4
lines 175–195why, one step back175176.. _reStructuredText: http://docutils.sourceforge.net/rst.html177.. _Sphinx: http://sphinx-doc.org/index.html178179180.. _bug-reports:181182Bug Reports183-----------184185Bug reports are hugely important! Before you raise one, though, please check186through the `GitHub issues`_, **both open and closed**, to confirm that the bug187hasn't been reported before. Duplicate bug reports are a huge drain on the time188of other contributors, and should be avoided as much as possible.189190.. _GitHub issues: https://github.com/kennethreitz/requests/issues191192193Feature Requests194----------------195contributingKenneth Reitzbefore adoptiond3bd9f3
lines 196–197why, one step back196Requests is in a perpetual feature freeze, only the BDFL can add or approve of197new features. The maintainers believe that Requests is a feature-completespKenneth Reitzbefore adoption8dc5f68
line 198why, one step back198piece of software at this time.contributingKenneth Reitzbefore adoptiond3bd9f3
lines 199–202why, one step back199200One of the most important skills to have while maintaining a largely-used201open source project is learning the ability to say "no" to suggested changes,202while keeping an open ear and mind.Merge pull request #2729 from smiley/patch-1Cory Benfieldbefore adoption3cf4ec4
lines 203–206why, one step back203204If you believe there is a feature missing, feel free to raise a feature205request, but please do be aware that the overwhelming likelihood is that your206feature request will not be accepted.