contributing.rst
This file
Path
docs/dev/contributing.rst
167 lines · 6.3 KiB
Last changed by
Add automatic code formatting to Requests (#6095)Nate Prewittbefore adoption2a6f290
History of this fileTake it
The walk stopped after 200 commits: lines older than 8c211a9 point at it.
Merge pull request #5681 from mateusduboli/5677Ian Stapleton Cordascobefore adoption8c211a9
lines 1–36why, one step back1.. _contributing:23Contributor's Guide4===================56If 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.1011This 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 any14questions, feel free to reach out to either `Nate Prewitt`_, `Ian Cordasco`_,15or `Seth Michael Larson`_, the primary maintainers.1617.. _Ian Cordasco: http://www.coglib.com/~icordasc/18.. _Nate Prewitt: https://www.nateprewitt.com/19.. _Seth Michael Larson: https://sethmlarson.dev/2021The guide is split into sections based on the type of contribution you're22thinking of making, with a section that covers general guidelines for all23contributors.2425Be Cordial26----------2728 **Be cordial or be on your way**. *—Kenneth Reitz*2930Requests has one very important rule governing all forms of contribution,31including reporting bugs or requesting features. This golden rule is32"`be cordial or be on your way`_".3334**All contributions are welcome**, as long as35everyone involved is treated with respect.36Updated to new be-cordial-or-be-on-your-way URL and CoC now references Python Community CoC (#5811)Mark Bellbefore adoptionf6d43b0
line 37why, one step back37.. _be cordial or be on your way: https://kenreitz.org/essays/2013/01/27/be-cordial-or-be-on-your-wayMerge pull request #5681 from mateusduboli/5677Ian Stapleton Cordascobefore adoption8c211a9
lines 38–80why, one step back3839.. _early-feedback:4041Get Early Feedback42------------------4344If you are contributing, do not feel the need to sit on your contribution until45it is perfectly polished and complete. It helps everyone involved for you to46seek feedback as early as you possibly can. Submitting an early, unfinished47version of your contribution for feedback in no way prejudices your chances of48getting that contribution accepted, and can save you from putting a lot of work49into a contribution that is not suitable for the project.5051Contribution Suitability52------------------------5354Our project maintainers have the last word on whether or not a contribution is55suitable for Requests. All contributions will be considered carefully, but from56time to time, contributions will be rejected because they do not suit the57current goals or needs of the project.5859If your contribution is rejected, don't despair! As long as you followed these60guidelines, you will have a much better chance of getting your next61contribution accepted.626364Code Contributions65------------------6667Steps for Submitting Code68~~~~~~~~~~~~~~~~~~~~~~~~~6970When contributing code, you'll want to follow this checklist:71721. Fork the repository on GitHub.732. Run the tests to confirm they all pass on your system. If they don't, you'll74 need to investigate why they fail. If you're unable to diagnose this75 yourself, raise it as a bug report by following the guidelines in this76 document: :ref:`bug-reports`.773. Write tests that demonstrate your bug or feature. Ensure that they fail.784. Make your change.795. Run the entire test suite again, confirming that all tests pass *including80 the ones you just added*.General doc updates (#5923)Nate Prewittbefore adoption9572d6a
line 81why, one step back816. Send a GitHub Pull Request to the main repository's ``main`` branch.Merge pull request #5681 from mateusduboli/5677Ian Stapleton Cordascobefore adoption8c211a9
lines 82–95why, one step back82 GitHub Pull Requests are the expected method of code collaboration on this83 project.8485The following sub-sections go into more detail on some of the points above.8687Code Review88~~~~~~~~~~~8990Contributions will not be merged until they've been code reviewed. You should91implement any code review feedback unless you strongly object to it. In the92event that you object to the code review feedback, you should make your case93clearly and calmly. If, after doing so, the feedback is judged to still apply,94you must either apply the feedback or withdraw your contribution.95Add automatic code formatting to Requests (#6095)Nate Prewittbefore adoption2a6f290
lines 96–110why, one step back96Code Style97~~~~~~~~~~9899Requests uses a collection of tools to ensure the code base has a consistent100style as it grows. We have these orchestrated using a tool called101`pre-commit`_. This can be installed locally and run over your changes prior102to opening a PR, and will also be run as part of the CI approval process103before a change is merged.104105You can find the full list of formatting requirements specified in the106`.pre-commit-config.yaml`_ at the top level directory of Requests.107108.. _pre-commit: https://pre-commit.com/109.. _.pre-commit-config.yaml: https://github.com/psf/requests/blob/main/.pre-commit-config.yaml110Merge pull request #5681 from mateusduboli/5677Ian Stapleton Cordascobefore adoption8c211a9
lines 111–167why, one step back111New Contributors112~~~~~~~~~~~~~~~~113114If you are new or relatively new to Open Source, welcome! Requests aims to115be a gentle introduction to the world of Open Source. If you're concerned about116how best to contribute, please consider mailing a maintainer (listed above) and117asking for help.118119Please also check the :ref:`early-feedback` section.120121122Documentation Contributions123---------------------------124125Documentation improvements are always welcome! The documentation files live in126the ``docs/`` directory of the codebase. They're written in127`reStructuredText`_, and use `Sphinx`_ to generate the full suite of128documentation.129130When contributing documentation, please do your best to follow the style of the131documentation files. This means a soft-limit of 79 characters wide in your text132files and a semi-formal, yet friendly and approachable, prose style.133134When presenting Python code, use single-quoted strings (``'hello'`` instead of135``"hello"``).136137.. _reStructuredText: http://docutils.sourceforge.net/rst.html138.. _Sphinx: http://sphinx-doc.org/index.html139140141.. _bug-reports:142143Bug Reports144-----------145146Bug reports are hugely important! Before you raise one, though, please check147through the `GitHub issues`_, **both open and closed**, to confirm that the bug148hasn't been reported before. Duplicate bug reports are a huge drain on the time149of other contributors, and should be avoided as much as possible.150151.. _GitHub issues: https://github.com/psf/requests/issues152153154Feature Requests155----------------156157Requests is in a perpetual feature freeze, only the BDFL can add or approve of158new features. The maintainers believe that Requests is a feature-complete159piece of software at this time.160161One of the most important skills to have while maintaining a largely-used162open source project is learning the ability to say "no" to suggested changes,163while keeping an open ear and mind.164165If you believe there is a feature missing, feel free to raise a feature166request, but please do be aware that the overwhelming likelihood is that your167feature request will not be accepted.