X Tutup
Skip to content

Commit fc6d0f4

Browse files
committed
Expanding more subjects
1 parent fc64cc0 commit fc6d0f4

File tree

3 files changed

+123
-25
lines changed

3 files changed

+123
-25
lines changed

CONTRIBUTING.rst

Lines changed: 116 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,130 @@
11
How To Contribute
22
=================
33

4-
Every open source project lives from the generous help by contributors that sacrifice their time and ``python-telegram-bot`` is no different.
4+
Every open source project lives from the generous help by contributors that sacrifice their time and ``python-telegram-bot`` is no different. To make participation as pleasant as possible, this project adheres to the `Code of Conduct`_ by the Python Software Foundation.
55

6-
To make participation as pleasant as possible, this project adheres to the `Code of Conduct`_ by the Python Software Foundation.
6+
Setting things up
7+
-----------------
78

8-
Here are a few guidelines to get you started:
9+
1. Fork the ``python-telegram-bot`` repository to your GitHub account.
910

10-
- Add yourself to the AUTHORS.rst_ file in an alphabetical fashion.
11-
Every contribution is valuable and shall be credited.
12-
- If your change is noteworthy, add an entry to the CHANGES_.
13-
- No contribution is too small; please submit as many fixes for typos and grammar bloopers as you can!
14-
- Don’t break backward compatibility.
15-
- *Always* add tests and docs for your code.
16-
This is a hard rule; patches with missing tests or documentation won’t be merged.
17-
If a feature is not tested or documented, it doesn’t exist.
18-
- Obey `PEP 8`_ and `PEP 257`_.
19-
- Follow `Google Python Style Guide`_ and `Google Python Style Docstrings`_.
20-
- Write `good commit messages`_.
11+
2. Clone your forked repository of ``python-telegram-bot`` to your computer:
2112

22-
.. note::
23-
If you have something great but aren’t sure whether it adheres -- or even can adhere -- to the rules above: **please submit a pull request anyway**!
13+
``$ git clone https://github.com/<your username>/python-telegram-bot``
2414

25-
In the best case, we can mold it into something, in the worst case the pull request gets politely closed.
26-
There’s absolutely nothing to fear.
15+
``$ cd python-telegram-bot``
2716

28-
Thank you for considering to contribute to ``python-telegram-bot``!
29-
If you have any question or concerns, feel free to reach out to me.
17+
3. Add a track to the original repository:
3018

19+
``$ git remote add upstream https://github.com/python-telegram-bot/python-telegram-bot``
20+
21+
4. Install dependencies:
22+
23+
``$ pip install -r requirements.txt``
24+
25+
``$ pip install -r requirements-dev.txt``
26+
27+
5. In order to run tests you need to set the following environment variables:
28+
29+
``$ export CHAT_ID=your-chat-id``
30+
31+
``$ export TOKEN=your-bot-token``
32+
33+
Finding something to do
34+
-----------------------
35+
36+
If you already know what you'd like to work on, you can skip this section.
37+
38+
If you have an idea for something to do, first check if it's already been filed on the `issue tracker`_. If so, add a comment to the issue saying you'd like to work on it, and we'll help you get started! Otherwise, please file a new issue and assign yourself to it.
39+
40+
Another great way to start contributing is by writing tests. Tests are really important because they help prevent developers from accidentally breaking existing code, allowing them to build cool things faster. If you're interested in helping out, let the development team know by posting to the `developers' mailing list`_, and we'll help you get started.
41+
42+
Instructions for making a code change
43+
-------------------------------------
44+
45+
The central development branch is ``master``, which should be clean and ready for release at any time. In general, all changes should be done as feature branches based off of ``master``.
46+
47+
Here's how to make a one-off code change.
48+
49+
1. **Choose a descriptive branch name.** It should be lowercase, hyphen-separated, and a noun describing the change (so, ``fuzzy-rules``, but not ``implement-fuzzy-rules``). Also, it shouldn't start with ``hotfix`` or ``release``.
50+
51+
2. **Create a new branch with this name, starting from** ``master``. In other words, run:
52+
53+
``$ git fetch upstream``
54+
55+
``$ git checkout master``
56+
57+
``$ git checkout merge upstream/master``
58+
59+
``$ git checkout -b your-branch-name``
60+
61+
3. **Make a commit to your feature branch**. Each commit should be self-contained and have a descriptive commit message that helps other developers understand why the changes were made.
62+
63+
- You can refer to relevant issues in the commit message by writing, e.g., "#105".
64+
65+
- For consistency, please conform to `Google Python Style Guide`_ and `Google Python Style Docstrings`_. In addition, code should be formatted consistently with other code around it.
66+
67+
- Please ensure that the code you write is well-tested.
68+
69+
- Don’t break backward compatibility.
70+
71+
- Add yourself to the AUTHORS.rst_ file in an alphabetical fashion.
72+
73+
- Before making a commit ensure that all automated tests still pass:
74+
75+
``$ make test``
76+
77+
- To actually make the commit and push it to your GitHub fork, run:
78+
79+
``$ git commit -a -m "your-commit-message-here"``
80+
81+
``$ git push origin your-branch-name``
82+
83+
4. **When your feature is ready to merge, create a pull request.**
84+
85+
- Go to your fork on GitHub, select your branch from the dropdown menu, and click "New pull request".
86+
87+
- Add a descriptive comment explaining the purpose of the branch (e.g. "Add the new API feature to create inline bot queries."). This will tell the reviewer what the purpose of the branch is.
88+
89+
- Click "Create pull request". An admin will assign a reviewer to your commit.
90+
91+
5. **Address review comments until all reviewers give LGTM ('looks good to me').**
92+
93+
- When your reviewer has reviewed the code, you'll get an email. You'll need to respond in two ways:
94+
95+
- Make a new commit addressing the comments you agree with, and push it to the same branch. Ideally, the commit message would explain what the commit does (e.g. "Fix lint error"), but if there are lots of disparate review comments, it's fine to refer to the original commit message and add something like "(address review comments)".
96+
97+
- In addition, please reply to each comment. Each reply should be either "Done" or a response explaining why the corresponding suggestion wasn't implemented. All comments must be resolved before LGTM can be given.
98+
99+
- Resolve any merge conflicts that arise. To resolve conflicts between 'your-branch-name' (in your fork) and 'master' (in the ``python-telegram-bot`` repository), run:
100+
101+
``$ git checkout your-branch-name``
102+
103+
``$ git fetch upstream``
104+
105+
``$ git merge upstream/master``
106+
107+
``$ ...[fix the conflicts]...``
108+
109+
``$ ...[make sure the tests pass before committing]...``
110+
111+
``$ git commit -a``
112+
113+
``$ git push origin your-branch-name``
114+
115+
- At the end, the reviewer will merge the pull request.
116+
117+
6. **Tidy up!** Delete the feature branch from your both your local clone and the GitHub repository:
118+
119+
``$ git branch -D your-branch-name``
120+
121+
``$ git push origin --delete your-branch-name``
122+
123+
7. **Celebrate.** Congratulations, you have contributed to ``python-telegram-bot``!
31124

32-
.. _`PEP 8`: https://www.python.org/dev/peps/pep-0008/
33-
.. _`PEP 257`: https://www.python.org/dev/peps/pep-0257/
34-
.. _`good commit messages`: http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html
35125
.. _`Code of Conduct`: https://www.python.org/psf/codeofconduct/
126+
.. _`issue tracker`: https://github.com/python-telegram-bot/python-telegram-bot/issues
127+
.. _`developers' mailing list`: mailto:devs@python-telegram-bot.org
36128
.. _`Google Python Style Guide`: https://google-styleguide.googlecode.com/svn/trunk/pyguide.html
37129
.. _`Google Python Style Docstrings`: http://sphinx-doc.org/latest/ext/example_google.html
38-
.. _CHANGES: https://github.com/python-telegram-bot/python-telegram-bot/blob/master/CHANGES
39-
.. _AUTHORS.rst: https://github.com/python-telegram-bot/python-telegram-bot/blob/master/AUTHORS.rst
130+
.. _AUTHORS.rst: https://github.com/python-telegram-bot/python-telegram-bot/blob/master/AUTHORS.rst

README.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,10 @@ Check out the latest development version anonymously with::
143143
$ git clone https://github.com/python-telegram-bot/python-telegram-bot
144144
$ cd python-telegram-bot
145145

146+
Install dependencies:
147+
148+
$ pip install -r requirements.txt
149+
146150
Run tests:
147151

148152
$ make test

requirements-dev.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
nose
2+
pep8
3+
pylint

0 commit comments

Comments
 (0)
X Tutup