Skip to content
Myr

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 file

Take 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 back
1How to contribute to Click
2==========================3

update contributing guide (#1584)David Lordbefore adoption9cfa961

line 4why, one step back
4Thank you for considering contributing to Click!

Merge branch '7.x'David Lordbefore adoption8f36eab

line 5why, one step back
5

update contributing guide (#1584)David Lordbefore adoption9cfa961

line 6why, one step back
6

Merge branch '7.x'David Lordbefore adoption8f36eab

line 7why, one step back
7Support questions

update contributing guide (#1584)David Lordbefore adoption9cfa961

line 8why, one step back
8-----------------

Merge branch '7.x'David Lordbefore adoption8f36eab

line 9why, one step back
9

Merge pull request #1774 from pallets/update-projectDavid Lordbefore adoption506e4eb

lines 10–13why, one step back
10Please don't use the issue tracker for this. The issue tracker is a tool
11to 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 back
14

update contributing guide (#1584)David Lordbefore adoption9cfa961

line 15why, one step back
15- The ``#get-help`` channel on our Discord chat:

Merge pull request #1774 from pallets/update-projectDavid Lordbefore adoption506e4eb

line 16why, one step back
16 https://discord.gg/pallets

update contributing guide (#1584)David Lordbefore adoption9cfa961

lines 17–20why, one step back
17- The mailing list flask@python.org for long term discussion or larger
18 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 back
21

Merge pull request #1774 from pallets/update-projectDavid Lordbefore adoption506e4eb

line 22why, one step back
22.. _Stack Overflow: https://stackoverflow.com/questions/tagged/python-click?tab=Frequent

update contributing guide (#1584)David Lordbefore adoption9cfa961

lines 23–24why, one step back
23
24

Merge branch '7.x'David Lordbefore adoption8f36eab

line 25why, one step back
25Reporting issues

update contributing guide (#1584)David Lordbefore adoption9cfa961

line 26why, one step back
26----------------

Merge branch '7.x'David Lordbefore adoption8f36eab

line 27why, one step back
27

update contributing guide (#1584)David Lordbefore adoption9cfa961

line 28why, one step back
28Include the following information in your post:

Merge branch '7.x'David Lordbefore adoption8f36eab

line 29why, one step back
29

update contributing guide (#1584)David Lordbefore adoption9cfa961

lines 30–35why, one step back
30- 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 back
36- List your Python and Click versions. If possible, check if this
37 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 back
39

update contributing guide (#1584)David Lordbefore adoption9cfa961

lines 40–42why, one step back
40.. _minimal reproducible example: https://stackoverflow.com/help/minimal-reproducible-example
4142

Merge branch '7.x'David Lordbefore adoption8f36eab

line 43why, one step back
43Submitting patches

update contributing guide (#1584)David Lordbefore adoption9cfa961

line 44why, one step back
44------------------

Merge branch '7.x'David Lordbefore adoption8f36eab

line 45why, one step back
45

update contributing guide (#1584)David Lordbefore adoption9cfa961

lines 46–50why, one step back
46If there is not an open issue for what you want to submit, prefer
47opening 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 back
51

update contributing guide (#1584)David Lordbefore adoption9cfa961

line 52why, one step back
52Include the following in your patch:

Merge branch '7.x'David Lordbefore adoption8f36eab

line 53why, one step back
53

update contributing guide (#1584)David Lordbefore adoption9cfa961

lines 54–63why, one step back
54- Use `Black`_ to format your code. This and other tools will run
55 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 back
64

update contributing guide (#1584)David Lordbefore adoption9cfa961

lines 65–66why, one step back
65.. _Black: https://black.readthedocs.io
66.. _pre-commit: https://pre-commit.com

Merge branch '7.x'David Lordbefore adoption8f36eab

lines 67–68why, one step back
67
68

update contributing guide (#1584)David Lordbefore adoption9cfa961

lines 69–70why, one step back
69First time setup
70~~~~~~~~~~~~~~~~

Merge branch '7.x'David Lordbefore adoption8f36eab

line 71why, one step back
71

update contributing guide (#1584)David Lordbefore adoption9cfa961

lines 72–73why, one step back
72- 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 back
74

update contributing guide (#1584)David Lordbefore adoption9cfa961

line 75why, one step back
75 .. code-block:: text

Merge branch '7.x'David Lordbefore adoption8f36eab

line 76why, one step back
76

update contributing guide (#1584)David Lordbefore adoption9cfa961

lines 77–78why, one step back
77 $ 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 back
79

update contributing guide (#1584)David Lordbefore adoption9cfa961

lines 80–82why, one step back
80- 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 back
83

update contributing guide (#1584)David Lordbefore adoption9cfa961

line 84why, one step back
84 .. code-block:: text

Merge branch '7.x'David Lordbefore adoption8f36eab

line 85why, one step back
85

update contributing guide (#1584)David Lordbefore adoption9cfa961

lines 86–87why, one step back
86 $ git clone https://github.com/pallets/click
87 $ cd click

Merge branch '7.x'David Lordbefore adoption8f36eab

line 88why, one step back
88

update contributing guide (#1584)David Lordbefore adoption9cfa961

line 89why, one step back
89- Add your fork as a remote to push your work to. Replace

update CONTRIBUTING.rstDavid Lordbefore adoption3bd7182

lines 90–91why, one step back
90 ``{username}`` with your username. This names the remote "fork", the
91 default Pallets remote is "origin".

Merge branch '7.x'David Lordbefore adoption8f36eab

line 92why, one step back
92

update contributing guide (#1584)David Lordbefore adoption9cfa961

lines 93–94why, one step back
93 .. code-block:: text
94

Merge remote-tracking branch 'origin/8.0.x'David Lordbefore adoptionce152bd

line 95why, one step back
95 $ git remote add fork https://github.com/{username}/click

update contributing guide (#1584)David Lordbefore adoption9cfa961

lines 96–109why, one step back
96
97- 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\activate109

Merge remote-tracking branch 'origin/8.0.x'David Lordbefore adoptionce152bd

lines 110–115why, one step back
110- Upgrade pip and setuptools.
111112 .. code-block:: text113114 $ python -m pip install --upgrade pip setuptools115

Merge pull request #1774 from pallets/update-projectDavid Lordbefore adoption506e4eb

lines 116–117why, one step back
116- Install the development dependencies, then install Click in
117 editable mode.

update contributing guide (#1584)David Lordbefore adoption9cfa961

lines 118–120why, one step back
118
119 .. code-block:: text120

Merge pull request #1774 from pallets/update-projectDavid Lordbefore adoption506e4eb

line 121why, one step back
121 $ pip install -r requirements/dev.txt && pip install -e .

update contributing guide (#1584)David Lordbefore adoption9cfa961

lines 122–129why, one step back
122
123- Install the pre-commit hooks.124125 .. code-block:: text126127 $ pre-commit install128129.. _latest version of git: https://git-scm.com/downloads

Merge pull request #1774 from pallets/update-projectDavid Lordbefore adoption506e4eb

lines 130–131why, one step back
130.. _username: https://docs.github.com/en/github/using-git/setting-your-username-in-git
131.. _email: https://docs.github.com/en/github/setting-up-and-managing-your-github-user-account/setting-your-commit-email-address

update contributing guide (#1584)David Lordbefore adoption9cfa961

line 132why, one step back
132.. _GitHub account: https://github.com/join

Update fork link in CONTRIBUTING.rst (#1931)Israel Tenedabefore adoption8e98529

line 133why, one step back
133.. _Fork: https://github.com/pallets/click/fork

Merge pull request #1774 from pallets/update-projectDavid Lordbefore adoption506e4eb

line 134why, one step back
134.. _Clone: https://docs.github.com/en/github/getting-started-with-github/fork-a-repo#step-2-create-a-local-clone-of-your-fork

update contributing guide (#1584)David Lordbefore adoption9cfa961

lines 135–145why, one step back
135
136137Start 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:: text145

update CONTRIBUTING.rstDavid Lordbefore adoption3bd7182

line 146why, one step back
146 $ git fetch origin

Merge remote-tracking branch 'origin/8.0.x'David Lordbefore adoptionce152bd

line 147why, one step back
147 $ git checkout -b your-branch-name origin/8.0.x

update contributing guide (#1584)David Lordbefore adoption9cfa961

lines 148–149why, one step back
148
149 If you're submitting a feature addition or change, branch off of the

Merge remote-tracking branch 'origin/8.0.x'David Lordbefore adoption8a04bb0

line 150why, one step back
150 "main" branch.

update contributing guide (#1584)David Lordbefore adoption9cfa961

lines 151–153why, one step back
151
152 .. code-block:: text153

update CONTRIBUTING.rstDavid Lordbefore adoption3bd7182

line 154why, one step back
154 $ git fetch origin

Merge remote-tracking branch 'origin/8.0.x'David Lordbefore adoption8a04bb0

line 155why, one step back
155 $ git checkout -b your-branch-name origin/main

update contributing guide (#1584)David Lordbefore adoption9cfa961

lines 156–169why, one step back
156
157- 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-changes

Merge pull request #1774 from pallets/update-projectDavid Lordbefore adoption506e4eb

line 170why, one step back
170.. _create a pull request: https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/creating-a-pull-request

update contributing guide (#1584)David Lordbefore adoption9cfa961

lines 171–222why, one step back
171
172173Running 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/>`__.