CONTRIBUTING.rst
This file
Path
CONTRIBUTING.rst
222 lines · 6.4 KiB
Last changed by
Merge remote-tracking branch 'origin/8.0.x'David Lordbefore adoptionce152bd
History of this fileTake it
The walk stopped after 200 commits: lines older than 8f36eab point at it.
Merge branch '7.x'David Lordbefore adoption8f36eab
lines 1–3why, one step back1How to contribute to Click2==========================3update contributing guide (#1584)David Lordbefore adoption9cfa961
line 4why, one step back4Thank you for considering contributing to Click!Merge branch '7.x'David Lordbefore adoption8f36eab
line 5why, one step back5update contributing guide (#1584)David Lordbefore adoption9cfa961
line 6why, one step back6Merge branch '7.x'David Lordbefore adoption8f36eab
line 7why, one step back7Support questionsupdate contributing guide (#1584)David Lordbefore adoption9cfa961
line 8why, one step back8-----------------Merge branch '7.x'David Lordbefore adoption8f36eab
line 9why, one step back9Merge pull request #1774 from pallets/update-projectDavid Lordbefore adoption506e4eb
lines 10–13why, one step back10Please don't use the issue tracker for this. The issue tracker is a tool11to address bugs and feature requests in Click itself. Use one of the12following resources for questions about using Click or issues with your13own code:Merge branch '7.x'David Lordbefore adoption8f36eab
line 14why, one step back14update contributing guide (#1584)David Lordbefore adoption9cfa961
line 15why, one step back15- The ``#get-help`` channel on our Discord chat:Merge pull request #1774 from pallets/update-projectDavid Lordbefore adoption506e4eb
line 16why, one step back16 https://discord.gg/palletsupdate contributing guide (#1584)David Lordbefore adoption9cfa961
lines 17–20why, one step back17- The mailing list flask@python.org for long term discussion or larger18 issues.19- Ask on `Stack Overflow`_. Search with Google first using:20 ``site:stackoverflow.com python click {search term, exception message, etc.}``Merge branch '7.x'David Lordbefore adoption8f36eab
line 21why, one step back21Merge pull request #1774 from pallets/update-projectDavid Lordbefore adoption506e4eb
line 22why, one step back22.. _Stack Overflow: https://stackoverflow.com/questions/tagged/python-click?tab=Frequentupdate contributing guide (#1584)David Lordbefore adoption9cfa961
lines 23–24why, one step back2324Merge branch '7.x'David Lordbefore adoption8f36eab
line 25why, one step back25Reporting issuesupdate contributing guide (#1584)David Lordbefore adoption9cfa961
line 26why, one step back26----------------Merge branch '7.x'David Lordbefore adoption8f36eab
line 27why, one step back27update contributing guide (#1584)David Lordbefore adoption9cfa961
line 28why, one step back28Include the following information in your post:Merge branch '7.x'David Lordbefore adoption8f36eab
line 29why, one step back29update contributing guide (#1584)David Lordbefore adoption9cfa961
lines 30–35why, one step back30- Describe what you expected to happen.31- If possible, include a `minimal reproducible example`_ to help us32 identify the issue. This also helps check that the issue is not with33 your own code.34- Describe what actually happened. Include the full traceback if there35 was an exception.Merge pull request #1774 from pallets/update-projectDavid Lordbefore adoption506e4eb
lines 36–38why, one step back36- List your Python and Click versions. If possible, check if this37 issue is already fixed in the latest releases or the latest code in38 the repository.Merge branch '7.x'David Lordbefore adoption8f36eab
line 39why, one step back39update contributing guide (#1584)David Lordbefore adoption9cfa961
lines 40–42why, one step back40.. _minimal reproducible example: https://stackoverflow.com/help/minimal-reproducible-example4142Merge branch '7.x'David Lordbefore adoption8f36eab
line 43why, one step back43Submitting patchesupdate contributing guide (#1584)David Lordbefore adoption9cfa961
line 44why, one step back44------------------Merge branch '7.x'David Lordbefore adoption8f36eab
line 45why, one step back45update contributing guide (#1584)David Lordbefore adoption9cfa961
lines 46–50why, one step back46If there is not an open issue for what you want to submit, prefer47opening one for discussion before working on a PR. You can work on any48issue that doesn't have an open PR linked to it or a maintainer assigned49to it. These show up in the sidebar. No need to ask if you can work on50an issue that interests you.Merge branch '7.x'David Lordbefore adoption8f36eab
line 51why, one step back51update contributing guide (#1584)David Lordbefore adoption9cfa961
line 52why, one step back52Include the following in your patch:Merge branch '7.x'David Lordbefore adoption8f36eab
line 53why, one step back53update contributing guide (#1584)David Lordbefore adoption9cfa961
lines 54–63why, one step back54- Use `Black`_ to format your code. This and other tools will run55 automatically if you install `pre-commit`_ using the instructions56 below.57- Include tests if your patch adds or changes code. Make sure the test58 fails without your patch.59- Update any relevant docs pages and docstrings. Docs pages and60 docstrings should be wrapped at 72 characters.61- Add an entry in ``CHANGES.rst``. Use the same style as other62 entries. Also include ``.. versionchanged::`` inline changelogs in63 relevant docstrings.Merge branch '7.x'David Lordbefore adoption8f36eab
line 64why, one step back64update contributing guide (#1584)David Lordbefore adoption9cfa961
lines 65–66why, one step back65.. _Black: https://black.readthedocs.io66.. _pre-commit: https://pre-commit.comMerge branch '7.x'David Lordbefore adoption8f36eab
lines 67–68why, one step back6768update contributing guide (#1584)David Lordbefore adoption9cfa961
lines 69–70why, one step back69First time setup70~~~~~~~~~~~~~~~~Merge branch '7.x'David Lordbefore adoption8f36eab
line 71why, one step back71update contributing guide (#1584)David Lordbefore adoption9cfa961
lines 72–73why, one step back72- Download and install the `latest version of git`_.73- Configure git with your `username`_ and `email`_.Merge branch '7.x'David Lordbefore adoption8f36eab
line 74why, one step back74update contributing guide (#1584)David Lordbefore adoption9cfa961
line 75why, one step back75 .. code-block:: textMerge branch '7.x'David Lordbefore adoption8f36eab
line 76why, one step back76update contributing guide (#1584)David Lordbefore adoption9cfa961
lines 77–78why, one step back77 $ git config --global user.name 'your name'78 $ git config --global user.email 'your email'Merge branch '7.x'David Lordbefore adoption8f36eab
line 79why, one step back79update contributing guide (#1584)David Lordbefore adoption9cfa961
lines 80–82why, one step back80- Make sure you have a `GitHub account`_.81- Fork Click to your GitHub account by clicking the `Fork`_ button.82- `Clone`_ the main repository locally.Merge branch '7.x'David Lordbefore adoption8f36eab
line 83why, one step back83update contributing guide (#1584)David Lordbefore adoption9cfa961
line 84why, one step back84 .. code-block:: textMerge branch '7.x'David Lordbefore adoption8f36eab
line 85why, one step back85update contributing guide (#1584)David Lordbefore adoption9cfa961
lines 86–87why, one step back86 $ git clone https://github.com/pallets/click87 $ cd clickMerge branch '7.x'David Lordbefore adoption8f36eab
line 88why, one step back88update contributing guide (#1584)David Lordbefore adoption9cfa961
line 89why, one step back89- Add your fork as a remote to push your work to. Replaceupdate CONTRIBUTING.rstDavid Lordbefore adoption3bd7182
lines 90–91why, one step back90 ``{username}`` with your username. This names the remote "fork", the91 default Pallets remote is "origin".Merge branch '7.x'David Lordbefore adoption8f36eab
line 92why, one step back92update contributing guide (#1584)David Lordbefore adoption9cfa961
lines 93–94why, one step back93 .. code-block:: text94Merge remote-tracking branch 'origin/8.0.x'David Lordbefore adoptionce152bd
line 95why, one step back95 $ git remote add fork https://github.com/{username}/clickupdate contributing guide (#1584)David Lordbefore adoption9cfa961
lines 96–109why, one step back9697- Create a virtualenv.9899 .. code-block:: text100101 $ python3 -m venv env102 $ . env/bin/activate103104 On Windows, activating is different.105106 .. code-block:: text107108 > env\Scripts\activate109Merge remote-tracking branch 'origin/8.0.x'David Lordbefore adoptionce152bd
lines 110–115why, one step back110- Upgrade pip and setuptools.111112 .. code-block:: text113114 $ python -m pip install --upgrade pip setuptools115Merge pull request #1774 from pallets/update-projectDavid Lordbefore adoption506e4eb
lines 116–117why, one step back116- Install the development dependencies, then install Click in117 editable mode.update contributing guide (#1584)David Lordbefore adoption9cfa961
lines 118–120why, one step back118119 .. code-block:: text120Merge pull request #1774 from pallets/update-projectDavid Lordbefore adoption506e4eb
line 121why, one step back121 $ pip install -r requirements/dev.txt && pip install -e .update contributing guide (#1584)David Lordbefore adoption9cfa961
lines 122–129why, one step back122123- Install the pre-commit hooks.124125 .. code-block:: text126127 $ pre-commit install128129.. _latest version of git: https://git-scm.com/downloadsMerge pull request #1774 from pallets/update-projectDavid Lordbefore adoption506e4eb
lines 130–131why, one step back130.. _username: https://docs.github.com/en/github/using-git/setting-your-username-in-git131.. _email: https://docs.github.com/en/github/setting-up-and-managing-your-github-user-account/setting-your-commit-email-addressupdate contributing guide (#1584)David Lordbefore adoption9cfa961
line 132why, one step back132.. _GitHub account: https://github.com/joinUpdate fork link in CONTRIBUTING.rst (#1931)Israel Tenedabefore adoption8e98529
line 133why, one step back133.. _Fork: https://github.com/pallets/click/forkMerge pull request #1774 from pallets/update-projectDavid Lordbefore adoption506e4eb
line 134why, one step back134.. _Clone: https://docs.github.com/en/github/getting-started-with-github/fork-a-repo#step-2-create-a-local-clone-of-your-forkupdate contributing guide (#1584)David Lordbefore adoption9cfa961
lines 135–145why, one step back135136137Start coding138~~~~~~~~~~~~139140- Create a branch to identify the issue you would like to work on. If141 you're submitting a bug or documentation fix, branch off of the142 latest ".x" branch.143144 .. code-block:: text145update CONTRIBUTING.rstDavid Lordbefore adoption3bd7182
line 146why, one step back146 $ git fetch originMerge remote-tracking branch 'origin/8.0.x'David Lordbefore adoptionce152bd
line 147why, one step back147 $ git checkout -b your-branch-name origin/8.0.xupdate contributing guide (#1584)David Lordbefore adoption9cfa961
lines 148–149why, one step back148149 If you're submitting a feature addition or change, branch off of theMerge remote-tracking branch 'origin/8.0.x'David Lordbefore adoption8a04bb0
line 150why, one step back150 "main" branch.update contributing guide (#1584)David Lordbefore adoption9cfa961
lines 151–153why, one step back151152 .. code-block:: text153update CONTRIBUTING.rstDavid Lordbefore adoption3bd7182
line 154why, one step back154 $ git fetch originMerge remote-tracking branch 'origin/8.0.x'David Lordbefore adoption8a04bb0
line 155why, one step back155 $ git checkout -b your-branch-name origin/mainupdate contributing guide (#1584)David Lordbefore adoption9cfa961
lines 156–169why, one step back156157- Using your favorite editor, make your changes,158 `committing as you go`_.159- Include tests that cover any code changes you make. Make sure the160 test fails without your patch. Run the tests as described below.161- Push your commits to your fork on GitHub and162 `create a pull request`_. Link to the issue being addressed with163 ``fixes #123`` in the pull request.164165 .. code-block:: text166167 $ git push --set-upstream fork your-branch-name168169.. _committing as you go: https://dont-be-afraid-to-commit.readthedocs.io/en/latest/git/commandlinegit.html#commit-your-changesMerge pull request #1774 from pallets/update-projectDavid Lordbefore adoption506e4eb
line 170why, one step back170.. _create a pull request: https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/creating-a-pull-requestupdate contributing guide (#1584)David Lordbefore adoption9cfa961
lines 171–222why, one step back171172173Running the tests174~~~~~~~~~~~~~~~~~175176Run the basic test suite with pytest.177178.. code-block:: text179180 $ pytest181182This runs the tests for the current environment, which is usually183sufficient. CI will run the full suite when you submit your pull184request. You can run the full test suite with tox if you don't want to185wait.186187.. code-block:: text188189 $ tox190191192Running test coverage193~~~~~~~~~~~~~~~~~~~~~194195Generating a report of lines that do not have test coverage can indicate196where to start contributing. Run ``pytest`` using ``coverage`` and197generate a report.198199.. code-block:: text200201 $ pip install coverage202 $ coverage run -m pytest203 $ coverage html204205Open ``htmlcov/index.html`` in your browser to explore the report.206207Read more about `coverage <https://coverage.readthedocs.io>`__.208209210Building the docs211~~~~~~~~~~~~~~~~~212213Build the docs in the ``docs`` directory using Sphinx.214215.. code-block:: text216217 $ cd docs218 $ make html219220Open ``_build/html/index.html`` in your browser to view the docs.221222Read more about `Sphinx <https://www.sphinx-doc.org/en/stable/>`__.